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