@camstack/addon-provider-petkit 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
@@ -8321,8 +8321,31 @@ var AdoptionJobSchema = object({
8321
8321
  error: string().nullable()
8322
8322
  });
8323
8323
  /**
8324
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
8325
- * pipeline functions an operator thinks in terms of.
8324
+ * Per-camera FUNCTION SWITCHES.
8325
+ *
8326
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
8327
+ *
8328
+ * This file shipped as "the one coherent on/off surface over the pipeline
8329
+ * functions an operator thinks in terms of". The operator's verdict on
8330
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
8331
+ * every function already had a settings page of its own, and a second place to
8332
+ * turn it off is a second place to look. Each switch is going back to its own
8333
+ * component's original options — detection to the detection-pipeline wrapper
8334
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
8335
+ * (which was always first-class; the switch was a veneer over
8336
+ * `recording.setDeviceConfig`), notifications to a notification-center
8337
+ * per-device setting, the two camera planes to their own components.
8338
+ *
8339
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
8340
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
8341
+ * straight from the authorities with no group in the middle. That rule was
8342
+ * never about a control panel.
8343
+ *
8344
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
8345
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
8346
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
8347
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
8348
+ * stop; nothing new may be built on it.
8326
8349
  *
8327
8350
  * ## This file adds no state
8328
8351
  *
@@ -8667,14 +8690,21 @@ var RecordingConfigSchema = object({
8667
8690
  /**
8668
8691
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8669
8692
  *
8670
- * One shape shared by the recorder's `relocateFootage` (segments) and
8671
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
8672
- * page renders both movers with one component. Jobs are in-RAM (a restart
8673
- * forgets them re-running is safe by construction: copy-if-absent, delete
8674
- * after verify) and each completed/failed run also lands one durable ops-log
8675
- * row on the owning addon's surface.
8693
+ * One shape shared by the recorder and pipeline-analytics internal movers.
8694
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
8695
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
8696
+ * Each completed/failed run also lands one durable ops-log row on its owning
8697
+ * addon surface.
8698
+ */
8699
+ /**
8700
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
8701
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
8702
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
8703
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
8704
+ * runs at all.
8676
8705
  */
8677
8706
  var RelocateJobStateSchema = _enum([
8707
+ "queued",
8678
8708
  "running",
8679
8709
  "done",
8680
8710
  "failed",
@@ -8699,19 +8729,109 @@ var RelocateJobSchema = object({
8699
8729
  finishedAt: number().nullable(),
8700
8730
  error: string().nullable()
8701
8731
  });
8732
+ /** Profile-derived footage selection used only by the migration coordinator:
8733
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
8734
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
8702
8735
  var RelocateFootageInputSchema = object({
8703
- deviceId: number().optional(),
8704
8736
  fromLocationId: string(),
8705
8737
  toLocationId: string(),
8706
8738
  entities: array(_enum(["segments"])).optional(),
8739
+ /** Limits relocation to the logical profile class. Omit only for the
8740
+ * pre-orchestration compatibility path. */
8741
+ footageClass: RelocateFootageClassSchema.optional(),
8742
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
8743
+ * is what a whole-disk drain means. The rebalance path always sets it: its
8744
+ * unit is a (camera, profile) pile, not a disk. */
8745
+ deviceId: number().int().optional(),
8746
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
8747
+ * Finer than `footageClass`, which cannot separate high from mid — and the
8748
+ * placement plan assigns those two independently, so a rebalance that could
8749
+ * only say "recordings" would move footage the plan never asked to move. */
8750
+ profiles: array(string()).optional(),
8707
8751
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
8708
8752
  * never allowed to starve live writers. */
8709
8753
  throttleMbps: number().min(1).max(1e3).optional()
8710
8754
  });
