@camstack/addon-decoder-nodeav 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +936 -48
  2. package/dist/index.mjs +936 -48
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7201,8 +7201,31 @@ var AdoptionJobSchema = object({
7201
7201
  error: string().nullable()
7202
7202
  });
7203
7203
  /**
7204
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7205
- * pipeline functions an operator thinks in terms of.
7204
+ * Per-camera FUNCTION SWITCHES.
7205
+ *
7206
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7207
+ *
7208
+ * This file shipped as "the one coherent on/off surface over the pipeline
7209
+ * functions an operator thinks in terms of". The operator's verdict on
7210
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7211
+ * every function already had a settings page of its own, and a second place to
7212
+ * turn it off is a second place to look. Each switch is going back to its own
7213
+ * component's original options — detection to the detection-pipeline wrapper
7214
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7215
+ * (which was always first-class; the switch was a veneer over
7216
+ * `recording.setDeviceConfig`), notifications to a notification-center
7217
+ * per-device setting, the two camera planes to their own components.
7218
+ *
7219
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7220
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7221
+ * straight from the authorities with no group in the middle. That rule was
7222
+ * never about a control panel.
7223
+ *
7224
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7225
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7226
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7227
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7228
+ * stop; nothing new may be built on it.
7206
7229
  *
7207
7230
  * ## This file adds no state
7208
7231
  *
@@ -7547,14 +7570,21 @@ var RecordingConfigSchema = object({
7547
7570
  /**
7548
7571
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7549
7572
  *
7550
- * One shape shared by the recorder's `relocateFootage` (segments) and
7551
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7552
- * page renders both movers with one component. Jobs are in-RAM (a restart
7553
- * forgets them re-running is safe by construction: copy-if-absent, delete
7554
- * after verify) and each completed/failed run also lands one durable ops-log
7555
- * row on the owning addon's surface.
7573
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7574
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7575
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7576
+ * Each completed/failed run also lands one durable ops-log row on its owning
7577
+ * addon surface.
7578
+ */
7579
+ /**
7580
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7581
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7582
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7583
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7584
+ * runs at all.
7556
7585
  */
7557
7586
  var RelocateJobStateSchema = _enum([
7587
+ "queued",
7558
7588
  "running",
7559
7589
  "done",
7560
7590
  "failed",
@@ -7579,19 +7609,109 @@ var RelocateJobSchema = object({
7579
7609
  finishedAt: number().nullable(),
7580
7610
  error: string().nullable()
7581
7611
  });
7612
+ /** Profile-derived footage selection used only by the migration coordinator:
7613
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7614
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7582
7615
  var RelocateFootageInputSchema = object({
7583
- deviceId: number().optional(),
7584
7616
  fromLocationId: string(),
7585
7617
  toLocationId: string(),
7586
7618
  entities: array(_enum(["segments"])).optional(),
7619
+ /** Limits relocation to the logical profile class. Omit only for the
7620
+ * pre-orchestration compatibility path. */
7621
+ footageClass: RelocateFootageClassSchema.optional(),
7622
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7623
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7624
+ * unit is a (camera, profile) pile, not a disk. */
7625
+ deviceId: number().int().optional(),
7626
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7627
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7628
+ * placement plan assigns those two independently, so a rebalance that could
7629
+ * only say "recordings" would move footage the plan never asked to move. */
7630
+ profiles: array(string()).optional(),
7587
7631
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7588
7632
  * never allowed to starve live writers. */
7589
7633
  throttleMbps: number().min(1).max(1e3).optional()
7590
7634
  });