8711
- var RelocateMediaInputSchema = object({
8712
- deviceId: number().optional(),
8755
+ /** Internal, lease-scoped participant operation. It is intentionally separate
8756
+ * from persistent recording settings: a migration never changes
8757
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
8758
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8759
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8760
+ var StorageMigrationMediaMoveInputSchema = object({
8713
8761
  toLocationId: string(),
8714
8762
  throttleMbps: number().min(1).max(1e3).optional()
8763
+ }).extend({ leaseId: string().min(1) });
8764
+ /** The independently selectable logical storage classes. `recordings`
8765
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
8766
+ * segments; `eventMedia` is post-analysis blobs. */
8767
+ var StorageMigrationClassSchema = _enum([
8768
+ "recordings",
8769
+ "recordingsLow",
8770
+ "eventMedia"
8771
+ ]);
8772
+ /** A destination is always an existing, fully-qualified location id. The
8773
+ * migration API intentionally never changes a source location's `basePath`:
8774
+ * callers create a new `<type>:<slug>` location, then select it here. */
8775
+ var StorageMigrationDestinationsSchema = object({
8776
+ recordings: string().min(1).optional(),
8777
+ recordingsLow: string().min(1).optional(),
8778
+ eventMedia: string().min(1).optional()
8779
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8780
+ /** Shared input for planning and starting an orchestrated storage migration. */
8781
+ var StorageMigrationInputSchema = object({
8782
+ destinations: StorageMigrationDestinationsSchema,
8783
+ throttleMbps: number().min(1).max(1e3).optional()
8784
+ });
8785
+ /** The durable coordinator state machine. The only phase that changes default
8786
+ * locations is `repointing`, after every selected mover has completed and been
8787
+ * verified. */
8788
+ var StorageMigrationPhaseSchema = _enum([
8789
+ "planning",
8790
+ "pausing",
8791
+ "moving",
8792
+ "verifying",
8793
+ "repointing",
8794
+ "refreshing",
8795
+ "resuming",
8796
+ "done",
8797
+ "failed",
8798
+ "cancelled"
8799
+ ]);
8800
+ var StorageMigrationParticipantSchema = _enum([
8801
+ "pipeline",
8802
+ "recorder",
8803
+ "analytics"
8804
+ ]);
8805
+ var StorageMigrationMoveSchema = object({
8806
+ storageClass: StorageMigrationClassSchema,
8807
+ fromLocationId: string(),
8808
+ toLocationId: string(),
8809
+ moverJobId: string().nullable(),
8810
+ state: RelocateJobStateSchema.nullable(),
8811
+ error: string().nullable()
8812
+ });
8813
+ var StorageMigrationJobSchema = object({
8814
+ jobId: string(),
8815
+ phase: StorageMigrationPhaseSchema,
8816
+ destinations: StorageMigrationDestinationsSchema,
8817
+ throttleMbps: number(),
8818
+ moves: array(StorageMigrationMoveSchema),
8819
+ pauseLeaseId: string().nullable(),
8820
+ pausedParticipants: array(StorageMigrationParticipantSchema),
8821
+ repointed: boolean(),
8822
+ cancelRequested: boolean(),
8823
+ startedAt: number(),
8824
+ updatedAt: number(),
8825
+ finishedAt: number().nullable(),
8826
+ error: string().nullable()
8827
+ });
8828
+ var StorageMigrationPlanSchema = object({
8829
+ destinations: StorageMigrationDestinationsSchema,
8830
+ moves: array(object({
8831
+ storageClass: StorageMigrationClassSchema,
8832
+ fromLocationId: string(),
8833
+ toLocationId: string()
8834
+ }))
8715
8835
  });
8716
8836
  /**
8717
8837
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8763,6 +8883,21 @@ var StorageLocationSchema = object({
8763
8883
  nodeId: string().optional(),
8764
8884
  isDefault: boolean().default(false),
8765
8885
  isSystem: boolean().default(false),
8886
+ /**
8887
+ * Operator opt-in: whether consumers that BALANCE across several locations
8888
+ * of a type may write here. Recordings reads it today; event media and
8889
+ * backups are the next consumers, which is why the flag lives on the
8890
+ * location rather than in any one addon's store — nothing has to be
8891
+ * extended to add the next consumer.
8892
+ *
8893
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8894
+ * flag existed reads back with no flag and keeps working exactly as before;
8895
+ * that is the whole compat story, and it is why no migration ships with it.
8896
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8897
+ * disk must not silently start writing to it); the default of a type is
8898
+ * always stamped `true`.
8899
+ */
8900
+ enabled: boolean().optional(),
8766
8901
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8767
8902
  * for node-local locations it can reach) — never persisted, absent when the
8768
8903
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -13332,7 +13467,8 @@ method(object({
13332
13467
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
13333
13468
  /**
13334
13469
  * filesystem-browse — per-node capability for browsing the node's local
13335
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
13470
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13471
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
13336
13472
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
13337
13473
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
13338
13474
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -15173,6 +15309,13 @@ var MaskGridDimsSchema = object({
15173
15309
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
15174
15310
  * this one field keeps the schema additive — a rule still declares exactly
15175
15311
  * one trigger.
15312
+ *
15313
+ * AUDIO rules add no member here, for the reason occupancy added none: the
15314
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
15315
+ * mirror.ts` fails the build on a member the app cannot render) and every
15316
+ * member costs a release train. A sustained-sound rule is therefore an
15317
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
15318
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
15176
15319
  */
15177
15320
  var NcDeliverySchema = _enum([
15178
15321
  "immediate",
@@ -15187,15 +15330,32 @@ var NcDeliverySchema = _enum([
15187
15330
  * depend on a provider's raw event name or payload shape.
15188
15331
  */
15189
15332
  var NcSystemEventKindSchema = _enum([
15190
- "camera-online",
15191
- "camera-offline",
15333
+ "device-online",
15334
+ "device-offline",
15335
+ "device-disabled",
15336
+ "device-enabled",
15192
15337
  "stream-online",
15193
15338
  "stream-offline",
15194
15339
  "node-online",
15195
15340
  "node-offline",
15196
15341
  "addon-update-available",
15197
- "server-update-available"
15342
+ "server-update-available",
15343
+ "alarm-triggered",
15344
+ "alarm-armed",
15345
+ "alarm-disarmed",
15346
+ "camera-online",
15347
+ "camera-offline",
15348
+ "camera-disabled",
15349
+ "camera-enabled"
15350
+ ]);
15351
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
15352
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
15353
+ "camera-online",
15354
+ "camera-offline",
15355
+ "camera-disabled",
15356
+ "camera-enabled"
15198
15357
  ]);
15358
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
15199
15359
  /**
15200
15360
  * One coherent system-event condition. `kinds` is the required opt-in safety
15201
15361
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -15204,6 +15364,18 @@ var NcSystemEventKindSchema = _enum([
15204
15364
  var NcSystemEventConditionSchema = object({
15205
15365
  kinds: array(NcSystemEventKindSchema).min(1),
15206
15366
  deviceIds: array(number().int()).min(1).optional(),
15367
+ /**
15368
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
15369
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
15370
+ * is what a liveness rule means when nobody said otherwise.
15371
+ *
15372
+ * This is where "only my cameras" is expressed, and it lives on the rule for
15373
+ * one reason: the intake cannot know which devices this household cares
15374
+ * about, and a producer-side filter is one no operator can change. Fails
15375
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
15376
+ * does not carry) matches no `deviceTypes` list.
15377
+ */
15378
+ deviceTypes: array(string().min(1)).min(1).optional(),
15207
15379
  nodeIds: array(string().min(1)).min(1).optional(),
15208
15380
  packageNames: array(string().min(1)).min(1).optional()
15209
15381
  });
@@ -15254,6 +15426,47 @@ var NcOccupancyConditionSchema = object({
15254
15426
  sustainSeconds: number().int().min(0).max(3600).default(15)
15255
15427
  });
15256
15428
  /**
15429
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
15430
+ *
15431
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
15432
+ * reference notifier uses, so an operator moving between them re-uses what
15433
+ * they already know): a rule matches when, over a sampling window of
15434
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
15435
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
15436
+ *
15437
+ * - `dbThreshold` — its level is at or above this many dBFS (see
15438
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
15439
+ * - `labels` — the classifier put at least one of these labels on it.
15440
+ *
15441
+ * Both are OPTIONAL and independent, which is the point of the shape: a
15442
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
15443
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
15444
+ * is given** — a window in which every sample is trivially a hit would fire on
15445
+ * silence, so the engine refuses such a condition rather than notifying on
15446
+ * nothing (the schema cannot express "at least one of" without becoming a
15447
+ * ZodEffects the cap path would have to special-case).
15448
+ *
15449
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
15450
+ * must be FULL before it can match — a window that has been open for two
15451
+ * seconds of its ten is 100% of nothing, and firing on it would make
15452
+ * `samplingSeconds` decorative.
15453
+ *
15454
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
15455
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
15456
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
15457
+ * an operator who typed `dog` mean the same thing.
15458
+ */
15459
+ var NcAudioConditionSchema = object({
15460
+ /** Audio macro labels; absent = any sound (level-only rule). */
15461
+ labels: array(string().min(1)).min(1).optional(),
15462
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
15463
+ dbThreshold: number().min(-96).max(0).optional(),
15464
+ /** Percentage of the window's samples that must be hits (1–100). */
15465
+ hitPercent: number().int().min(1).max(100).default(60),
15466
+ /** Length of the sampling window in seconds. */
15467
+ samplingSeconds: number().int().min(1).max(300).default(10)
15468
+ });
15469
+ /**
15257
15470
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
15258
15471
  *
15259
15472
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -15526,7 +15739,33 @@ var NcConditionsSchema = object({
15526
15739
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
15527
15740
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
15528
15741
  */
15529
- occupancy: NcOccupancyConditionSchema.optional()
15742
+ occupancy: NcOccupancyConditionSchema.optional(),
15743
+ /**
15744
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
15745
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
15746
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
15747
+ * a window that is not full yet, neither filter given). See
15748
+ * {@link NcAudioCondition}.
15749
+ *
15750
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
15751
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
15752
+ * a detection, a track or a device event (the same fail-closed pairing
15753
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
15754
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
15755
+ * (an `immediate` rule naming an `audio-*` class, one notification per
15756
+ * classified sample) stays exactly as it was for rules that already use it.
15757
+ *
15758
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15759
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15760
+ * (`camstack/src/data/notification-center.ts`, guarded by
15761
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15762
+ * condition fields it does not know when a rule is saved from the phone.
15763
+ * Publishing an editor for a condition the app cannot round-trip is how an
15764
+ * operator loses a rule's conditions by opening it — so the descriptor, the
15765
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
15766
+ * does an audio rule become authorable.
15767
+ */
15768
+ audio: NcAudioConditionSchema.optional()
15530
15769
  });
15531
15770
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
15532
15771
  var NcRuleTargetSchema = object({
@@ -15640,6 +15879,73 @@ var NcThrottleSchema = object({
15640
15879
  */
15641
15880
  granularity: NcThrottleGranularitySchema.optional()
15642
15881
  });
15882
+ /**
15883
+ * How long the confirm gate may hold ONE notification, and how big the picture
15884
+ * it judges may be.
15885
+ *
15886
+ * The clamp is the product decision, not a coincidence of the model: p50 was
15887
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
15888
+ * arrives after the visitor has gone is not a notification. 448 px was enough
15889
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
15890
+ * tokens for pixels the model pools away.
15891
+ */
15892
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15893
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15894
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15895
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15896
+ var NcConfirmExpectSchema = object({
15897
+ op: _enum([
15898
+ ">=",
15899
+ ">",
15900
+ "<=",
15901
+ "<",
15902
+ "=="
15903
+ ]),
15904
+ count: number().int().min(0).max(1e3)
15905
+ });
15906
+ /**
15907
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15908
+ * to ship and says whether it agrees with the rule.
15909
+ *
15910
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15911
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15912
+ * on the operator's phone is not a verdict about this notification.
15913
+ *
15914
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15915
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15916
+ * the default and every fail-open is COUNTED, because a gate that always fails
15917
+ * open looks in the log exactly like a gate that works.
15918
+ *
15919
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15920
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15921
+ * production failures in one day), so the gate reads absent as the constant
15922
+ * above rather than trusting a parse it may never have seen.
15923
+ */
15924
+ var NcConfirmSchema = object({
15925
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15926
+ * same thing, and both mean "deliver exactly as before". */
15927
+ enabled: boolean().default(false),
15928
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15929
+ profileId: string().optional(),
15930
+ /**
15931
+ * The operator's question, in his own words. Absent = a question derived
15932
+ * from the rule (its class and its expectation).
15933
+ *
15934
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15935
+ * banners, signage and plates as instructions if you let them reach the
15936
+ * prompt — proven live — so the authoritative contract stays in the system
15937
+ * turn and only rule-authored words land here.
15938
+ */
15939
+ prompt: string().max(1e3).optional(),
15940
+ /** Fire only when the model's count satisfies this. Absent = the model's
15941
+ * own boolean verdict decides. */
15942
+ expect: NcConfirmExpectSchema.optional(),
15943
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15944
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15945
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15946
+ /** Longest edge the judged image is downscaled to before it is sent. */
15947
+ maxImagePx: number().int().min(64).max(2048).default(448)
15948
+ });
15643
15949
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
15644
15950
  var NcRuleInputSchema = object({
15645
15951
  name: string().min(1).max(200),
@@ -15700,7 +16006,13 @@ var NcRuleInputSchema = object({
15700
16006
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
15701
16007
  * shape as every other actuation.
15702
16008
  */
15703
- actions: NcRuleActionsSchema.optional()
16009
+ actions: NcRuleActionsSchema.optional(),
16010
+ /**
16011
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
16012
+ * a rule that predates the gate must keep delivering byte-for-byte as it
16013
+ * did, and absent is the only way to say that without a migration.
16014
+ */
16015
+ confirm: NcConfirmSchema.optional()
15704
16016
  });
15705
16017
  /**
15706
16018
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15711,7 +16023,37 @@ var NcRuleInputSchema = object({
15711
16023
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
15712
16024
  * `updateRule` patch.
15713
16025
  */
15714
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
16026
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
16027
+ disabledTargetIds: array(string()).optional(),
16028
+ /**
16029
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
16030
+ *
16031
+ * It makes the key optional to SUPPLY; the parse still materialises the
16032
+ * default when the key is absent. And `NcRuleStore.update` merges with
16033
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
16034
+ * one — which made every partial edit destructive:
16035
+ *
16036
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
16037
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
16038
+ * setEnabled(ruleId, false) → conditions reset to `{}`
16039
+ *
16040
+ * A rule scoped to one camera and one zone silently became a rule that
16041
+ * matches EVERY event on EVERY camera, and lost its `media` policy
16042
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
16043
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
16044
+ * within a minute of a two-field patch.
16045
+ *
16046
+ * So every defaulted field is re-declared here WITHOUT its default. The
16047
+ * inner defaults still apply when the caller DOES send the key — `{}` for
16048
+ * conditions remains a real instruction ("clear them") — and only the
16049
+ * absent key is now genuinely absent.
16050
+ */
16051
+ enabled: boolean().optional(),
16052
+ conditions: NcConditionsSchema.optional(),
16053
+ media: NcMediaPolicySchema.optional(),
16054
+ throttle: NcThrottleSchema.optional(),
16055
+ priority: number().int().min(1).max(5).optional()
16056
+ });
15715
16057
  /** A persisted rule. */
15716
16058
  var NcRuleSchema = NcRuleInputSchema.extend({
15717
16059
  id: string(),
@@ -16012,6 +16354,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
16012
16354
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
16013
16355
  * copy would lie the first time a rule is disabled.
16014
16356
  */
16357
+ /**
16358
+ * Why a device a mode NAMES is nonetheless not armed by it.
16359
+ *
16360
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
16361
+ * per-camera notification switch the Notification Center already owns,
16362
+ * `detection-off` is the device's own detection binding being inactive, and
16363
+ * `offline` is the device manager's liveness. A fourth reason would mean a
16364
+ * fourth authority, and inventing one here is how a panel starts disagreeing
16365
+ * with the switches the operator actually used.
16366
+ */
16367
+ var NcAlarmSkipReasonSchema = _enum([
16368
+ "muted",
16369
+ "detection-off",
16370
+ "offline"
16371
+ ]);
16372
+ var NcAlarmSkippedDeviceSchema = object({
16373
+ deviceId: number().int(),
16374
+ reason: NcAlarmSkipReasonSchema
16375
+ });
16015
16376
  var NcAlarmModeCoverageSchema = object({
16016
16377
  mode: AlarmArmModeSchema,
16017
16378
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -16019,7 +16380,18 @@ var NcAlarmModeCoverageSchema = object({
16019
16380
  /** At least one covering rule has no device scope, so the mode covers all. */
16020
16381
  allDevices: boolean(),
16021
16382
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
16022
- deviceIds: array(number().int())
16383
+ deviceIds: array(number().int()),
16384
+ /**
16385
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
16386
+ * excludes it.
16387
+ *
16388
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
16389
+ * twelve makes it false in exactly the way nobody notices until an incident.
16390
+ * Defaulted to `[]` so a coverage answer computed before this field existed
16391
+ * still parses as "nothing known to be skipped" rather than failing the whole
16392
+ * alarm tab.
16393
+ */
16394
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
16023
16395
  });
16024
16396
  var NcAlarmConfigSchema = object({
16025
16397
  /**
@@ -17382,13 +17754,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17382
17754
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17383
17755
  kind: "mutation",
17384
17756
  auth: "admin"
17385
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17757
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17386
17758
  kind: "mutation",
17387
17759
  auth: "admin"
17388
- }), method(object({}), array(RelocateJobSchema).readonly(), {
17389
- kind: "query",
17760
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17761
+ kind: "mutation",
17390
17762
  auth: "admin"
17391
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17763
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
17764
+ kind: "mutation",
17765
+ auth: "admin"
17766
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
17767
+ kind: "mutation",
17768
+ auth: "admin"
17769
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17392
17770
  kind: "mutation",
17393
17771
  auth: "admin"
17394
17772
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -18845,9 +19223,16 @@ var CameraStatusSchema = object({
18845
19223
  audio: CameraAudioStatusSchema.nullable(),
18846
19224
  recording: CameraRecordingStatusSchema.nullable(),
18847
19225
  /**
18848
- * Per-camera function switches an OPERATOR has turned off
19226
+ * Per-camera functions an OPERATOR has turned off
18849
19227
  * ([D61](../../../../docs/decisions/adr-0067.md)).
18850
19228
  *
19229
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
19230
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
19231
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
19232
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
19233
+ * The badge outlives the control panel: the panel was a convenience, this is
19234
+ * the difference between a camera being off and a camera being dead.
19235
+ *
18851
19236
  * This is the difference between DISABLED and BROKEN. A camera whose
18852
19237
  * `detection` block reports zero fps and whose `switchedOff` contains
18853
19238
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -18918,7 +19303,13 @@ var NodeInferenceDevicesSchema = object({
18918
19303
  reachable: boolean(),
18919
19304
  devices: array(NodeInferenceDeviceSchema).readonly()
18920
19305
  });
18921
- method(object({
19306
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
19307
+ kind: "mutation",
19308
+ auth: "admin"
19309
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
19310
+ kind: "mutation",
19311
+ auth: "admin"
19312
+ }), method(object({
18922
19313
  deviceId: number(),
18923
19314
  agentNodeId: string()
18924
19315
  }), object({ success: literal(true) }), {
@@ -19592,6 +19983,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
19592
19983
  locationId: string(),
19593
19984
  targetBytes: number().int().positive()
19594
19985
  }), EvictResultSchema, { kind: "mutation" });
19986
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
19987
+ kind: "mutation",
19988
+ auth: "admin"
19989
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
19990
+ kind: "mutation",
19991
+ auth: "admin"
19992
+ });
19595
19993
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
19596
19994
  providerId: string().min(1),
19597
19995
  displayName: string().min(1),
@@ -19695,6 +20093,28 @@ var TerminalProfileInfoSchema = object({
19695
20093
  label: string(),
19696
20094
  description: string().optional()
19697
20095
  });
20096
+ /**
20097
+ * A durable operator-created Terminal instance. Profiles are templates; only
20098
+ * an instance declares a camera.
20099
+ */
20100
+ var TerminalInstanceInfoSchema = object({
20101
+ instanceId: string(),
20102
+ cameraStableId: string(),
20103
+ nodeId: string(),
20104
+ profileId: string(),
20105
+ profileLabel: string(),
20106
+ name: string(),
20107
+ enabled: boolean()
20108
+ });
20109
+ var TerminalLegacyCameraSchema = object({
20110
+ stableId: string(),
20111
+ nodeId: string(),
20112
+ profileId: string(),
20113
+ profileLabel: string(),
20114
+ name: string(),
20115
+ /** Only legacy monitor cameras can retain their historic stable identity. */
20116
+ adoptable: boolean()
20117
+ });
19698
20118
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
19699
20119
  seq: number().int().positive(),
19700
20120
  kind: literal("data"),
@@ -19711,7 +20131,29 @@ var TerminalOutputBatchSchema = object({
19711
20131
  snapshot: string().optional(),
19712
20132
  events: array(TerminalOutputEventSchema).readonly()
19713
20133
  });
19714
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
20134
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20135
+ targetNodeId: string().min(1),
20136
+ profileId: string().min(1),
20137
+ name: string().trim().min(1).max(160).optional()
20138
+ }), TerminalInstanceInfoSchema, {
20139
+ kind: "mutation",
20140
+ auth: "admin"
20141
+ }), method(object({ instanceId: string().min(1) }), _void(), {
20142
+ kind: "mutation",
20143
+ auth: "admin"
20144
+ }), method(object({
20145
+ instanceId: string().min(1),
20146
+ enabled: boolean()
20147
+ }), TerminalInstanceInfoSchema, {
20148
+ kind: "mutation",
20149
+ auth: "admin"
20150
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
20151
+ stableId: string().min(1),
20152
+ name: string().trim().min(1).max(160).optional()
20153
+ }), TerminalInstanceInfoSchema, {
20154
+ kind: "mutation",
20155
+ auth: "admin"
20156
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19715
20157
  profileId: string(),
19716
20158
  cols: number().int().positive(),
19717
20159
  rows: number().int().positive()
@@ -19728,7 +20170,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19728
20170
  }), method(object({
19729
20171
  sessionId: string(),
19730
20172
  afterSeq: number().int().nonnegative(),
19731
- waitMs: number().int().min(0).max(2e3).default(0)
20173
+ waitMs: number().int().min(0).max(2e3).default(0),
20174
+ /**
20175
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
20176
+ * browser's initial repaint remains immediate; the camera snapshot
20177
+ * relay uses it to avoid encoding a blank startup frame.
20178
+ */
20179
+ waitForOutput: boolean().optional()
19732
20180
  }), TerminalOutputBatchSchema, {
19733
20181
  kind: "mutation",
19734
20182
  auth: "admin",
@@ -22234,6 +22682,7 @@ var FaceInfoSchema = object({
22234
22682
  var FaceFilterEnum = _enum([
22235
22683
  "unassigned",
22236
22684
  "recognized",
22685
+ "identified",
22237
22686
  "all"
22238
22687
  ]);
22239
22688
  var MediaFileLiteSchema$1 = object({
@@ -22262,6 +22711,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
22262
22711
  kind: "mutation",
22263
22712
  auth: "admin"
22264
22713
  }), method(object({
22714
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22715
+ deviceId: number().int().optional(),
22265
22716
  limit: number().int().positive().optional(),
22266
22717
  filter: FaceFilterEnum.optional(),
22267
22718
  /**
@@ -24491,6 +24942,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
24491
24942
  capName: string().min(1).max(64),
24492
24943
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
24493
24944
  valuePath: string().min(1).max(64)
24945
+ }),
24946
+ object({
24947
+ kind: literal("latest-recognition"),
24948
+ recognition: _enum(["person", "plate"])
24494
24949
  })
24495
24950
  ]);
24496
24951
  var OsdSlotBindingSchema = object({
@@ -24596,6 +25051,15 @@ method(object({ deviceId: number().int() }), object({
24596
25051
  }), object({ success: literal(true) }), {
24597
25052
  kind: "mutation",
24598
25053
  auth: "admin"
25054
+ }), method(object({
25055
+ sourceDeviceId: number().int(),
25056
+ targetDeviceId: number().int()
25057
+ }), object({
25058
+ copied: number().int().nonnegative(),
25059
+ skipped: number().int().nonnegative()
25060
+ }), {
25061
+ kind: "mutation",
25062
+ auth: "admin"
24599
25063
  }), method(object({
24600
25064
  deviceId: number().int(),
24601
25065
  slotId: string().min(1),
@@ -25518,7 +25982,19 @@ var RecordingManifestSchema = object({
25518
25982
  * profiles/subtrees/locations on this node). */
25519
25983
  var RecordingDeviceUsageSchema = object({
25520
25984
  deviceId: number(),
25521
- usedBytes: number()
25985
+ usedBytes: number(),
25986
+ /**
25987
+ * Start of this camera's OLDEST indexed segment, across every profile and
25988
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25989
+ * only honest answer to "is retention actually holding?" per camera.
25990
+ *
25991
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25992
+ * predates this field omits it entirely, and a hub whose types carry the
25993
+ * field must keep validating that older provider's payload: the framework
25994
+ * (types) and the addon ship on different trains, and the addon is usually
25995
+ * the later of the two.
25996
+ */
25997
+ oldestMs: number().nullable().optional()
25522
25998
  });
25523
25999
  /** Recording storage usage + capacity for one storage location. */
25524
26000
  var RecordingLocationUsageSchema = object({
@@ -25546,6 +26022,57 @@ var RecordingStorageUsageSchema = object({
25546
26022
  locations: array(RecordingLocationUsageSchema)
25547
26023
  });
25548
26024
  /**
26025
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
26026
+ *
26027
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
26028
+ * is the operator asking for the EXISTING archive to be brought into line with
26029
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
26030
+ * location, run FIFO behind the single-flight mover.
26031
+ *
26032
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
26033
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
26034
+ * (empty on the plan).
26035
+ */
26036
+ var RecordingRebalanceMoveSchema = object({
26037
+ deviceId: number(),
26038
+ profile: string(),
26039
+ fromLocationId: string(),
26040
+ toLocationId: string(),
26041
+ bytes: number(),
26042
+ files: number().int()
26043
+ });
26044
+ /** Why a pile that is out of place is staying there. Every refusal is
26045
+ * reported: a rebalance that silently drops a camera reads exactly like one
26046
+ * that had nothing to do. */
26047
+ var RecordingRebalanceSkipReasonSchema = _enum([
26048
+ "unassigned",
26049
+ "target-not-writable",
26050
+ "below-threshold",
26051
+ "no-headroom"
26052
+ ]);
26053
+ var RecordingRebalanceSkipSchema = object({
26054
+ deviceId: number(),
26055
+ profile: string(),
26056
+ fromLocationId: string(),
26057
+ /** The location the plan wants; null when the camera has no assignment. */
26058
+ toLocationId: string().nullable(),
26059
+ bytes: number(),
26060
+ reason: RecordingRebalanceSkipReasonSchema
26061
+ });
26062
+ var RecordingRebalancePlanSchema = object({
26063
+ moves: array(RecordingRebalanceMoveSchema),
26064
+ skipped: array(RecordingRebalanceSkipSchema),
26065
+ bytesToMove: number(),
26066
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
26067
+ jobIds: array(string())
26068
+ });
26069
+ var RecordingRebalanceInputSchema = object({
26070
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
26071
+ throttleMbps: number().min(1).max(1e3).optional(),
26072
+ /** Ignore piles smaller than this (default 1 GB). */
26073
+ minMoveGb: number().min(0).optional()
26074
+ });
26075
+ /**
25549
26076
  * Result of locating footage at a wall-clock instant for one device/profile.
25550
26077
  * `segment` carries the covering segment's window; `gap` reports the forward
25551
26078
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25693,6 +26220,21 @@ method(object({
25693
26220
  }), {
25694
26221
  kind: "mutation",
25695
26222
  auth: "admin"
26223
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
26224
+ kind: "mutation",
26225
+ auth: "admin"
26226
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
26227
+ kind: "mutation",
26228
+ auth: "admin"
26229
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
26230
+ kind: "mutation",
26231
+ auth: "admin"
26232
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
26233
+ kind: "mutation",
26234
+ auth: "admin"
26235
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26236
+ kind: "mutation",
26237
+ auth: "admin"
25696
26238
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25697
26239
  kind: "mutation",
25698
26240
  auth: "admin"
@@ -25702,9 +26244,15 @@ method(object({
25702
26244
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25703
26245
  kind: "mutation",
25704
26246
  auth: "admin"
26247
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26248
+ kind: "query",
26249
+ auth: "admin"
26250
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26251
+ kind: "mutation",
26252
+ auth: "admin"
25705
26253
  });
25706
26254
  /**
25707
- * `recordingExport` cap — render a footage time range into a single downloadable
26255
+ * `recording-export` cap — render a footage time range into a single downloadable
25708
26256
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25709
26257
  * bounded lifetime with a durable history, auto-expiry, and optional
25710
26258
  * delete-after-download.
@@ -25719,10 +26267,42 @@ method(object({
25719
26267
  */
25720
26268
  /** Playback-speed multiplier for the render (1 = realtime). */
25721
26269
  var ExportSpeedSchema = number().min(.25).max(32);
26270
+ /**
26271
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26272
+ *
26273
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
26274
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26275
+ * playlist. Handing it absolute epochs would make every call site responsible
26276
+ * for the same subtraction, and the one that forgot would emit a filter that
26277
+ * selects nothing — silently, as a uniform timelapse.
26278
+ */
26279
+ var ExportDenseRangeSchema = object({
26280
+ fromSec: number().nonnegative(),
26281
+ toSec: number().nonnegative()
26282
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
26283
+ /**
26284
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
26285
+ * listed ranges and at the base `everyMs` everywhere else.
26286
+ *
26287
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
26288
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
26289
+ */
26290
+ var ExportDenseSchema = object({
26291
+ everyMs: number().int().positive(),
26292
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
26293
+ });
25722
26294
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25723
26295
  var ExportTimelapseSchema = object({
25724
26296
  everyMs: number().int().positive(),
25725
- outputFps: number().int().min(1).max(60).optional()
26297
+ outputFps: number().int().min(1).max(60).optional(),
26298
+ /** Optional second, FASTER rate over the intervals that matter. */
26299
+ dense: ExportDenseSchema.optional()
26300
+ }).superRefine((v, ctx) => {
26301
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
26302
+ code: ZodIssueCode.custom,
26303
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
26304
+ path: ["dense", "everyMs"]
26305
+ });
25726
26306
  });
25727
26307
  /**
25728
26308
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25780,6 +26360,19 @@ var ExportDownloadSchema = object({
25780
26360
  url: string(),
25781
26361
  endpoints: array(string())
25782
26362
  });
26363
+ /**
26364
+ * A finished export's bytes, inline.
26365
+ *
26366
+ * `bytes` is the DECODED length — the number the caller bounds and logs
26367
+ * against, so nobody has to infer it from the base64 length.
26368
+ */
26369
+ var ExportBytesSchema = object({
26370
+ base64: string(),
26371
+ contentType: string(),
26372
+ /** Suggested filename, extension included. */
26373
+ name: string(),
26374
+ bytes: number().int().nonnegative()
26375
+ });
25783
26376
  method(object({
25784
26377
  deviceId: number(),
25785
26378
  profile: string(),
@@ -25804,6 +26397,9 @@ method(object({
25804
26397
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25805
26398
  kind: "query",
25806
26399
  auth: "protected"
26400
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
26401
+ kind: "query",
26402
+ auth: "protected"
25807
26403
  });
25808
26404
  /**
25809
26405
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31305,6 +31901,12 @@ Object.freeze({
31305
31901
  addonId: null,
31306
31902
  access: "delete"
31307
31903
  },
31904
+ "osdManager.copyDeviceConfiguration": {
31905
+ capName: "osd-manager",
31906
+ capScope: "system",
31907
+ addonId: null,
31908
+ access: "create"
31909
+ },
31308
31910
  "osdManager.getConditionSupport": {
31309
31911
  capName: "osd-manager",
31310
31912
  capScope: "system",
@@ -31401,7 +32003,7 @@ Object.freeze({
31401
32003
  addonId: null,
31402
32004
  access: "create"
31403
32005
  },
31404
- "pipelineAnalytics.cancelMediaRelocate": {
32006
+ "pipelineAnalytics.cancelStorageMigrationMove": {
31405
32007
  capName: "pipeline-analytics",
31406
32008
  capScope: "device",
31407
32009
  addonId: null,
@@ -31473,12 +32075,6 @@ Object.freeze({
31473
32075
  addonId: null,
31474
32076
  access: "view"
31475
32077
  },
31476
- "pipelineAnalytics.getMediaRelocateStatus": {
31477
- capName: "pipeline-analytics",
31478
- capScope: "device",
31479
- addonId: null,
31480
- access: "view"
31481
- },
31482
32078
  "pipelineAnalytics.getMotionEvents": {
31483
32079
  capName: "pipeline-analytics",
31484
32080
  capScope: "device",
@@ -31515,6 +32111,12 @@ Object.freeze({
31515
32111
  addonId: null,
31516
32112
  access: "view"
31517
32113
  },
32114
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
32115
+ capName: "pipeline-analytics",
32116
+ capScope: "device",
32117
+ addonId: null,
32118
+ access: "view"
32119
+ },
31518
32120
  "pipelineAnalytics.getTrack": {
31519
32121
  capName: "pipeline-analytics",
31520
32122
  capScope: "device",
@@ -31593,6 +32195,12 @@ Object.freeze({
31593
32195
  addonId: null,
31594
32196
  access: "view"
31595
32197
  },
32198
+ "pipelineAnalytics.pauseForStorageMigration": {
32199
+ capName: "pipeline-analytics",
32200
+ capScope: "device",
32201
+ addonId: null,
32202
+ access: "create"
32203
+ },
31596
32204
  "pipelineAnalytics.proposeRetrainAnnotations": {
31597
32205
  capName: "pipeline-analytics",
31598
32206
  capScope: "device",
@@ -31623,7 +32231,7 @@ Object.freeze({
31623
32231
  addonId: null,
31624
32232
  access: "create"
31625
32233
  },
31626
- "pipelineAnalytics.relocateMedia": {
32234
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
31627
32235
  capName: "pipeline-analytics",
31628
32236
  capScope: "device",
31629
32237
  addonId: null,
@@ -31635,6 +32243,12 @@ Object.freeze({
31635
32243
  addonId: null,
31636
32244
  access: "create"
31637
32245
  },
32246
+ "pipelineAnalytics.resumeForStorageMigration": {
32247
+ capName: "pipeline-analytics",
32248
+ capScope: "device",
32249
+ addonId: null,
32250
+ access: "create"
32251
+ },
31638
32252
  "pipelineAnalytics.saveRetrainAnnotations": {
31639
32253
  capName: "pipeline-analytics",
31640
32254
  capScope: "device",
@@ -31659,6 +32273,12 @@ Object.freeze({
31659
32273
  addonId: null,
31660
32274
  access: "create"
31661
32275
  },
32276
+ "pipelineAnalytics.startStorageMigrationMove": {
32277
+ capName: "pipeline-analytics",
32278
+ capScope: "device",
32279
+ addonId: null,
32280
+ access: "create"
32281
+ },
31662
32282
  "pipelineAnalytics.wipeAllAnalytics": {
31663
32283
  capName: "pipeline-analytics",
31664
32284
  capScope: "device",
@@ -32025,6 +32645,12 @@ Object.freeze({
32025
32645
  addonId: null,
32026
32646
  access: "view"
32027
32647
  },
32648
+ "pipelineOrchestrator.pauseForStorageMigration": {
32649
+ capName: "pipeline-orchestrator",
32650
+ capScope: "system",
32651
+ addonId: null,
32652
+ access: "create"
32653
+ },
32028
32654
  "pipelineOrchestrator.rebalance": {
32029
32655
  capName: "pipeline-orchestrator",
32030
32656
  capScope: "system",
@@ -32049,6 +32675,12 @@ Object.freeze({
32049
32675
  addonId: null,
32050
32676
  access: "view"
32051
32677
  },
32678
+ "pipelineOrchestrator.resumeForStorageMigration": {
32679
+ capName: "pipeline-orchestrator",
32680
+ capScope: "system",
32681
+ addonId: null,
32682
+ access: "create"
32683
+ },
32052
32684
  "pipelineOrchestrator.saveTemplate": {
32053
32685
  capName: "pipeline-orchestrator",
32054
32686
  capScope: "system",
@@ -32445,7 +33077,13 @@ Object.freeze({
32445
33077
  addonId: null,
32446
33078
  access: "create"
32447
33079
  },
32448
- "recording.cancelRelocate": {
33080
+ "recording.cancelRelocateJob": {
33081
+ capName: "recording",
33082
+ capScope: "system",
33083
+ addonId: null,
33084
+ access: "create"
33085
+ },
33086
+ "recording.cancelStorageMigrationMove": {
32449
33087
  capName: "recording",
32450
33088
  capScope: "system",
32451
33089
  addonId: null,
@@ -32481,7 +33119,7 @@ Object.freeze({
32481
33119
  addonId: null,
32482
33120
  access: "view"
32483
33121
  },
32484
- "recording.getRelocateStatus": {
33122
+ "recording.getStorageMigrationMoveStatus": {
32485
33123
  capName: "recording",
32486
33124
  capScope: "system",
32487
33125
  addonId: null,
@@ -32499,12 +33137,30 @@ Object.freeze({
32499
33137
  addonId: null,
32500
33138
  access: "view"
32501
33139
  },
33140
+ "recording.listRelocateJobs": {
33141
+ capName: "recording",
33142
+ capScope: "system",
33143
+ addonId: null,
33144
+ access: "view"
33145
+ },
32502
33146
  "recording.locateSegment": {
32503
33147
  capName: "recording",
32504
33148
  capScope: "system",
32505
33149
  addonId: null,
32506
33150
  access: "view"
32507
33151
  },
33152
+ "recording.pauseForStorageMigration": {
33153
+ capName: "recording",
33154
+ capScope: "system",
33155
+ addonId: null,
33156
+ access: "create"
33157
+ },
33158
+ "recording.planStorageRebalance": {
33159
+ capName: "recording",
33160
+ capScope: "system",
33161
+ addonId: null,
33162
+ access: "view"
33163
+ },
32508
33164
  "recording.pruneFootage": {
32509
33165
  capName: "recording",
32510
33166
  capScope: "system",
@@ -32523,6 +33179,12 @@ Object.freeze({
32523
33179
  addonId: null,
32524
33180
  access: "view"
32525
33181
  },
33182
+ "recording.refreshStorageLocationsForMigration": {
33183
+ capName: "recording",
33184
+ capScope: "system",
33185
+ addonId: null,
33186
+ access: "create"
33187
+ },
32526
33188
  "recording.relocateFootage": {
32527
33189
  capName: "recording",
32528
33190
  capScope: "system",
@@ -32547,44 +33209,68 @@ Object.freeze({
32547
33209
  addonId: null,
32548
33210
  access: "create"
32549
33211
  },
33212
+ "recording.resumeForStorageMigration": {
33213
+ capName: "recording",
33214
+ capScope: "system",
33215
+ addonId: null,
33216
+ access: "create"
33217
+ },
32550
33218
  "recording.setDeviceConfig": {
32551
33219
  capName: "recording",
32552
33220
  capScope: "system",
32553
33221
  addonId: null,
32554
33222
  access: "create"
32555
33223
  },
33224
+ "recording.startStorageMigrationMove": {
33225
+ capName: "recording",
33226
+ capScope: "system",
33227
+ addonId: null,
33228
+ access: "create"
33229
+ },
33230
+ "recording.startStorageRebalance": {
33231
+ capName: "recording",
33232
+ capScope: "system",
33233
+ addonId: null,
33234
+ access: "create"
33235
+ },
32556
33236
  "recordingExport.cancelExport": {
32557
- capName: "recordingExport",
33237
+ capName: "recording-export",
32558
33238
  capScope: "system",
32559
33239
  addonId: null,
32560
33240
  access: "create"
32561
33241
  },
32562
33242
  "recordingExport.createExport": {
32563
- capName: "recordingExport",
33243
+ capName: "recording-export",
32564
33244
  capScope: "system",
32565
33245
  addonId: null,
32566
33246
  access: "create"
32567
33247
  },
32568
33248
  "recordingExport.deleteExport": {
32569
- capName: "recordingExport",
33249
+ capName: "recording-export",
32570
33250
  capScope: "system",
32571
33251
  addonId: null,
32572
33252
  access: "delete"
32573
33253
  },
32574
33254
  "recordingExport.getDownloadUrl": {
32575
- capName: "recordingExport",
33255
+ capName: "recording-export",
32576
33256
  capScope: "system",
32577
33257
  addonId: null,
32578
33258
  access: "view"
32579
33259
  },
32580
33260
  "recordingExport.getExport": {
32581
- capName: "recordingExport",
33261
+ capName: "recording-export",
32582
33262
  capScope: "system",
32583
33263
  addonId: null,
32584
33264
  access: "view"
32585
33265
  },
32586
33266
  "recordingExport.listExports": {
32587
- capName: "recordingExport",
33267
+ capName: "recording-export",
33268
+ capScope: "system",
33269
+ addonId: null,
33270
+ access: "view"
33271
+ },
33272
+ "recordingExport.readExportBytes": {
33273
+ capName: "recording-export",
32588
33274
  capScope: "system",
32589
33275
  addonId: null,
32590
33276
  access: "view"
@@ -32943,6 +33629,30 @@ Object.freeze({
32943
33629
  addonId: null,
32944
33630
  access: "view"
32945
33631
  },
33632
+ "storageMigration.cancel": {
33633
+ capName: "storage-migration",
33634
+ capScope: "system",
33635
+ addonId: null,
33636
+ access: "create"
33637
+ },
33638
+ "storageMigration.plan": {
33639
+ capName: "storage-migration",
33640
+ capScope: "system",
33641
+ addonId: null,
33642
+ access: "view"
33643
+ },
33644
+ "storageMigration.start": {
33645
+ capName: "storage-migration",
33646
+ capScope: "system",
33647
+ addonId: null,
33648
+ access: "create"
33649
+ },
33650
+ "storageMigration.status": {
33651
+ capName: "storage-migration",
33652
+ capScope: "system",
33653
+ addonId: null,
33654
+ access: "view"
33655
+ },
32946
33656
  "storageProvider.abortUpload": {
32947
33657
  capName: "storage-provider",
32948
33658
  capScope: "system",
@@ -33321,12 +34031,42 @@ Object.freeze({
33321
34031
  addonId: null,
33322
34032
  access: "create"
33323
34033
  },
34034
+ "terminalSession.adoptLegacyMonitor": {
34035
+ capName: "terminal-session",
34036
+ capScope: "system",
34037
+ addonId: null,
34038
+ access: "create"
34039
+ },
33324
34040
  "terminalSession.close": {
33325
34041
  capName: "terminal-session",
33326
34042
  capScope: "system",
33327
34043
  addonId: null,
33328
34044
  access: "create"
33329
34045
  },
34046
+ "terminalSession.createInstance": {
34047
+ capName: "terminal-session",
34048
+ capScope: "system",
34049
+ addonId: null,
34050
+ access: "create"
34051
+ },
34052
+ "terminalSession.deleteInstance": {
34053
+ capName: "terminal-session",
34054
+ capScope: "system",
34055
+ addonId: null,
34056
+ access: "delete"
34057
+ },
34058
+ "terminalSession.listInstances": {
34059
+ capName: "terminal-session",
34060
+ capScope: "system",
34061
+ addonId: null,
34062
+ access: "view"
34063
+ },
34064
+ "terminalSession.listLegacyCameras": {
34065
+ capName: "terminal-session",
34066
+ capScope: "system",
34067
+ addonId: null,
34068
+ access: "view"
34069
+ },
33330
34070
  "terminalSession.listProfiles": {
33331
34071
  capName: "terminal-session",
33332
34072
  capScope: "system",
@@ -33357,6 +34097,12 @@ Object.freeze({
33357
34097
  addonId: null,
33358
34098
  access: "create"
33359
34099
  },
34100
+ "terminalSession.setInstanceEnabled": {
34101
+ capName: "terminal-session",
34102
+ capScope: "system",
34103
+ addonId: null,
34104
+ access: "create"
34105
+ },
33360
34106
  "terminalSession.writeInput": {
33361
34107
  capName: "terminal-session",
33362
34108
  capScope: "system",
@@ -33901,6 +34647,104 @@ var FramerateField = number().int().min(1).max(60);
33901
34647
  var TargetsField = array(NcRuleTargetSchema).min(1);
33902
34648
  var PriorityField = number().int().min(1).max(5);
33903
34649
  /**
34650
+ * Explicit override of the DENSE sampling cadence, seconds.
34651
+ *
34652
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34653
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34654
+ * made that same base 3 s and rendered a person pass as two frames.)
34655
+ *
34656
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34657
+ * `denseCadenceSec` and played at `framerate` occupies
34658
+ *
34659
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34660
+ *
34661
+ * 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.
34662
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34663
+ * and therefore the length of a quiet night, does not move.
34664
+ *
34665
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34666
+ * the recording has them returns the same frames, requested twice. Must be
34667
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34668
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34669
+ * rather than letting the export cap reject the render hours after the window.
34670
+ */
34671
+ var DenseCadenceSecField = number().min(.1).max(3600);
34672
+ /**
34673
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34674
+ *
34675
+ * The operator-facing form of the arithmetic above: instead of solving for a
34676
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34677
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34678
+ * that range every ~583 ms.
34679
+ *
34680
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34681
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34682
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34683
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34684
+ * schema change and are the tracked follow-up.
34685
+ *
34686
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34687
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34688
+ * by real footage, never met by duplicating frames into motion that never
34689
+ * happened.
34690
+ */
34691
+ var MinDwellSecField = number().min(0).max(60);
34692
+ /**
34693
+ * Caption burned into the notification's preview frame.
34694
+ *
34695
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34696
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34697
+ * templating dialect for one field would be a second thing to explain.
34698
+ *
34699
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34700
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34701
+ * the reason this is not `.min(1)`.
34702
+ */
34703
+ var PreviewTextField = string().max(200);
34704
+ /**
34705
+ * Whether the notification's preview is a STILL or a short animation.
34706
+ *
34707
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34708
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34709
+ * night reads better as three seconds of motion than as one frame of it. Both
34710
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34711
+ * simply applies it to a dozen frames sampled across the render and assembles
34712
+ * them.
34713
+ *
34714
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34715
+ * seeks and a palette pass, and no rule that never asked for one should start
34716
+ * paying that on the deploy that shipped it.
34717
+ *
34718
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34719
+ */
34720
+ var PreviewModeField = _enum(["image", "gif"]);
34721
+ /**
34722
+ * Which detection classes the notification reports counts for.
34723
+ *
34724
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34725
+ * plan — no second query — aggregated per class. Absent or empty means "every
34726
+ * class the window actually contained", which is what an operator who never
34727
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34728
+ * counts cars all night).
34729
+ *
34730
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34731
+ * …). An unknown name simply never matches and reports nothing — it is not an
34732
+ * error, because a rule may legitimately name a class this camera's model does
34733
+ * not emit.
34734
+ *
34735
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34736
+ * - `{{detections}}` — total over the reported classes
34737
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34738
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34739
+ * one per class, `count_` + the class name
34740
+ *
34741
+ * With NO custom body template the summary is appended to the derived body, and
34742
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34743
+ * reads. With a custom template the operator owns every word — nothing is
34744
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34745
+ */
34746
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34747
+ /**
33904
34748
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33905
34749
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33906
34750
  * here (see the ownership note above).
@@ -33920,9 +34764,30 @@ var TimelapseRuleInputSchema = object({
33920
34764
  cadenceSec: CadenceSecField.default(15),
33921
34765
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33922
34766
  framerate: FramerateField.default(10),
34767
+ /**
34768
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34769
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34770
+ * field gets.
34771
+ */
34772
+ denseCadenceSec: DenseCadenceSecField.optional(),
34773
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34774
+ minDwellSec: MinDwellSecField.optional(),
33923
34775
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33924
34776
  targets: TargetsField,
33925
34777
  template: TimelapseTemplateSchema.optional(),
34778
+ /**
34779
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34780
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34781
+ *
34782
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34783
+ * the notification's title/body, and clearing it (`template: null`) must not
34784
+ * silently clear the caption too.
34785
+ */
34786
+ previewText: PreviewTextField.optional(),
34787
+ /** Still or animation — see {@link PreviewModeField}. */
34788
+ previewMode: PreviewModeField.default("image"),
34789
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34790
+ reportClasses: ReportClassesField.optional(),
33926
34791
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33927
34792
  priority: PriorityField.default(3)
33928
34793
  });
@@ -33933,8 +34798,13 @@ object({
33933
34798
  schedule: NcScheduleSchema.optional(),
33934
34799
  cadenceSec: CadenceSecField.optional(),
33935
34800
  framerate: FramerateField.optional(),
34801
+ denseCadenceSec: DenseCadenceSecField.optional(),
34802
+ minDwellSec: MinDwellSecField.optional(),
33936
34803
  targets: TargetsField.optional(),
33937
34804
  template: TimelapseTemplateSchema.nullable().optional(),
34805
+ previewText: PreviewTextField.optional(),
34806
+ previewMode: PreviewModeField.optional(),
34807
+ reportClasses: ReportClassesField.optional(),
33938
34808
  priority: PriorityField.optional()
33939
34809
  });
33940
34810
  TimelapseRuleInputSchema.extend({
@@ -33946,10 +34816,28 @@ TimelapseRuleInputSchema.extend({
33946
34816
  */
33947
34817
  ownerUserId: string().optional(),
33948
34818
  /**
33949
- * Epoch-ms of the last successful generation the 1-hour re-generation
33950
- * guard's durable state (predecessor parity). Absent = never generated.
34819
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34820
+ * rule. What a UI shows, and the compatibility floor for
34821
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33951
34822
  */
33952
34823
  lastGeneratedAt: number().optional(),
34824
+ /**
34825
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34826
+ * re-generation guard's real durable state.
34827
+ *
34828
+ * One rule covers several cameras and each renders its own video, so a rule
34829
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34830
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34831
+ * already done — and B's night is gone for good, because the window will not
34832
+ * come back.
34833
+ *
34834
+ * ADDITIVE, so the migration is free: a row written before this field simply
34835
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34836
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34837
+ * "never generated" would re-render and re-notify every camera of every rule
34838
+ * once, on the deploy that shipped the map.
34839
+ */
34840
+ generatedByDevice: record(string(), number()).optional(),
33953
34841
  /** userId of the caller who created the rule (server-stamped). */
33954
34842
  createdBy: string(),
33955
34843
  createdAt: number(),