7591
- var RelocateMediaInputSchema = object({
7592
- deviceId: number().optional(),
7635
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7636
+ * from persistent recording settings: a migration never changes
7637
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7638
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7639
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7640
+ var StorageMigrationMediaMoveInputSchema = object({
7593
7641
  toLocationId: string(),
7594
7642
  throttleMbps: number().min(1).max(1e3).optional()
7643
+ }).extend({ leaseId: string().min(1) });
7644
+ /** The independently selectable logical storage classes. `recordings`
7645
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7646
+ * segments; `eventMedia` is post-analysis blobs. */
7647
+ var StorageMigrationClassSchema = _enum([
7648
+ "recordings",
7649
+ "recordingsLow",
7650
+ "eventMedia"
7651
+ ]);
7652
+ /** A destination is always an existing, fully-qualified location id. The
7653
+ * migration API intentionally never changes a source location's `basePath`:
7654
+ * callers create a new `<type>:<slug>` location, then select it here. */
7655
+ var StorageMigrationDestinationsSchema = object({
7656
+ recordings: string().min(1).optional(),
7657
+ recordingsLow: string().min(1).optional(),
7658
+ eventMedia: string().min(1).optional()
7659
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7660
+ /** Shared input for planning and starting an orchestrated storage migration. */
7661
+ var StorageMigrationInputSchema = object({
7662
+ destinations: StorageMigrationDestinationsSchema,
7663
+ throttleMbps: number().min(1).max(1e3).optional()
7664
+ });
7665
+ /** The durable coordinator state machine. The only phase that changes default
7666
+ * locations is `repointing`, after every selected mover has completed and been
7667
+ * verified. */
7668
+ var StorageMigrationPhaseSchema = _enum([
7669
+ "planning",
7670
+ "pausing",
7671
+ "moving",
7672
+ "verifying",
7673
+ "repointing",
7674
+ "refreshing",
7675
+ "resuming",
7676
+ "done",
7677
+ "failed",
7678
+ "cancelled"
7679
+ ]);
7680
+ var StorageMigrationParticipantSchema = _enum([
7681
+ "pipeline",
7682
+ "recorder",
7683
+ "analytics"
7684
+ ]);
7685
+ var StorageMigrationMoveSchema = object({
7686
+ storageClass: StorageMigrationClassSchema,
7687
+ fromLocationId: string(),
7688
+ toLocationId: string(),
7689
+ moverJobId: string().nullable(),
7690
+ state: RelocateJobStateSchema.nullable(),
7691
+ error: string().nullable()
7692
+ });
7693
+ var StorageMigrationJobSchema = object({
7694
+ jobId: string(),
7695
+ phase: StorageMigrationPhaseSchema,
7696
+ destinations: StorageMigrationDestinationsSchema,
7697
+ throttleMbps: number(),
7698
+ moves: array(StorageMigrationMoveSchema),
7699
+ pauseLeaseId: string().nullable(),
7700
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7701
+ repointed: boolean(),
7702
+ cancelRequested: boolean(),
7703
+ startedAt: number(),
7704
+ updatedAt: number(),
7705
+ finishedAt: number().nullable(),
7706
+ error: string().nullable()
7707
+ });
7708
+ var StorageMigrationPlanSchema = object({
7709
+ destinations: StorageMigrationDestinationsSchema,
7710
+ moves: array(object({
7711
+ storageClass: StorageMigrationClassSchema,
7712
+ fromLocationId: string(),
7713
+ toLocationId: string()
7714
+ }))
7595
7715
  });
7596
7716
  /**
7597
7717
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7643,6 +7763,21 @@ var StorageLocationSchema = object({
7643
7763
  nodeId: string().optional(),
7644
7764
  isDefault: boolean().default(false),
7645
7765
  isSystem: boolean().default(false),
7766
+ /**
7767
+ * Operator opt-in: whether consumers that BALANCE across several locations
7768
+ * of a type may write here. Recordings reads it today; event media and
7769
+ * backups are the next consumers, which is why the flag lives on the
7770
+ * location rather than in any one addon's store — nothing has to be
7771
+ * extended to add the next consumer.
7772
+ *
7773
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7774
+ * flag existed reads back with no flag and keeps working exactly as before;
7775
+ * that is the whole compat story, and it is why no migration ships with it.
7776
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7777
+ * disk must not silently start writing to it); the default of a type is
7778
+ * always stamped `true`.
7779
+ */
7780
+ enabled: boolean().optional(),
7646
7781
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7647
7782
  * for node-local locations it can reach) — never persisted, absent when the
7648
7783
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12075,7 +12210,8 @@ method(object({
12075
12210
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12076
12211
  /**
12077
12212
  * filesystem-browse — per-node capability for browsing the node's local
12078
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12213
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12214
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12079
12215
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12080
12216
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12081
12217
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13888,6 +14024,13 @@ var MaskGridDimsSchema = object({
13888
14024
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13889
14025
  * this one field keeps the schema additive — a rule still declares exactly
13890
14026
  * one trigger.
14027
+ *
14028
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14029
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14030
+ * mirror.ts` fails the build on a member the app cannot render) and every
14031
+ * member costs a release train. A sustained-sound rule is therefore an
14032
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14033
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13891
14034
  */
13892
14035
  var NcDeliverySchema = _enum([
13893
14036
  "immediate",
@@ -13902,15 +14045,32 @@ var NcDeliverySchema = _enum([
13902
14045
  * depend on a provider's raw event name or payload shape.
13903
14046
  */
13904
14047
  var NcSystemEventKindSchema = _enum([
13905
- "camera-online",
13906
- "camera-offline",
14048
+ "device-online",
14049
+ "device-offline",
14050
+ "device-disabled",
14051
+ "device-enabled",
13907
14052
  "stream-online",
13908
14053
  "stream-offline",
13909
14054
  "node-online",
13910
14055
  "node-offline",
13911
14056
  "addon-update-available",
13912
- "server-update-available"
14057
+ "server-update-available",
14058
+ "alarm-triggered",
14059
+ "alarm-armed",
14060
+ "alarm-disarmed",
14061
+ "camera-online",
14062
+ "camera-offline",
14063
+ "camera-disabled",
14064
+ "camera-enabled"
14065
+ ]);
14066
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14067
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14068
+ "camera-online",
14069
+ "camera-offline",
14070
+ "camera-disabled",
14071
+ "camera-enabled"
13913
14072
  ]);
14073
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13914
14074
  /**
13915
14075
  * One coherent system-event condition. `kinds` is the required opt-in safety
13916
14076
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13919,6 +14079,18 @@ var NcSystemEventKindSchema = _enum([
13919
14079
  var NcSystemEventConditionSchema = object({
13920
14080
  kinds: array(NcSystemEventKindSchema).min(1),
13921
14081
  deviceIds: array(number().int()).min(1).optional(),
14082
+ /**
14083
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14084
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14085
+ * is what a liveness rule means when nobody said otherwise.
14086
+ *
14087
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14088
+ * one reason: the intake cannot know which devices this household cares
14089
+ * about, and a producer-side filter is one no operator can change. Fails
14090
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14091
+ * does not carry) matches no `deviceTypes` list.
14092
+ */
14093
+ deviceTypes: array(string().min(1)).min(1).optional(),
13922
14094
  nodeIds: array(string().min(1)).min(1).optional(),
13923
14095
  packageNames: array(string().min(1)).min(1).optional()
13924
14096
  });
@@ -13969,6 +14141,47 @@ var NcOccupancyConditionSchema = object({
13969
14141
  sustainSeconds: number().int().min(0).max(3600).default(15)
13970
14142
  });
13971
14143
  /**
14144
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14145
+ *
14146
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14147
+ * reference notifier uses, so an operator moving between them re-uses what
14148
+ * they already know): a rule matches when, over a sampling window of
14149
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14150
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14151
+ *
14152
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14153
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14154
+ * - `labels` — the classifier put at least one of these labels on it.
14155
+ *
14156
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14157
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14158
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14159
+ * is given** — a window in which every sample is trivially a hit would fire on
14160
+ * silence, so the engine refuses such a condition rather than notifying on
14161
+ * nothing (the schema cannot express "at least one of" without becoming a
14162
+ * ZodEffects the cap path would have to special-case).
14163
+ *
14164
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14165
+ * must be FULL before it can match — a window that has been open for two
14166
+ * seconds of its ten is 100% of nothing, and firing on it would make
14167
+ * `samplingSeconds` decorative.
14168
+ *
14169
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14170
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14171
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14172
+ * an operator who typed `dog` mean the same thing.
14173
+ */
14174
+ var NcAudioConditionSchema = object({
14175
+ /** Audio macro labels; absent = any sound (level-only rule). */
14176
+ labels: array(string().min(1)).min(1).optional(),
14177
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14178
+ dbThreshold: number().min(-96).max(0).optional(),
14179
+ /** Percentage of the window's samples that must be hits (1–100). */
14180
+ hitPercent: number().int().min(1).max(100).default(60),
14181
+ /** Length of the sampling window in seconds. */
14182
+ samplingSeconds: number().int().min(1).max(300).default(10)
14183
+ });
14184
+ /**
13972
14185
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13973
14186
  *
13974
14187
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14241,7 +14454,33 @@ var NcConditionsSchema = object({
14241
14454
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14242
14455
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14243
14456
  */
14244
- occupancy: NcOccupancyConditionSchema.optional()
14457
+ occupancy: NcOccupancyConditionSchema.optional(),
14458
+ /**
14459
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14460
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14461
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14462
+ * a window that is not full yet, neither filter given). See
14463
+ * {@link NcAudioCondition}.
14464
+ *
14465
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14466
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14467
+ * a detection, a track or a device event (the same fail-closed pairing
14468
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14469
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14470
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14471
+ * classified sample) stays exactly as it was for rules that already use it.
14472
+ *
14473
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14474
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14475
+ * (`camstack/src/data/notification-center.ts`, guarded by
14476
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14477
+ * condition fields it does not know when a rule is saved from the phone.
14478
+ * Publishing an editor for a condition the app cannot round-trip is how an
14479
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14480
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14481
+ * does an audio rule become authorable.
14482
+ */
14483
+ audio: NcAudioConditionSchema.optional()
14245
14484
  });
14246
14485
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14247
14486
  var NcRuleTargetSchema = object({
@@ -14355,6 +14594,73 @@ var NcThrottleSchema = object({
14355
14594
  */
14356
14595
  granularity: NcThrottleGranularitySchema.optional()
14357
14596
  });
14597
+ /**
14598
+ * How long the confirm gate may hold ONE notification, and how big the picture
14599
+ * it judges may be.
14600
+ *
14601
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14602
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14603
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14604
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14605
+ * tokens for pixels the model pools away.
14606
+ */
14607
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14608
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14609
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14610
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14611
+ var NcConfirmExpectSchema = object({
14612
+ op: _enum([
14613
+ ">=",
14614
+ ">",
14615
+ "<=",
14616
+ "<",
14617
+ "=="
14618
+ ]),
14619
+ count: number().int().min(0).max(1e3)
14620
+ });
14621
+ /**
14622
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14623
+ * to ship and says whether it agrees with the rule.
14624
+ *
14625
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14626
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14627
+ * on the operator's phone is not a verdict about this notification.
14628
+ *
14629
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14630
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14631
+ * the default and every fail-open is COUNTED, because a gate that always fails
14632
+ * open looks in the log exactly like a gate that works.
14633
+ *
14634
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14635
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14636
+ * production failures in one day), so the gate reads absent as the constant
14637
+ * above rather than trusting a parse it may never have seen.
14638
+ */
14639
+ var NcConfirmSchema = object({
14640
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14641
+ * same thing, and both mean "deliver exactly as before". */
14642
+ enabled: boolean().default(false),
14643
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14644
+ profileId: string().optional(),
14645
+ /**
14646
+ * The operator's question, in his own words. Absent = a question derived
14647
+ * from the rule (its class and its expectation).
14648
+ *
14649
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14650
+ * banners, signage and plates as instructions if you let them reach the
14651
+ * prompt — proven live — so the authoritative contract stays in the system
14652
+ * turn and only rule-authored words land here.
14653
+ */
14654
+ prompt: string().max(1e3).optional(),
14655
+ /** Fire only when the model's count satisfies this. Absent = the model's
14656
+ * own boolean verdict decides. */
14657
+ expect: NcConfirmExpectSchema.optional(),
14658
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14659
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14660
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14661
+ /** Longest edge the judged image is downscaled to before it is sent. */
14662
+ maxImagePx: number().int().min(64).max(2048).default(448)
14663
+ });
14358
14664
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14359
14665
  var NcRuleInputSchema = object({
14360
14666
  name: string().min(1).max(200),
@@ -14415,7 +14721,13 @@ var NcRuleInputSchema = object({
14415
14721
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14416
14722
  * shape as every other actuation.
14417
14723
  */
14418
- actions: NcRuleActionsSchema.optional()
14724
+ actions: NcRuleActionsSchema.optional(),
14725
+ /**
14726
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14727
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14728
+ * did, and absent is the only way to say that without a migration.
14729
+ */
14730
+ confirm: NcConfirmSchema.optional()
14419
14731
  });
14420
14732
  /**
14421
14733
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14426,7 +14738,37 @@ var NcRuleInputSchema = object({
14426
14738
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14427
14739
  * `updateRule` patch.
14428
14740
  */
14429
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14741
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14742
+ disabledTargetIds: array(string()).optional(),
14743
+ /**
14744
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14745
+ *
14746
+ * It makes the key optional to SUPPLY; the parse still materialises the
14747
+ * default when the key is absent. And `NcRuleStore.update` merges with
14748
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14749
+ * one — which made every partial edit destructive:
14750
+ *
14751
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14752
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14753
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14754
+ *
14755
+ * A rule scoped to one camera and one zone silently became a rule that
14756
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14757
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14758
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14759
+ * within a minute of a two-field patch.
14760
+ *
14761
+ * So every defaulted field is re-declared here WITHOUT its default. The
14762
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14763
+ * conditions remains a real instruction ("clear them") — and only the
14764
+ * absent key is now genuinely absent.
14765
+ */
14766
+ enabled: boolean().optional(),
14767
+ conditions: NcConditionsSchema.optional(),
14768
+ media: NcMediaPolicySchema.optional(),
14769
+ throttle: NcThrottleSchema.optional(),
14770
+ priority: number().int().min(1).max(5).optional()
14771
+ });
14430
14772
  /** A persisted rule. */
14431
14773
  var NcRuleSchema = NcRuleInputSchema.extend({
14432
14774
  id: string(),
@@ -14727,6 +15069,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14727
15069
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14728
15070
  * copy would lie the first time a rule is disabled.
14729
15071
  */
15072
+ /**
15073
+ * Why a device a mode NAMES is nonetheless not armed by it.
15074
+ *
15075
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15076
+ * per-camera notification switch the Notification Center already owns,
15077
+ * `detection-off` is the device's own detection binding being inactive, and
15078
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15079
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15080
+ * with the switches the operator actually used.
15081
+ */
15082
+ var NcAlarmSkipReasonSchema = _enum([
15083
+ "muted",
15084
+ "detection-off",
15085
+ "offline"
15086
+ ]);
15087
+ var NcAlarmSkippedDeviceSchema = object({
15088
+ deviceId: number().int(),
15089
+ reason: NcAlarmSkipReasonSchema
15090
+ });
14730
15091
  var NcAlarmModeCoverageSchema = object({
14731
15092
  mode: AlarmArmModeSchema,
14732
15093
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14734,7 +15095,18 @@ var NcAlarmModeCoverageSchema = object({
14734
15095
  /** At least one covering rule has no device scope, so the mode covers all. */
14735
15096
  allDevices: boolean(),
14736
15097
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14737
- deviceIds: array(number().int())
15098
+ deviceIds: array(number().int()),
15099
+ /**
15100
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15101
+ * excludes it.
15102
+ *
15103
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15104
+ * twelve makes it false in exactly the way nobody notices until an incident.
15105
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15106
+ * still parses as "nothing known to be skipped" rather than failing the whole
15107
+ * alarm tab.
15108
+ */
15109
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14738
15110
  });
14739
15111
  var NcAlarmConfigSchema = object({
14740
15112
  /**
@@ -16097,13 +16469,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16097
16469
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16098
16470
  kind: "mutation",
16099
16471
  auth: "admin"
16100
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16472
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16101
16473
  kind: "mutation",
16102
16474
  auth: "admin"
16103
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16104
- kind: "query",
16475
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16476
+ kind: "mutation",
16105
16477
  auth: "admin"
16106
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16478
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16479
+ kind: "mutation",
16480
+ auth: "admin"
16481
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16482
+ kind: "mutation",
16483
+ auth: "admin"
16484
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16107
16485
  kind: "mutation",
16108
16486
  auth: "admin"
16109
16487
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17527,9 +17905,16 @@ var CameraStatusSchema = object({
17527
17905
  audio: CameraAudioStatusSchema.nullable(),
17528
17906
  recording: CameraRecordingStatusSchema.nullable(),
17529
17907
  /**
17530
- * Per-camera function switches an OPERATOR has turned off
17908
+ * Per-camera functions an OPERATOR has turned off
17531
17909
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17532
17910
  *
17911
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17912
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17913
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17914
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17915
+ * The badge outlives the control panel: the panel was a convenience, this is
17916
+ * the difference between a camera being off and a camera being dead.
17917
+ *
17533
17918
  * This is the difference between DISABLED and BROKEN. A camera whose
17534
17919
  * `detection` block reports zero fps and whose `switchedOff` contains
17535
17920
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17600,7 +17985,13 @@ var NodeInferenceDevicesSchema = object({
17600
17985
  reachable: boolean(),
17601
17986
  devices: array(NodeInferenceDeviceSchema).readonly()
17602
17987
  });
17603
- method(object({
17988
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17989
+ kind: "mutation",
17990
+ auth: "admin"
17991
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17992
+ kind: "mutation",
17993
+ auth: "admin"
17994
+ }), method(object({
17604
17995
  deviceId: number(),
17605
17996
  agentNodeId: string()
17606
17997
  }), object({ success: literal(true) }), {
@@ -18274,6 +18665,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18274
18665
  locationId: string(),
18275
18666
  targetBytes: number().int().positive()
18276
18667
  }), EvictResultSchema, { kind: "mutation" });
18668
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18669
+ kind: "mutation",
18670
+ auth: "admin"
18671
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18672
+ kind: "mutation",
18673
+ auth: "admin"
18674
+ });
18277
18675
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18278
18676
  providerId: string().min(1),
18279
18677
  displayName: string().min(1),
@@ -18377,6 +18775,28 @@ var TerminalProfileInfoSchema = object({
18377
18775
  label: string(),
18378
18776
  description: string().optional()
18379
18777
  });
18778
+ /**
18779
+ * A durable operator-created Terminal instance. Profiles are templates; only
18780
+ * an instance declares a camera.
18781
+ */
18782
+ var TerminalInstanceInfoSchema = object({
18783
+ instanceId: string(),
18784
+ cameraStableId: string(),
18785
+ nodeId: string(),
18786
+ profileId: string(),
18787
+ profileLabel: string(),
18788
+ name: string(),
18789
+ enabled: boolean()
18790
+ });
18791
+ var TerminalLegacyCameraSchema = object({
18792
+ stableId: string(),
18793
+ nodeId: string(),
18794
+ profileId: string(),
18795
+ profileLabel: string(),
18796
+ name: string(),
18797
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18798
+ adoptable: boolean()
18799
+ });
18380
18800
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18381
18801
  seq: number().int().positive(),
18382
18802
  kind: literal("data"),
@@ -18393,7 +18813,29 @@ var TerminalOutputBatchSchema = object({
18393
18813
  snapshot: string().optional(),
18394
18814
  events: array(TerminalOutputEventSchema).readonly()
18395
18815
  });
18396
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18816
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18817
+ targetNodeId: string().min(1),
18818
+ profileId: string().min(1),
18819
+ name: string().trim().min(1).max(160).optional()
18820
+ }), TerminalInstanceInfoSchema, {
18821
+ kind: "mutation",
18822
+ auth: "admin"
18823
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18824
+ kind: "mutation",
18825
+ auth: "admin"
18826
+ }), method(object({
18827
+ instanceId: string().min(1),
18828
+ enabled: boolean()
18829
+ }), TerminalInstanceInfoSchema, {
18830
+ kind: "mutation",
18831
+ auth: "admin"
18832
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18833
+ stableId: string().min(1),
18834
+ name: string().trim().min(1).max(160).optional()
18835
+ }), TerminalInstanceInfoSchema, {
18836
+ kind: "mutation",
18837
+ auth: "admin"
18838
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18397
18839
  profileId: string(),
18398
18840
  cols: number().int().positive(),
18399
18841
  rows: number().int().positive()
@@ -18410,7 +18852,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18410
18852
  }), method(object({
18411
18853
  sessionId: string(),
18412
18854
  afterSeq: number().int().nonnegative(),
18413
- waitMs: number().int().min(0).max(2e3).default(0)
18855
+ waitMs: number().int().min(0).max(2e3).default(0),
18856
+ /**
18857
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18858
+ * browser's initial repaint remains immediate; the camera snapshot
18859
+ * relay uses it to avoid encoding a blank startup frame.
18860
+ */
18861
+ waitForOutput: boolean().optional()
18414
18862
  }), TerminalOutputBatchSchema, {
18415
18863
  kind: "mutation",
18416
18864
  auth: "admin",
@@ -20351,6 +20799,7 @@ var FaceInfoSchema = object({
20351
20799
  var FaceFilterEnum = _enum([
20352
20800
  "unassigned",
20353
20801
  "recognized",
20802
+ "identified",
20354
20803
  "all"
20355
20804
  ]);
20356
20805
  var MediaFileLiteSchema$1 = object({
@@ -20379,6 +20828,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20379
20828
  kind: "mutation",
20380
20829
  auth: "admin"
20381
20830
  }), method(object({
20831
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20832
+ deviceId: number().int().optional(),
20382
20833
  limit: number().int().positive().optional(),
20383
20834
  filter: FaceFilterEnum.optional(),
20384
20835
  /**
@@ -22144,6 +22595,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22144
22595
  capName: string().min(1).max(64),
22145
22596
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22146
22597
  valuePath: string().min(1).max(64)
22598
+ }),
22599
+ object({
22600
+ kind: literal("latest-recognition"),
22601
+ recognition: _enum(["person", "plate"])
22147
22602
  })
22148
22603
  ]);
22149
22604
  var OsdSlotBindingSchema = object({
@@ -22249,6 +22704,15 @@ method(object({ deviceId: number().int() }), object({
22249
22704
  }), object({ success: literal(true) }), {
22250
22705
  kind: "mutation",
22251
22706
  auth: "admin"
22707
+ }), method(object({
22708
+ sourceDeviceId: number().int(),
22709
+ targetDeviceId: number().int()
22710
+ }), object({
22711
+ copied: number().int().nonnegative(),
22712
+ skipped: number().int().nonnegative()
22713
+ }), {
22714
+ kind: "mutation",
22715
+ auth: "admin"
22252
22716
  }), method(object({
22253
22717
  deviceId: number().int(),
22254
22718
  slotId: string().min(1),
@@ -22959,7 +23423,19 @@ var RecordingManifestSchema = object({
22959
23423
  * profiles/subtrees/locations on this node). */
22960
23424
  var RecordingDeviceUsageSchema = object({
22961
23425
  deviceId: number(),
22962
- usedBytes: number()
23426
+ usedBytes: number(),
23427
+ /**
23428
+ * Start of this camera's OLDEST indexed segment, across every profile and
23429
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23430
+ * only honest answer to "is retention actually holding?" per camera.
23431
+ *
23432
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23433
+ * predates this field omits it entirely, and a hub whose types carry the
23434
+ * field must keep validating that older provider's payload: the framework
23435
+ * (types) and the addon ship on different trains, and the addon is usually
23436
+ * the later of the two.
23437
+ */
23438
+ oldestMs: number().nullable().optional()
22963
23439
  });
22964
23440
  /** Recording storage usage + capacity for one storage location. */
22965
23441
  var RecordingLocationUsageSchema = object({
@@ -22987,6 +23463,57 @@ var RecordingStorageUsageSchema = object({
22987
23463
  locations: array(RecordingLocationUsageSchema)
22988
23464
  });
22989
23465
  /**
23466
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23467
+ *
23468
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23469
+ * is the operator asking for the EXISTING archive to be brought into line with
23470
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23471
+ * location, run FIFO behind the single-flight mover.
23472
+ *
23473
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23474
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23475
+ * (empty on the plan).
23476
+ */
23477
+ var RecordingRebalanceMoveSchema = object({
23478
+ deviceId: number(),
23479
+ profile: string(),
23480
+ fromLocationId: string(),
23481
+ toLocationId: string(),
23482
+ bytes: number(),
23483
+ files: number().int()
23484
+ });
23485
+ /** Why a pile that is out of place is staying there. Every refusal is
23486
+ * reported: a rebalance that silently drops a camera reads exactly like one
23487
+ * that had nothing to do. */
23488
+ var RecordingRebalanceSkipReasonSchema = _enum([
23489
+ "unassigned",
23490
+ "target-not-writable",
23491
+ "below-threshold",
23492
+ "no-headroom"
23493
+ ]);
23494
+ var RecordingRebalanceSkipSchema = object({
23495
+ deviceId: number(),
23496
+ profile: string(),
23497
+ fromLocationId: string(),
23498
+ /** The location the plan wants; null when the camera has no assignment. */
23499
+ toLocationId: string().nullable(),
23500
+ bytes: number(),
23501
+ reason: RecordingRebalanceSkipReasonSchema
23502
+ });
23503
+ var RecordingRebalancePlanSchema = object({
23504
+ moves: array(RecordingRebalanceMoveSchema),
23505
+ skipped: array(RecordingRebalanceSkipSchema),
23506
+ bytesToMove: number(),
23507
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23508
+ jobIds: array(string())
23509
+ });
23510
+ var RecordingRebalanceInputSchema = object({
23511
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23512
+ throttleMbps: number().min(1).max(1e3).optional(),
23513
+ /** Ignore piles smaller than this (default 1 GB). */
23514
+ minMoveGb: number().min(0).optional()
23515
+ });
23516
+ /**
22990
23517
  * Result of locating footage at a wall-clock instant for one device/profile.
22991
23518
  * `segment` carries the covering segment's window; `gap` reports the forward
22992
23519
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23134,6 +23661,21 @@ method(object({
23134
23661
  }), {
23135
23662
  kind: "mutation",
23136
23663
  auth: "admin"
23664
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23665
+ kind: "mutation",
23666
+ auth: "admin"
23667
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23668
+ kind: "mutation",
23669
+ auth: "admin"
23670
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23671
+ kind: "mutation",
23672
+ auth: "admin"
23673
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23674
+ kind: "mutation",
23675
+ auth: "admin"
23676
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23677
+ kind: "mutation",
23678
+ auth: "admin"
23137
23679
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23138
23680
  kind: "mutation",
23139
23681
  auth: "admin"
@@ -23143,9 +23685,15 @@ method(object({
23143
23685
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23144
23686
  kind: "mutation",
23145
23687
  auth: "admin"
23688
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23689
+ kind: "query",
23690
+ auth: "admin"
23691
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23692
+ kind: "mutation",
23693
+ auth: "admin"
23146
23694
  });
23147
23695
  /**
23148
- * `recordingExport` cap — render a footage time range into a single downloadable
23696
+ * `recording-export` cap — render a footage time range into a single downloadable
23149
23697
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23150
23698
  * bounded lifetime with a durable history, auto-expiry, and optional
23151
23699
  * delete-after-download.
@@ -23160,10 +23708,42 @@ method(object({
23160
23708
  */
23161
23709
  /** Playback-speed multiplier for the render (1 = realtime). */
23162
23710
  var ExportSpeedSchema = number().min(.25).max(32);
23711
+ /**
23712
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23713
+ *
23714
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23715
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23716
+ * playlist. Handing it absolute epochs would make every call site responsible
23717
+ * for the same subtraction, and the one that forgot would emit a filter that
23718
+ * selects nothing — silently, as a uniform timelapse.
23719
+ */
23720
+ var ExportDenseRangeSchema = object({
23721
+ fromSec: number().nonnegative(),
23722
+ toSec: number().nonnegative()
23723
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23724
+ /**
23725
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23726
+ * listed ranges and at the base `everyMs` everywhere else.
23727
+ *
23728
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23729
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23730
+ */
23731
+ var ExportDenseSchema = object({
23732
+ everyMs: number().int().positive(),
23733
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23734
+ });
23163
23735
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23164
23736
  var ExportTimelapseSchema = object({
23165
23737
  everyMs: number().int().positive(),
23166
- outputFps: number().int().min(1).max(60).optional()
23738
+ outputFps: number().int().min(1).max(60).optional(),
23739
+ /** Optional second, FASTER rate over the intervals that matter. */
23740
+ dense: ExportDenseSchema.optional()
23741
+ }).superRefine((v, ctx) => {
23742
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23743
+ code: ZodIssueCode.custom,
23744
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23745
+ path: ["dense", "everyMs"]
23746
+ });
23167
23747
  });
23168
23748
  /**
23169
23749
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23221,6 +23801,19 @@ var ExportDownloadSchema = object({
23221
23801
  url: string(),
23222
23802
  endpoints: array(string())
23223
23803
  });
23804
+ /**
23805
+ * A finished export's bytes, inline.
23806
+ *
23807
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23808
+ * against, so nobody has to infer it from the base64 length.
23809
+ */
23810
+ var ExportBytesSchema = object({
23811
+ base64: string(),
23812
+ contentType: string(),
23813
+ /** Suggested filename, extension included. */
23814
+ name: string(),
23815
+ bytes: number().int().nonnegative()
23816
+ });
23224
23817
  method(object({
23225
23818
  deviceId: number(),
23226
23819
  profile: string(),
@@ -23245,6 +23838,9 @@ method(object({
23245
23838
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23246
23839
  kind: "query",
23247
23840
  auth: "protected"
23841
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23842
+ kind: "query",
23843
+ auth: "protected"
23248
23844
  });
23249
23845
  /**
23250
23846
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27262,6 +27858,12 @@ Object.freeze({
27262
27858
  addonId: null,
27263
27859
  access: "delete"
27264
27860
  },
27861
+ "osdManager.copyDeviceConfiguration": {
27862
+ capName: "osd-manager",
27863
+ capScope: "system",
27864
+ addonId: null,
27865
+ access: "create"
27866
+ },
27265
27867
  "osdManager.getConditionSupport": {
27266
27868
  capName: "osd-manager",
27267
27869
  capScope: "system",
@@ -27358,7 +27960,7 @@ Object.freeze({
27358
27960
  addonId: null,
27359
27961
  access: "create"
27360
27962
  },
27361
- "pipelineAnalytics.cancelMediaRelocate": {
27963
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27362
27964
  capName: "pipeline-analytics",
27363
27965
  capScope: "device",
27364
27966
  addonId: null,
@@ -27430,12 +28032,6 @@ Object.freeze({
27430
28032
  addonId: null,
27431
28033
  access: "view"
27432
28034
  },
27433
- "pipelineAnalytics.getMediaRelocateStatus": {
27434
- capName: "pipeline-analytics",
27435
- capScope: "device",
27436
- addonId: null,
27437
- access: "view"
27438
- },
27439
28035
  "pipelineAnalytics.getMotionEvents": {
27440
28036
  capName: "pipeline-analytics",
27441
28037
  capScope: "device",
@@ -27472,6 +28068,12 @@ Object.freeze({
27472
28068
  addonId: null,
27473
28069
  access: "view"
27474
28070
  },
28071
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28072
+ capName: "pipeline-analytics",
28073
+ capScope: "device",
28074
+ addonId: null,
28075
+ access: "view"
28076
+ },
27475
28077
  "pipelineAnalytics.getTrack": {
27476
28078
  capName: "pipeline-analytics",
27477
28079
  capScope: "device",
@@ -27550,6 +28152,12 @@ Object.freeze({
27550
28152
  addonId: null,
27551
28153
  access: "view"
27552
28154
  },
28155
+ "pipelineAnalytics.pauseForStorageMigration": {
28156
+ capName: "pipeline-analytics",
28157
+ capScope: "device",
28158
+ addonId: null,
28159
+ access: "create"
28160
+ },
27553
28161
  "pipelineAnalytics.proposeRetrainAnnotations": {
27554
28162
  capName: "pipeline-analytics",
27555
28163
  capScope: "device",
@@ -27580,7 +28188,7 @@ Object.freeze({
27580
28188
  addonId: null,
27581
28189
  access: "create"
27582
28190
  },
27583
- "pipelineAnalytics.relocateMedia": {
28191
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27584
28192
  capName: "pipeline-analytics",
27585
28193
  capScope: "device",
27586
28194
  addonId: null,
@@ -27592,6 +28200,12 @@ Object.freeze({
27592
28200
  addonId: null,
27593
28201
  access: "create"
27594
28202
  },
28203
+ "pipelineAnalytics.resumeForStorageMigration": {
28204
+ capName: "pipeline-analytics",
28205
+ capScope: "device",
28206
+ addonId: null,
28207
+ access: "create"
28208
+ },
27595
28209
  "pipelineAnalytics.saveRetrainAnnotations": {
27596
28210
  capName: "pipeline-analytics",
27597
28211
  capScope: "device",
@@ -27616,6 +28230,12 @@ Object.freeze({
27616
28230
  addonId: null,
27617
28231
  access: "create"
27618
28232
  },
28233
+ "pipelineAnalytics.startStorageMigrationMove": {
28234
+ capName: "pipeline-analytics",
28235
+ capScope: "device",
28236
+ addonId: null,
28237
+ access: "create"
28238
+ },
27619
28239
  "pipelineAnalytics.wipeAllAnalytics": {
27620
28240
  capName: "pipeline-analytics",
27621
28241
  capScope: "device",
@@ -27982,6 +28602,12 @@ Object.freeze({
27982
28602
  addonId: null,
27983
28603
  access: "view"
27984
28604
  },
28605
+ "pipelineOrchestrator.pauseForStorageMigration": {
28606
+ capName: "pipeline-orchestrator",
28607
+ capScope: "system",
28608
+ addonId: null,
28609
+ access: "create"
28610
+ },
27985
28611
  "pipelineOrchestrator.rebalance": {
27986
28612
  capName: "pipeline-orchestrator",
27987
28613
  capScope: "system",
@@ -28006,6 +28632,12 @@ Object.freeze({
28006
28632
  addonId: null,
28007
28633
  access: "view"
28008
28634
  },
28635
+ "pipelineOrchestrator.resumeForStorageMigration": {
28636
+ capName: "pipeline-orchestrator",
28637
+ capScope: "system",
28638
+ addonId: null,
28639
+ access: "create"
28640
+ },
28009
28641
  "pipelineOrchestrator.saveTemplate": {
28010
28642
  capName: "pipeline-orchestrator",
28011
28643
  capScope: "system",
@@ -28402,7 +29034,13 @@ Object.freeze({
28402
29034
  addonId: null,
28403
29035
  access: "create"
28404
29036
  },
28405
- "recording.cancelRelocate": {
29037
+ "recording.cancelRelocateJob": {
29038
+ capName: "recording",
29039
+ capScope: "system",
29040
+ addonId: null,
29041
+ access: "create"
29042
+ },
29043
+ "recording.cancelStorageMigrationMove": {
28406
29044
  capName: "recording",
28407
29045
  capScope: "system",
28408
29046
  addonId: null,
@@ -28438,7 +29076,7 @@ Object.freeze({
28438
29076
  addonId: null,
28439
29077
  access: "view"
28440
29078
  },
28441
- "recording.getRelocateStatus": {
29079
+ "recording.getStorageMigrationMoveStatus": {
28442
29080
  capName: "recording",
28443
29081
  capScope: "system",
28444
29082
  addonId: null,
@@ -28456,12 +29094,30 @@ Object.freeze({
28456
29094
  addonId: null,
28457
29095
  access: "view"
28458
29096
  },
29097
+ "recording.listRelocateJobs": {
29098
+ capName: "recording",
29099
+ capScope: "system",
29100
+ addonId: null,
29101
+ access: "view"
29102
+ },
28459
29103
  "recording.locateSegment": {
28460
29104
  capName: "recording",
28461
29105
  capScope: "system",
28462
29106
  addonId: null,
28463
29107
  access: "view"
28464
29108
  },
29109
+ "recording.pauseForStorageMigration": {
29110
+ capName: "recording",
29111
+ capScope: "system",
29112
+ addonId: null,
29113
+ access: "create"
29114
+ },
29115
+ "recording.planStorageRebalance": {
29116
+ capName: "recording",
29117
+ capScope: "system",
29118
+ addonId: null,
29119
+ access: "view"
29120
+ },
28465
29121
  "recording.pruneFootage": {
28466
29122
  capName: "recording",
28467
29123
  capScope: "system",
@@ -28480,6 +29136,12 @@ Object.freeze({
28480
29136
  addonId: null,
28481
29137
  access: "view"
28482
29138
  },
29139
+ "recording.refreshStorageLocationsForMigration": {
29140
+ capName: "recording",
29141
+ capScope: "system",
29142
+ addonId: null,
29143
+ access: "create"
29144
+ },
28483
29145
  "recording.relocateFootage": {
28484
29146
  capName: "recording",
28485
29147
  capScope: "system",
@@ -28504,44 +29166,68 @@ Object.freeze({
28504
29166
  addonId: null,
28505
29167
  access: "create"
28506
29168
  },
29169
+ "recording.resumeForStorageMigration": {
29170
+ capName: "recording",
29171
+ capScope: "system",
29172
+ addonId: null,
29173
+ access: "create"
29174
+ },
28507
29175
  "recording.setDeviceConfig": {
28508
29176
  capName: "recording",
28509
29177
  capScope: "system",
28510
29178
  addonId: null,
28511
29179
  access: "create"
28512
29180
  },
29181
+ "recording.startStorageMigrationMove": {
29182
+ capName: "recording",
29183
+ capScope: "system",
29184
+ addonId: null,
29185
+ access: "create"
29186
+ },
29187
+ "recording.startStorageRebalance": {
29188
+ capName: "recording",
29189
+ capScope: "system",
29190
+ addonId: null,
29191
+ access: "create"
29192
+ },
28513
29193
  "recordingExport.cancelExport": {
28514
- capName: "recordingExport",
29194
+ capName: "recording-export",
28515
29195
  capScope: "system",
28516
29196
  addonId: null,
28517
29197
  access: "create"
28518
29198
  },
28519
29199
  "recordingExport.createExport": {
28520
- capName: "recordingExport",
29200
+ capName: "recording-export",
28521
29201
  capScope: "system",
28522
29202
  addonId: null,
28523
29203
  access: "create"
28524
29204
  },
28525
29205
  "recordingExport.deleteExport": {
28526
- capName: "recordingExport",
29206
+ capName: "recording-export",
28527
29207
  capScope: "system",
28528
29208
  addonId: null,
28529
29209
  access: "delete"
28530
29210
  },
28531
29211
  "recordingExport.getDownloadUrl": {
28532
- capName: "recordingExport",
29212
+ capName: "recording-export",
28533
29213
  capScope: "system",
28534
29214
  addonId: null,
28535
29215
  access: "view"
28536
29216
  },
28537
29217
  "recordingExport.getExport": {
28538
- capName: "recordingExport",
29218
+ capName: "recording-export",
28539
29219
  capScope: "system",
28540
29220
  addonId: null,
28541
29221
  access: "view"
28542
29222
  },
28543
29223
  "recordingExport.listExports": {
28544
- capName: "recordingExport",
29224
+ capName: "recording-export",
29225
+ capScope: "system",
29226
+ addonId: null,
29227
+ access: "view"
29228
+ },
29229
+ "recordingExport.readExportBytes": {
29230
+ capName: "recording-export",
28545
29231
  capScope: "system",
28546
29232
  addonId: null,
28547
29233
  access: "view"
@@ -28900,6 +29586,30 @@ Object.freeze({
28900
29586
  addonId: null,
28901
29587
  access: "view"
28902
29588
  },
29589
+ "storageMigration.cancel": {
29590
+ capName: "storage-migration",
29591
+ capScope: "system",
29592
+ addonId: null,
29593
+ access: "create"
29594
+ },
29595
+ "storageMigration.plan": {
29596
+ capName: "storage-migration",
29597
+ capScope: "system",
29598
+ addonId: null,
29599
+ access: "view"
29600
+ },
29601
+ "storageMigration.start": {
29602
+ capName: "storage-migration",
29603
+ capScope: "system",
29604
+ addonId: null,
29605
+ access: "create"
29606
+ },
29607
+ "storageMigration.status": {
29608
+ capName: "storage-migration",
29609
+ capScope: "system",
29610
+ addonId: null,
29611
+ access: "view"
29612
+ },
28903
29613
  "storageProvider.abortUpload": {
28904
29614
  capName: "storage-provider",
28905
29615
  capScope: "system",
@@ -29278,12 +29988,42 @@ Object.freeze({
29278
29988
  addonId: null,
29279
29989
  access: "create"
29280
29990
  },
29991
+ "terminalSession.adoptLegacyMonitor": {
29992
+ capName: "terminal-session",
29993
+ capScope: "system",
29994
+ addonId: null,
29995
+ access: "create"
29996
+ },
29281
29997
  "terminalSession.close": {
29282
29998
  capName: "terminal-session",
29283
29999
  capScope: "system",
29284
30000
  addonId: null,
29285
30001
  access: "create"
29286
30002
  },
30003
+ "terminalSession.createInstance": {
30004
+ capName: "terminal-session",
30005
+ capScope: "system",
30006
+ addonId: null,
30007
+ access: "create"
30008
+ },
30009
+ "terminalSession.deleteInstance": {
30010
+ capName: "terminal-session",
30011
+ capScope: "system",
30012
+ addonId: null,
30013
+ access: "delete"
30014
+ },
30015
+ "terminalSession.listInstances": {
30016
+ capName: "terminal-session",
30017
+ capScope: "system",
30018
+ addonId: null,
30019
+ access: "view"
30020
+ },
30021
+ "terminalSession.listLegacyCameras": {
30022
+ capName: "terminal-session",
30023
+ capScope: "system",
30024
+ addonId: null,
30025
+ access: "view"
30026
+ },
29287
30027
  "terminalSession.listProfiles": {
29288
30028
  capName: "terminal-session",
29289
30029
  capScope: "system",
@@ -29314,6 +30054,12 @@ Object.freeze({
29314
30054
  addonId: null,
29315
30055
  access: "create"
29316
30056
  },
30057
+ "terminalSession.setInstanceEnabled": {
30058
+ capName: "terminal-session",
30059
+ capScope: "system",
30060
+ addonId: null,
30061
+ access: "create"
30062
+ },
29317
30063
  "terminalSession.writeInput": {
29318
30064
  capName: "terminal-session",
29319
30065
  capScope: "system",
@@ -29858,6 +30604,104 @@ var FramerateField = number().int().min(1).max(60);
29858
30604
  var TargetsField = array(NcRuleTargetSchema).min(1);
29859
30605
  var PriorityField = number().int().min(1).max(5);
29860
30606
  /**
30607
+ * Explicit override of the DENSE sampling cadence, seconds.
30608
+ *
30609
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30610
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30611
+ * made that same base 3 s and rendered a person pass as two frames.)
30612
+ *
30613
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30614
+ * `denseCadenceSec` and played at `framerate` occupies
30615
+ *
30616
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30617
+ *
30618
+ * 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.
30619
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30620
+ * and therefore the length of a quiet night, does not move.
30621
+ *
30622
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30623
+ * the recording has them returns the same frames, requested twice. Must be
30624
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30625
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30626
+ * rather than letting the export cap reject the render hours after the window.
30627
+ */
30628
+ var DenseCadenceSecField = number().min(.1).max(3600);
30629
+ /**
30630
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30631
+ *
30632
+ * The operator-facing form of the arithmetic above: instead of solving for a
30633
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30634
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30635
+ * that range every ~583 ms.
30636
+ *
30637
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30638
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30639
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30640
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30641
+ * schema change and are the tracked follow-up.
30642
+ *
30643
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30644
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30645
+ * by real footage, never met by duplicating frames into motion that never
30646
+ * happened.
30647
+ */
30648
+ var MinDwellSecField = number().min(0).max(60);
30649
+ /**
30650
+ * Caption burned into the notification's preview frame.
30651
+ *
30652
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30653
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30654
+ * templating dialect for one field would be a second thing to explain.
30655
+ *
30656
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30657
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30658
+ * the reason this is not `.min(1)`.
30659
+ */
30660
+ var PreviewTextField = string().max(200);
30661
+ /**
30662
+ * Whether the notification's preview is a STILL or a short animation.
30663
+ *
30664
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30665
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30666
+ * night reads better as three seconds of motion than as one frame of it. Both
30667
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30668
+ * simply applies it to a dozen frames sampled across the render and assembles
30669
+ * them.
30670
+ *
30671
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30672
+ * seeks and a palette pass, and no rule that never asked for one should start
30673
+ * paying that on the deploy that shipped it.
30674
+ *
30675
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30676
+ */
30677
+ var PreviewModeField = _enum(["image", "gif"]);
30678
+ /**
30679
+ * Which detection classes the notification reports counts for.
30680
+ *
30681
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30682
+ * plan — no second query — aggregated per class. Absent or empty means "every
30683
+ * class the window actually contained", which is what an operator who never
30684
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30685
+ * counts cars all night).
30686
+ *
30687
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30688
+ * …). An unknown name simply never matches and reports nothing — it is not an
30689
+ * error, because a rule may legitimately name a class this camera's model does
30690
+ * not emit.
30691
+ *
30692
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30693
+ * - `{{detections}}` — total over the reported classes
30694
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30695
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30696
+ * one per class, `count_` + the class name
30697
+ *
30698
+ * With NO custom body template the summary is appended to the derived body, and
30699
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30700
+ * reads. With a custom template the operator owns every word — nothing is
30701
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30702
+ */
30703
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30704
+ /**
29861
30705
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29862
30706
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29863
30707
  * here (see the ownership note above).
@@ -29877,9 +30721,30 @@ var TimelapseRuleInputSchema = object({
29877
30721
  cadenceSec: CadenceSecField.default(15),
29878
30722
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29879
30723
  framerate: FramerateField.default(10),
30724
+ /**
30725
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30726
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30727
+ * field gets.
30728
+ */
30729
+ denseCadenceSec: DenseCadenceSecField.optional(),
30730
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30731
+ minDwellSec: MinDwellSecField.optional(),
29880
30732
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29881
30733
  targets: TargetsField,
29882
30734
  template: TimelapseTemplateSchema.optional(),
30735
+ /**
30736
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30737
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30738
+ *
30739
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30740
+ * the notification's title/body, and clearing it (`template: null`) must not
30741
+ * silently clear the caption too.
30742
+ */
30743
+ previewText: PreviewTextField.optional(),
30744
+ /** Still or animation — see {@link PreviewModeField}. */
30745
+ previewMode: PreviewModeField.default("image"),
30746
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30747
+ reportClasses: ReportClassesField.optional(),
29883
30748
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29884
30749
  priority: PriorityField.default(3)
29885
30750
  });
@@ -29890,8 +30755,13 @@ object({
29890
30755
  schedule: NcScheduleSchema.optional(),
29891
30756
  cadenceSec: CadenceSecField.optional(),
29892
30757
  framerate: FramerateField.optional(),
30758
+ denseCadenceSec: DenseCadenceSecField.optional(),
30759
+ minDwellSec: MinDwellSecField.optional(),
29893
30760
  targets: TargetsField.optional(),
29894
30761
  template: TimelapseTemplateSchema.nullable().optional(),
30762
+ previewText: PreviewTextField.optional(),
30763
+ previewMode: PreviewModeField.optional(),
30764
+ reportClasses: ReportClassesField.optional(),
29895
30765
  priority: PriorityField.optional()
29896
30766
  });
29897
30767
  TimelapseRuleInputSchema.extend({
@@ -29903,10 +30773,28 @@ TimelapseRuleInputSchema.extend({
29903
30773
  */
29904
30774
  ownerUserId: string().optional(),
29905
30775
  /**
29906
- * Epoch-ms of the last successful generation the 1-hour re-generation
29907
- * guard's durable state (predecessor parity). Absent = never generated.
30776
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30777
+ * rule. What a UI shows, and the compatibility floor for
30778
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29908
30779
  */
29909
30780
  lastGeneratedAt: number().optional(),
30781
+ /**
30782
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30783
+ * re-generation guard's real durable state.
30784
+ *
30785
+ * One rule covers several cameras and each renders its own video, so a rule
30786
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30787
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30788
+ * already done — and B's night is gone for good, because the window will not
30789
+ * come back.
30790
+ *
30791
+ * ADDITIVE, so the migration is free: a row written before this field simply
30792
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30793
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30794
+ * "never generated" would re-render and re-notify every camera of every rule
30795
+ * once, on the deploy that shipped the map.
30796
+ */
30797
+ generatedByDevice: record(string(), number()).optional(),
29910
30798
  /** userId of the caller who created the rule (server-stamped). */
29911
30799
  createdBy: string(),
29912
30800
  createdAt: number(),