@camstack/addon-mqtt-broker 1.2.12 → 1.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.
@@ -7229,8 +7229,31 @@ var AdoptionJobSchema = object({
7229
7229
  error: string().nullable()
7230
7230
  });
7231
7231
  /**
7232
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7233
- * pipeline functions an operator thinks in terms of.
7232
+ * Per-camera FUNCTION SWITCHES.
7233
+ *
7234
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7235
+ *
7236
+ * This file shipped as "the one coherent on/off surface over the pipeline
7237
+ * functions an operator thinks in terms of". The operator's verdict on
7238
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7239
+ * every function already had a settings page of its own, and a second place to
7240
+ * turn it off is a second place to look. Each switch is going back to its own
7241
+ * component's original options — detection to the detection-pipeline wrapper
7242
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7243
+ * (which was always first-class; the switch was a veneer over
7244
+ * `recording.setDeviceConfig`), notifications to a notification-center
7245
+ * per-device setting, the two camera planes to their own components.
7246
+ *
7247
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7248
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7249
+ * straight from the authorities with no group in the middle. That rule was
7250
+ * never about a control panel.
7251
+ *
7252
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7253
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7254
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7255
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7256
+ * stop; nothing new may be built on it.
7234
7257
  *
7235
7258
  * ## This file adds no state
7236
7259
  *
@@ -7575,14 +7598,21 @@ var RecordingConfigSchema = object({
7575
7598
  /**
7576
7599
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7577
7600
  *
7578
- * One shape shared by the recorder's `relocateFootage` (segments) and
7579
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7580
- * page renders both movers with one component. Jobs are in-RAM (a restart
7581
- * forgets them re-running is safe by construction: copy-if-absent, delete
7582
- * after verify) and each completed/failed run also lands one durable ops-log
7583
- * row on the owning addon's surface.
7601
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7602
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7603
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7604
+ * Each completed/failed run also lands one durable ops-log row on its owning
7605
+ * addon surface.
7606
+ */
7607
+ /**
7608
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7609
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7610
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7611
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7612
+ * runs at all.
7584
7613
  */
7585
7614
  var RelocateJobStateSchema = _enum([
7615
+ "queued",
7586
7616
  "running",
7587
7617
  "done",
7588
7618
  "failed",
@@ -7607,19 +7637,109 @@ var RelocateJobSchema = object({
7607
7637
  finishedAt: number().nullable(),
7608
7638
  error: string().nullable()
7609
7639
  });
7640
+ /** Profile-derived footage selection used only by the migration coordinator:
7641
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7642
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7610
7643
  var RelocateFootageInputSchema = object({
7611
- deviceId: number().optional(),
7612
7644
  fromLocationId: string(),
7613
7645
  toLocationId: string(),
7614
7646
  entities: array(_enum(["segments"])).optional(),
7647
+ /** Limits relocation to the logical profile class. Omit only for the
7648
+ * pre-orchestration compatibility path. */
7649
+ footageClass: RelocateFootageClassSchema.optional(),
7650
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7651
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7652
+ * unit is a (camera, profile) pile, not a disk. */
7653
+ deviceId: number().int().optional(),
7654
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7655
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7656
+ * placement plan assigns those two independently, so a rebalance that could
7657
+ * only say "recordings" would move footage the plan never asked to move. */
7658
+ profiles: array(string()).optional(),
7615
7659
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7616
7660
  * never allowed to starve live writers. */
7617
7661
  throttleMbps: number().min(1).max(1e3).optional()
7618
7662
  });
7619
- var RelocateMediaInputSchema = object({
7620
- deviceId: number().optional(),
7663
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7664
+ * from persistent recording settings: a migration never changes
7665
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7666
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7667
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7668
+ var StorageMigrationMediaMoveInputSchema = object({
7621
7669
  toLocationId: string(),
7622
7670
  throttleMbps: number().min(1).max(1e3).optional()
7671
+ }).extend({ leaseId: string().min(1) });
7672
+ /** The independently selectable logical storage classes. `recordings`
7673
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7674
+ * segments; `eventMedia` is post-analysis blobs. */
7675
+ var StorageMigrationClassSchema = _enum([
7676
+ "recordings",
7677
+ "recordingsLow",
7678
+ "eventMedia"
7679
+ ]);
7680
+ /** A destination is always an existing, fully-qualified location id. The
7681
+ * migration API intentionally never changes a source location's `basePath`:
7682
+ * callers create a new `<type>:<slug>` location, then select it here. */
7683
+ var StorageMigrationDestinationsSchema = object({
7684
+ recordings: string().min(1).optional(),
7685
+ recordingsLow: string().min(1).optional(),
7686
+ eventMedia: string().min(1).optional()
7687
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7688
+ /** Shared input for planning and starting an orchestrated storage migration. */
7689
+ var StorageMigrationInputSchema = object({
7690
+ destinations: StorageMigrationDestinationsSchema,
7691
+ throttleMbps: number().min(1).max(1e3).optional()
7692
+ });
7693
+ /** The durable coordinator state machine. The only phase that changes default
7694
+ * locations is `repointing`, after every selected mover has completed and been
7695
+ * verified. */
7696
+ var StorageMigrationPhaseSchema = _enum([
7697
+ "planning",
7698
+ "pausing",
7699
+ "moving",
7700
+ "verifying",
7701
+ "repointing",
7702
+ "refreshing",
7703
+ "resuming",
7704
+ "done",
7705
+ "failed",
7706
+ "cancelled"
7707
+ ]);
7708
+ var StorageMigrationParticipantSchema = _enum([
7709
+ "pipeline",
7710
+ "recorder",
7711
+ "analytics"
7712
+ ]);
7713
+ var StorageMigrationMoveSchema = object({
7714
+ storageClass: StorageMigrationClassSchema,
7715
+ fromLocationId: string(),
7716
+ toLocationId: string(),
7717
+ moverJobId: string().nullable(),
7718
+ state: RelocateJobStateSchema.nullable(),
7719
+ error: string().nullable()
7720
+ });
7721
+ var StorageMigrationJobSchema = object({
7722
+ jobId: string(),
7723
+ phase: StorageMigrationPhaseSchema,
7724
+ destinations: StorageMigrationDestinationsSchema,
7725
+ throttleMbps: number(),
7726
+ moves: array(StorageMigrationMoveSchema),
7727
+ pauseLeaseId: string().nullable(),
7728
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7729
+ repointed: boolean(),
7730
+ cancelRequested: boolean(),
7731
+ startedAt: number(),
7732
+ updatedAt: number(),
7733
+ finishedAt: number().nullable(),
7734
+ error: string().nullable()
7735
+ });
7736
+ var StorageMigrationPlanSchema = object({
7737
+ destinations: StorageMigrationDestinationsSchema,
7738
+ moves: array(object({
7739
+ storageClass: StorageMigrationClassSchema,
7740
+ fromLocationId: string(),
7741
+ toLocationId: string()
7742
+ }))
7623
7743
  });
7624
7744
  /**
7625
7745
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7671,6 +7791,21 @@ var StorageLocationSchema = object({
7671
7791
  nodeId: string().optional(),
7672
7792
  isDefault: boolean().default(false),
7673
7793
  isSystem: boolean().default(false),
7794
+ /**
7795
+ * Operator opt-in: whether consumers that BALANCE across several locations
7796
+ * of a type may write here. Recordings reads it today; event media and
7797
+ * backups are the next consumers, which is why the flag lives on the
7798
+ * location rather than in any one addon's store — nothing has to be
7799
+ * extended to add the next consumer.
7800
+ *
7801
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7802
+ * flag existed reads back with no flag and keeps working exactly as before;
7803
+ * that is the whole compat story, and it is why no migration ships with it.
7804
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7805
+ * disk must not silently start writing to it); the default of a type is
7806
+ * always stamped `true`.
7807
+ */
7808
+ enabled: boolean().optional(),
7674
7809
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7675
7810
  * for node-local locations it can reach) — never persisted, absent when the
7676
7811
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12022,7 +12157,8 @@ method(object({
12022
12157
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12023
12158
  /**
12024
12159
  * filesystem-browse — per-node capability for browsing the node's local
12025
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12160
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12161
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12026
12162
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12027
12163
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12028
12164
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13854,6 +13990,13 @@ var MaskGridDimsSchema = object({
13854
13990
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13855
13991
  * this one field keeps the schema additive — a rule still declares exactly
13856
13992
  * one trigger.
13993
+ *
13994
+ * AUDIO rules add no member here, for the reason occupancy added none: the
13995
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
13996
+ * mirror.ts` fails the build on a member the app cannot render) and every
13997
+ * member costs a release train. A sustained-sound rule is therefore an
13998
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
13999
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13857
14000
  */
13858
14001
  var NcDeliverySchema = _enum([
13859
14002
  "immediate",
@@ -13868,15 +14011,32 @@ var NcDeliverySchema = _enum([
13868
14011
  * depend on a provider's raw event name or payload shape.
13869
14012
  */
13870
14013
  var NcSystemEventKindSchema = _enum([
13871
- "camera-online",
13872
- "camera-offline",
14014
+ "device-online",
14015
+ "device-offline",
14016
+ "device-disabled",
14017
+ "device-enabled",
13873
14018
  "stream-online",
13874
14019
  "stream-offline",
13875
14020
  "node-online",
13876
14021
  "node-offline",
13877
14022
  "addon-update-available",
13878
- "server-update-available"
14023
+ "server-update-available",
14024
+ "alarm-triggered",
14025
+ "alarm-armed",
14026
+ "alarm-disarmed",
14027
+ "camera-online",
14028
+ "camera-offline",
14029
+ "camera-disabled",
14030
+ "camera-enabled"
14031
+ ]);
14032
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14033
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14034
+ "camera-online",
14035
+ "camera-offline",
14036
+ "camera-disabled",
14037
+ "camera-enabled"
13879
14038
  ]);
14039
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13880
14040
  /**
13881
14041
  * One coherent system-event condition. `kinds` is the required opt-in safety
13882
14042
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13885,6 +14045,18 @@ var NcSystemEventKindSchema = _enum([
13885
14045
  var NcSystemEventConditionSchema = object({
13886
14046
  kinds: array(NcSystemEventKindSchema).min(1),
13887
14047
  deviceIds: array(number().int()).min(1).optional(),
14048
+ /**
14049
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14050
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14051
+ * is what a liveness rule means when nobody said otherwise.
14052
+ *
14053
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14054
+ * one reason: the intake cannot know which devices this household cares
14055
+ * about, and a producer-side filter is one no operator can change. Fails
14056
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14057
+ * does not carry) matches no `deviceTypes` list.
14058
+ */
14059
+ deviceTypes: array(string().min(1)).min(1).optional(),
13888
14060
  nodeIds: array(string().min(1)).min(1).optional(),
13889
14061
  packageNames: array(string().min(1)).min(1).optional()
13890
14062
  });
@@ -13935,6 +14107,47 @@ var NcOccupancyConditionSchema = object({
13935
14107
  sustainSeconds: number().int().min(0).max(3600).default(15)
13936
14108
  });
13937
14109
  /**
14110
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14111
+ *
14112
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14113
+ * reference notifier uses, so an operator moving between them re-uses what
14114
+ * they already know): a rule matches when, over a sampling window of
14115
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14116
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14117
+ *
14118
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14119
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14120
+ * - `labels` — the classifier put at least one of these labels on it.
14121
+ *
14122
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14123
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14124
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14125
+ * is given** — a window in which every sample is trivially a hit would fire on
14126
+ * silence, so the engine refuses such a condition rather than notifying on
14127
+ * nothing (the schema cannot express "at least one of" without becoming a
14128
+ * ZodEffects the cap path would have to special-case).
14129
+ *
14130
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14131
+ * must be FULL before it can match — a window that has been open for two
14132
+ * seconds of its ten is 100% of nothing, and firing on it would make
14133
+ * `samplingSeconds` decorative.
14134
+ *
14135
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14136
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14137
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14138
+ * an operator who typed `dog` mean the same thing.
14139
+ */
14140
+ var NcAudioConditionSchema = object({
14141
+ /** Audio macro labels; absent = any sound (level-only rule). */
14142
+ labels: array(string().min(1)).min(1).optional(),
14143
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14144
+ dbThreshold: number().min(-96).max(0).optional(),
14145
+ /** Percentage of the window's samples that must be hits (1–100). */
14146
+ hitPercent: number().int().min(1).max(100).default(60),
14147
+ /** Length of the sampling window in seconds. */
14148
+ samplingSeconds: number().int().min(1).max(300).default(10)
14149
+ });
14150
+ /**
13938
14151
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13939
14152
  *
13940
14153
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14207,7 +14420,33 @@ var NcConditionsSchema = object({
14207
14420
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14208
14421
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14209
14422
  */
14210
- occupancy: NcOccupancyConditionSchema.optional()
14423
+ occupancy: NcOccupancyConditionSchema.optional(),
14424
+ /**
14425
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14426
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14427
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14428
+ * a window that is not full yet, neither filter given). See
14429
+ * {@link NcAudioCondition}.
14430
+ *
14431
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14432
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14433
+ * a detection, a track or a device event (the same fail-closed pairing
14434
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14435
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14436
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14437
+ * classified sample) stays exactly as it was for rules that already use it.
14438
+ *
14439
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14440
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14441
+ * (`camstack/src/data/notification-center.ts`, guarded by
14442
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14443
+ * condition fields it does not know when a rule is saved from the phone.
14444
+ * Publishing an editor for a condition the app cannot round-trip is how an
14445
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14446
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14447
+ * does an audio rule become authorable.
14448
+ */
14449
+ audio: NcAudioConditionSchema.optional()
14211
14450
  });
14212
14451
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14213
14452
  var NcRuleTargetSchema = object({
@@ -14321,6 +14560,73 @@ var NcThrottleSchema = object({
14321
14560
  */
14322
14561
  granularity: NcThrottleGranularitySchema.optional()
14323
14562
  });
14563
+ /**
14564
+ * How long the confirm gate may hold ONE notification, and how big the picture
14565
+ * it judges may be.
14566
+ *
14567
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14568
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14569
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14570
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14571
+ * tokens for pixels the model pools away.
14572
+ */
14573
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14574
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14575
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14576
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14577
+ var NcConfirmExpectSchema = object({
14578
+ op: _enum([
14579
+ ">=",
14580
+ ">",
14581
+ "<=",
14582
+ "<",
14583
+ "=="
14584
+ ]),
14585
+ count: number().int().min(0).max(1e3)
14586
+ });
14587
+ /**
14588
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14589
+ * to ship and says whether it agrees with the rule.
14590
+ *
14591
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14592
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14593
+ * on the operator's phone is not a verdict about this notification.
14594
+ *
14595
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14596
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14597
+ * the default and every fail-open is COUNTED, because a gate that always fails
14598
+ * open looks in the log exactly like a gate that works.
14599
+ *
14600
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14601
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14602
+ * production failures in one day), so the gate reads absent as the constant
14603
+ * above rather than trusting a parse it may never have seen.
14604
+ */
14605
+ var NcConfirmSchema = object({
14606
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14607
+ * same thing, and both mean "deliver exactly as before". */
14608
+ enabled: boolean().default(false),
14609
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14610
+ profileId: string().optional(),
14611
+ /**
14612
+ * The operator's question, in his own words. Absent = a question derived
14613
+ * from the rule (its class and its expectation).
14614
+ *
14615
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14616
+ * banners, signage and plates as instructions if you let them reach the
14617
+ * prompt — proven live — so the authoritative contract stays in the system
14618
+ * turn and only rule-authored words land here.
14619
+ */
14620
+ prompt: string().max(1e3).optional(),
14621
+ /** Fire only when the model's count satisfies this. Absent = the model's
14622
+ * own boolean verdict decides. */
14623
+ expect: NcConfirmExpectSchema.optional(),
14624
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14625
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14626
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14627
+ /** Longest edge the judged image is downscaled to before it is sent. */
14628
+ maxImagePx: number().int().min(64).max(2048).default(448)
14629
+ });
14324
14630
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14325
14631
  var NcRuleInputSchema = object({
14326
14632
  name: string().min(1).max(200),
@@ -14381,7 +14687,13 @@ var NcRuleInputSchema = object({
14381
14687
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14382
14688
  * shape as every other actuation.
14383
14689
  */
14384
- actions: NcRuleActionsSchema.optional()
14690
+ actions: NcRuleActionsSchema.optional(),
14691
+ /**
14692
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14693
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14694
+ * did, and absent is the only way to say that without a migration.
14695
+ */
14696
+ confirm: NcConfirmSchema.optional()
14385
14697
  });
14386
14698
  /**
14387
14699
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14392,7 +14704,37 @@ var NcRuleInputSchema = object({
14392
14704
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14393
14705
  * `updateRule` patch.
14394
14706
  */
14395
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14707
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14708
+ disabledTargetIds: array(string()).optional(),
14709
+ /**
14710
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14711
+ *
14712
+ * It makes the key optional to SUPPLY; the parse still materialises the
14713
+ * default when the key is absent. And `NcRuleStore.update` merges with
14714
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14715
+ * one — which made every partial edit destructive:
14716
+ *
14717
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14718
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14719
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14720
+ *
14721
+ * A rule scoped to one camera and one zone silently became a rule that
14722
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14723
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14724
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14725
+ * within a minute of a two-field patch.
14726
+ *
14727
+ * So every defaulted field is re-declared here WITHOUT its default. The
14728
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14729
+ * conditions remains a real instruction ("clear them") — and only the
14730
+ * absent key is now genuinely absent.
14731
+ */
14732
+ enabled: boolean().optional(),
14733
+ conditions: NcConditionsSchema.optional(),
14734
+ media: NcMediaPolicySchema.optional(),
14735
+ throttle: NcThrottleSchema.optional(),
14736
+ priority: number().int().min(1).max(5).optional()
14737
+ });
14396
14738
  /** A persisted rule. */
14397
14739
  var NcRuleSchema = NcRuleInputSchema.extend({
14398
14740
  id: string(),
@@ -14693,6 +15035,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14693
15035
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14694
15036
  * copy would lie the first time a rule is disabled.
14695
15037
  */
15038
+ /**
15039
+ * Why a device a mode NAMES is nonetheless not armed by it.
15040
+ *
15041
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15042
+ * per-camera notification switch the Notification Center already owns,
15043
+ * `detection-off` is the device's own detection binding being inactive, and
15044
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15045
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15046
+ * with the switches the operator actually used.
15047
+ */
15048
+ var NcAlarmSkipReasonSchema = _enum([
15049
+ "muted",
15050
+ "detection-off",
15051
+ "offline"
15052
+ ]);
15053
+ var NcAlarmSkippedDeviceSchema = object({
15054
+ deviceId: number().int(),
15055
+ reason: NcAlarmSkipReasonSchema
15056
+ });
14696
15057
  var NcAlarmModeCoverageSchema = object({
14697
15058
  mode: AlarmArmModeSchema,
14698
15059
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14700,7 +15061,18 @@ var NcAlarmModeCoverageSchema = object({
14700
15061
  /** At least one covering rule has no device scope, so the mode covers all. */
14701
15062
  allDevices: boolean(),
14702
15063
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14703
- deviceIds: array(number().int())
15064
+ deviceIds: array(number().int()),
15065
+ /**
15066
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15067
+ * excludes it.
15068
+ *
15069
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15070
+ * twelve makes it false in exactly the way nobody notices until an incident.
15071
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15072
+ * still parses as "nothing known to be skipped" rather than failing the whole
15073
+ * alarm tab.
15074
+ */
15075
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14704
15076
  });
14705
15077
  var NcAlarmConfigSchema = object({
14706
15078
  /**
@@ -16063,13 +16435,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16063
16435
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16064
16436
  kind: "mutation",
16065
16437
  auth: "admin"
16066
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16438
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16067
16439
  kind: "mutation",
16068
16440
  auth: "admin"
16069
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16070
- kind: "query",
16441
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16442
+ kind: "mutation",
16071
16443
  auth: "admin"
16072
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16444
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16445
+ kind: "mutation",
16446
+ auth: "admin"
16447
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16448
+ kind: "mutation",
16449
+ auth: "admin"
16450
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16073
16451
  kind: "mutation",
16074
16452
  auth: "admin"
16075
16453
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17493,9 +17871,16 @@ var CameraStatusSchema = object({
17493
17871
  audio: CameraAudioStatusSchema.nullable(),
17494
17872
  recording: CameraRecordingStatusSchema.nullable(),
17495
17873
  /**
17496
- * Per-camera function switches an OPERATOR has turned off
17874
+ * Per-camera functions an OPERATOR has turned off
17497
17875
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17498
17876
  *
17877
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17878
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17879
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17880
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17881
+ * The badge outlives the control panel: the panel was a convenience, this is
17882
+ * the difference between a camera being off and a camera being dead.
17883
+ *
17499
17884
  * This is the difference between DISABLED and BROKEN. A camera whose
17500
17885
  * `detection` block reports zero fps and whose `switchedOff` contains
17501
17886
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17566,7 +17951,13 @@ var NodeInferenceDevicesSchema = object({
17566
17951
  reachable: boolean(),
17567
17952
  devices: array(NodeInferenceDeviceSchema).readonly()
17568
17953
  });
17569
- method(object({
17954
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17955
+ kind: "mutation",
17956
+ auth: "admin"
17957
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17958
+ kind: "mutation",
17959
+ auth: "admin"
17960
+ }), method(object({
17570
17961
  deviceId: number(),
17571
17962
  agentNodeId: string()
17572
17963
  }), object({ success: literal(true) }), {
@@ -18240,6 +18631,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18240
18631
  locationId: string(),
18241
18632
  targetBytes: number().int().positive()
18242
18633
  }), EvictResultSchema, { kind: "mutation" });
18634
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18635
+ kind: "mutation",
18636
+ auth: "admin"
18637
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18638
+ kind: "mutation",
18639
+ auth: "admin"
18640
+ });
18243
18641
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18244
18642
  providerId: string().min(1),
18245
18643
  displayName: string().min(1),
@@ -18343,6 +18741,28 @@ var TerminalProfileInfoSchema = object({
18343
18741
  label: string(),
18344
18742
  description: string().optional()
18345
18743
  });
18744
+ /**
18745
+ * A durable operator-created Terminal instance. Profiles are templates; only
18746
+ * an instance declares a camera.
18747
+ */
18748
+ var TerminalInstanceInfoSchema = object({
18749
+ instanceId: string(),
18750
+ cameraStableId: string(),
18751
+ nodeId: string(),
18752
+ profileId: string(),
18753
+ profileLabel: string(),
18754
+ name: string(),
18755
+ enabled: boolean()
18756
+ });
18757
+ var TerminalLegacyCameraSchema = object({
18758
+ stableId: string(),
18759
+ nodeId: string(),
18760
+ profileId: string(),
18761
+ profileLabel: string(),
18762
+ name: string(),
18763
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18764
+ adoptable: boolean()
18765
+ });
18346
18766
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18347
18767
  seq: number().int().positive(),
18348
18768
  kind: literal("data"),
@@ -18359,7 +18779,29 @@ var TerminalOutputBatchSchema = object({
18359
18779
  snapshot: string().optional(),
18360
18780
  events: array(TerminalOutputEventSchema).readonly()
18361
18781
  });
18362
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18782
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18783
+ targetNodeId: string().min(1),
18784
+ profileId: string().min(1),
18785
+ name: string().trim().min(1).max(160).optional()
18786
+ }), TerminalInstanceInfoSchema, {
18787
+ kind: "mutation",
18788
+ auth: "admin"
18789
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18790
+ kind: "mutation",
18791
+ auth: "admin"
18792
+ }), method(object({
18793
+ instanceId: string().min(1),
18794
+ enabled: boolean()
18795
+ }), TerminalInstanceInfoSchema, {
18796
+ kind: "mutation",
18797
+ auth: "admin"
18798
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18799
+ stableId: string().min(1),
18800
+ name: string().trim().min(1).max(160).optional()
18801
+ }), TerminalInstanceInfoSchema, {
18802
+ kind: "mutation",
18803
+ auth: "admin"
18804
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18363
18805
  profileId: string(),
18364
18806
  cols: number().int().positive(),
18365
18807
  rows: number().int().positive()
@@ -18376,7 +18818,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18376
18818
  }), method(object({
18377
18819
  sessionId: string(),
18378
18820
  afterSeq: number().int().nonnegative(),
18379
- waitMs: number().int().min(0).max(2e3).default(0)
18821
+ waitMs: number().int().min(0).max(2e3).default(0),
18822
+ /**
18823
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18824
+ * browser's initial repaint remains immediate; the camera snapshot
18825
+ * relay uses it to avoid encoding a blank startup frame.
18826
+ */
18827
+ waitForOutput: boolean().optional()
18380
18828
  }), TerminalOutputBatchSchema, {
18381
18829
  kind: "mutation",
18382
18830
  auth: "admin",
@@ -20317,6 +20765,7 @@ var FaceInfoSchema = object({
20317
20765
  var FaceFilterEnum = _enum([
20318
20766
  "unassigned",
20319
20767
  "recognized",
20768
+ "identified",
20320
20769
  "all"
20321
20770
  ]);
20322
20771
  var MediaFileLiteSchema$1 = object({
@@ -20345,6 +20794,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20345
20794
  kind: "mutation",
20346
20795
  auth: "admin"
20347
20796
  }), method(object({
20797
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20798
+ deviceId: number().int().optional(),
20348
20799
  limit: number().int().positive().optional(),
20349
20800
  filter: FaceFilterEnum.optional(),
20350
20801
  /**
@@ -22110,6 +22561,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22110
22561
  capName: string().min(1).max(64),
22111
22562
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22112
22563
  valuePath: string().min(1).max(64)
22564
+ }),
22565
+ object({
22566
+ kind: literal("latest-recognition"),
22567
+ recognition: _enum(["person", "plate"])
22113
22568
  })
22114
22569
  ]);
22115
22570
  var OsdSlotBindingSchema = object({
@@ -22215,6 +22670,15 @@ method(object({ deviceId: number().int() }), object({
22215
22670
  }), object({ success: literal(true) }), {
22216
22671
  kind: "mutation",
22217
22672
  auth: "admin"
22673
+ }), method(object({
22674
+ sourceDeviceId: number().int(),
22675
+ targetDeviceId: number().int()
22676
+ }), object({
22677
+ copied: number().int().nonnegative(),
22678
+ skipped: number().int().nonnegative()
22679
+ }), {
22680
+ kind: "mutation",
22681
+ auth: "admin"
22218
22682
  }), method(object({
22219
22683
  deviceId: number().int(),
22220
22684
  slotId: string().min(1),
@@ -22925,7 +23389,19 @@ var RecordingManifestSchema = object({
22925
23389
  * profiles/subtrees/locations on this node). */
22926
23390
  var RecordingDeviceUsageSchema = object({
22927
23391
  deviceId: number(),
22928
- usedBytes: number()
23392
+ usedBytes: number(),
23393
+ /**
23394
+ * Start of this camera's OLDEST indexed segment, across every profile and
23395
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23396
+ * only honest answer to "is retention actually holding?" per camera.
23397
+ *
23398
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23399
+ * predates this field omits it entirely, and a hub whose types carry the
23400
+ * field must keep validating that older provider's payload: the framework
23401
+ * (types) and the addon ship on different trains, and the addon is usually
23402
+ * the later of the two.
23403
+ */
23404
+ oldestMs: number().nullable().optional()
22929
23405
  });
22930
23406
  /** Recording storage usage + capacity for one storage location. */
22931
23407
  var RecordingLocationUsageSchema = object({
@@ -22953,6 +23429,57 @@ var RecordingStorageUsageSchema = object({
22953
23429
  locations: array(RecordingLocationUsageSchema)
22954
23430
  });
22955
23431
  /**
23432
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23433
+ *
23434
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23435
+ * is the operator asking for the EXISTING archive to be brought into line with
23436
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23437
+ * location, run FIFO behind the single-flight mover.
23438
+ *
23439
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23440
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23441
+ * (empty on the plan).
23442
+ */
23443
+ var RecordingRebalanceMoveSchema = object({
23444
+ deviceId: number(),
23445
+ profile: string(),
23446
+ fromLocationId: string(),
23447
+ toLocationId: string(),
23448
+ bytes: number(),
23449
+ files: number().int()
23450
+ });
23451
+ /** Why a pile that is out of place is staying there. Every refusal is
23452
+ * reported: a rebalance that silently drops a camera reads exactly like one
23453
+ * that had nothing to do. */
23454
+ var RecordingRebalanceSkipReasonSchema = _enum([
23455
+ "unassigned",
23456
+ "target-not-writable",
23457
+ "below-threshold",
23458
+ "no-headroom"
23459
+ ]);
23460
+ var RecordingRebalanceSkipSchema = object({
23461
+ deviceId: number(),
23462
+ profile: string(),
23463
+ fromLocationId: string(),
23464
+ /** The location the plan wants; null when the camera has no assignment. */
23465
+ toLocationId: string().nullable(),
23466
+ bytes: number(),
23467
+ reason: RecordingRebalanceSkipReasonSchema
23468
+ });
23469
+ var RecordingRebalancePlanSchema = object({
23470
+ moves: array(RecordingRebalanceMoveSchema),
23471
+ skipped: array(RecordingRebalanceSkipSchema),
23472
+ bytesToMove: number(),
23473
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23474
+ jobIds: array(string())
23475
+ });
23476
+ var RecordingRebalanceInputSchema = object({
23477
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23478
+ throttleMbps: number().min(1).max(1e3).optional(),
23479
+ /** Ignore piles smaller than this (default 1 GB). */
23480
+ minMoveGb: number().min(0).optional()
23481
+ });
23482
+ /**
22956
23483
  * Result of locating footage at a wall-clock instant for one device/profile.
22957
23484
  * `segment` carries the covering segment's window; `gap` reports the forward
22958
23485
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23100,6 +23627,21 @@ method(object({
23100
23627
  }), {
23101
23628
  kind: "mutation",
23102
23629
  auth: "admin"
23630
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23631
+ kind: "mutation",
23632
+ auth: "admin"
23633
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23634
+ kind: "mutation",
23635
+ auth: "admin"
23636
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23637
+ kind: "mutation",
23638
+ auth: "admin"
23639
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23640
+ kind: "mutation",
23641
+ auth: "admin"
23642
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23643
+ kind: "mutation",
23644
+ auth: "admin"
23103
23645
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23104
23646
  kind: "mutation",
23105
23647
  auth: "admin"
@@ -23109,9 +23651,15 @@ method(object({
23109
23651
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23110
23652
  kind: "mutation",
23111
23653
  auth: "admin"
23654
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23655
+ kind: "query",
23656
+ auth: "admin"
23657
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23658
+ kind: "mutation",
23659
+ auth: "admin"
23112
23660
  });
23113
23661
  /**
23114
- * `recordingExport` cap — render a footage time range into a single downloadable
23662
+ * `recording-export` cap — render a footage time range into a single downloadable
23115
23663
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23116
23664
  * bounded lifetime with a durable history, auto-expiry, and optional
23117
23665
  * delete-after-download.
@@ -23126,10 +23674,42 @@ method(object({
23126
23674
  */
23127
23675
  /** Playback-speed multiplier for the render (1 = realtime). */
23128
23676
  var ExportSpeedSchema = number().min(.25).max(32);
23677
+ /**
23678
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23679
+ *
23680
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23681
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23682
+ * playlist. Handing it absolute epochs would make every call site responsible
23683
+ * for the same subtraction, and the one that forgot would emit a filter that
23684
+ * selects nothing — silently, as a uniform timelapse.
23685
+ */
23686
+ var ExportDenseRangeSchema = object({
23687
+ fromSec: number().nonnegative(),
23688
+ toSec: number().nonnegative()
23689
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23690
+ /**
23691
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23692
+ * listed ranges and at the base `everyMs` everywhere else.
23693
+ *
23694
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23695
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23696
+ */
23697
+ var ExportDenseSchema = object({
23698
+ everyMs: number().int().positive(),
23699
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23700
+ });
23129
23701
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23130
23702
  var ExportTimelapseSchema = object({
23131
23703
  everyMs: number().int().positive(),
23132
- outputFps: number().int().min(1).max(60).optional()
23704
+ outputFps: number().int().min(1).max(60).optional(),
23705
+ /** Optional second, FASTER rate over the intervals that matter. */
23706
+ dense: ExportDenseSchema.optional()
23707
+ }).superRefine((v, ctx) => {
23708
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23709
+ code: ZodIssueCode.custom,
23710
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23711
+ path: ["dense", "everyMs"]
23712
+ });
23133
23713
  });
23134
23714
  /**
23135
23715
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23187,6 +23767,19 @@ var ExportDownloadSchema = object({
23187
23767
  url: string(),
23188
23768
  endpoints: array(string())
23189
23769
  });
23770
+ /**
23771
+ * A finished export's bytes, inline.
23772
+ *
23773
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23774
+ * against, so nobody has to infer it from the base64 length.
23775
+ */
23776
+ var ExportBytesSchema = object({
23777
+ base64: string(),
23778
+ contentType: string(),
23779
+ /** Suggested filename, extension included. */
23780
+ name: string(),
23781
+ bytes: number().int().nonnegative()
23782
+ });
23190
23783
  method(object({
23191
23784
  deviceId: number(),
23192
23785
  profile: string(),
@@ -23211,6 +23804,9 @@ method(object({
23211
23804
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23212
23805
  kind: "query",
23213
23806
  auth: "protected"
23807
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23808
+ kind: "query",
23809
+ auth: "protected"
23214
23810
  });
23215
23811
  /**
23216
23812
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27228,6 +27824,12 @@ Object.freeze({
27228
27824
  addonId: null,
27229
27825
  access: "delete"
27230
27826
  },
27827
+ "osdManager.copyDeviceConfiguration": {
27828
+ capName: "osd-manager",
27829
+ capScope: "system",
27830
+ addonId: null,
27831
+ access: "create"
27832
+ },
27231
27833
  "osdManager.getConditionSupport": {
27232
27834
  capName: "osd-manager",
27233
27835
  capScope: "system",
@@ -27324,7 +27926,7 @@ Object.freeze({
27324
27926
  addonId: null,
27325
27927
  access: "create"
27326
27928
  },
27327
- "pipelineAnalytics.cancelMediaRelocate": {
27929
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27328
27930
  capName: "pipeline-analytics",
27329
27931
  capScope: "device",
27330
27932
  addonId: null,
@@ -27396,12 +27998,6 @@ Object.freeze({
27396
27998
  addonId: null,
27397
27999
  access: "view"
27398
28000
  },
27399
- "pipelineAnalytics.getMediaRelocateStatus": {
27400
- capName: "pipeline-analytics",
27401
- capScope: "device",
27402
- addonId: null,
27403
- access: "view"
27404
- },
27405
28001
  "pipelineAnalytics.getMotionEvents": {
27406
28002
  capName: "pipeline-analytics",
27407
28003
  capScope: "device",
@@ -27438,6 +28034,12 @@ Object.freeze({
27438
28034
  addonId: null,
27439
28035
  access: "view"
27440
28036
  },
28037
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28038
+ capName: "pipeline-analytics",
28039
+ capScope: "device",
28040
+ addonId: null,
28041
+ access: "view"
28042
+ },
27441
28043
  "pipelineAnalytics.getTrack": {
27442
28044
  capName: "pipeline-analytics",
27443
28045
  capScope: "device",
@@ -27516,6 +28118,12 @@ Object.freeze({
27516
28118
  addonId: null,
27517
28119
  access: "view"
27518
28120
  },
28121
+ "pipelineAnalytics.pauseForStorageMigration": {
28122
+ capName: "pipeline-analytics",
28123
+ capScope: "device",
28124
+ addonId: null,
28125
+ access: "create"
28126
+ },
27519
28127
  "pipelineAnalytics.proposeRetrainAnnotations": {
27520
28128
  capName: "pipeline-analytics",
27521
28129
  capScope: "device",
@@ -27546,7 +28154,7 @@ Object.freeze({
27546
28154
  addonId: null,
27547
28155
  access: "create"
27548
28156
  },
27549
- "pipelineAnalytics.relocateMedia": {
28157
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27550
28158
  capName: "pipeline-analytics",
27551
28159
  capScope: "device",
27552
28160
  addonId: null,
@@ -27558,6 +28166,12 @@ Object.freeze({
27558
28166
  addonId: null,
27559
28167
  access: "create"
27560
28168
  },
28169
+ "pipelineAnalytics.resumeForStorageMigration": {
28170
+ capName: "pipeline-analytics",
28171
+ capScope: "device",
28172
+ addonId: null,
28173
+ access: "create"
28174
+ },
27561
28175
  "pipelineAnalytics.saveRetrainAnnotations": {
27562
28176
  capName: "pipeline-analytics",
27563
28177
  capScope: "device",
@@ -27582,6 +28196,12 @@ Object.freeze({
27582
28196
  addonId: null,
27583
28197
  access: "create"
27584
28198
  },
28199
+ "pipelineAnalytics.startStorageMigrationMove": {
28200
+ capName: "pipeline-analytics",
28201
+ capScope: "device",
28202
+ addonId: null,
28203
+ access: "create"
28204
+ },
27585
28205
  "pipelineAnalytics.wipeAllAnalytics": {
27586
28206
  capName: "pipeline-analytics",
27587
28207
  capScope: "device",
@@ -27948,6 +28568,12 @@ Object.freeze({
27948
28568
  addonId: null,
27949
28569
  access: "view"
27950
28570
  },
28571
+ "pipelineOrchestrator.pauseForStorageMigration": {
28572
+ capName: "pipeline-orchestrator",
28573
+ capScope: "system",
28574
+ addonId: null,
28575
+ access: "create"
28576
+ },
27951
28577
  "pipelineOrchestrator.rebalance": {
27952
28578
  capName: "pipeline-orchestrator",
27953
28579
  capScope: "system",
@@ -27972,6 +28598,12 @@ Object.freeze({
27972
28598
  addonId: null,
27973
28599
  access: "view"
27974
28600
  },
28601
+ "pipelineOrchestrator.resumeForStorageMigration": {
28602
+ capName: "pipeline-orchestrator",
28603
+ capScope: "system",
28604
+ addonId: null,
28605
+ access: "create"
28606
+ },
27975
28607
  "pipelineOrchestrator.saveTemplate": {
27976
28608
  capName: "pipeline-orchestrator",
27977
28609
  capScope: "system",
@@ -28368,7 +29000,13 @@ Object.freeze({
28368
29000
  addonId: null,
28369
29001
  access: "create"
28370
29002
  },
28371
- "recording.cancelRelocate": {
29003
+ "recording.cancelRelocateJob": {
29004
+ capName: "recording",
29005
+ capScope: "system",
29006
+ addonId: null,
29007
+ access: "create"
29008
+ },
29009
+ "recording.cancelStorageMigrationMove": {
28372
29010
  capName: "recording",
28373
29011
  capScope: "system",
28374
29012
  addonId: null,
@@ -28404,7 +29042,7 @@ Object.freeze({
28404
29042
  addonId: null,
28405
29043
  access: "view"
28406
29044
  },
28407
- "recording.getRelocateStatus": {
29045
+ "recording.getStorageMigrationMoveStatus": {
28408
29046
  capName: "recording",
28409
29047
  capScope: "system",
28410
29048
  addonId: null,
@@ -28422,12 +29060,30 @@ Object.freeze({
28422
29060
  addonId: null,
28423
29061
  access: "view"
28424
29062
  },
29063
+ "recording.listRelocateJobs": {
29064
+ capName: "recording",
29065
+ capScope: "system",
29066
+ addonId: null,
29067
+ access: "view"
29068
+ },
28425
29069
  "recording.locateSegment": {
28426
29070
  capName: "recording",
28427
29071
  capScope: "system",
28428
29072
  addonId: null,
28429
29073
  access: "view"
28430
29074
  },
29075
+ "recording.pauseForStorageMigration": {
29076
+ capName: "recording",
29077
+ capScope: "system",
29078
+ addonId: null,
29079
+ access: "create"
29080
+ },
29081
+ "recording.planStorageRebalance": {
29082
+ capName: "recording",
29083
+ capScope: "system",
29084
+ addonId: null,
29085
+ access: "view"
29086
+ },
28431
29087
  "recording.pruneFootage": {
28432
29088
  capName: "recording",
28433
29089
  capScope: "system",
@@ -28446,6 +29102,12 @@ Object.freeze({
28446
29102
  addonId: null,
28447
29103
  access: "view"
28448
29104
  },
29105
+ "recording.refreshStorageLocationsForMigration": {
29106
+ capName: "recording",
29107
+ capScope: "system",
29108
+ addonId: null,
29109
+ access: "create"
29110
+ },
28449
29111
  "recording.relocateFootage": {
28450
29112
  capName: "recording",
28451
29113
  capScope: "system",
@@ -28470,44 +29132,68 @@ Object.freeze({
28470
29132
  addonId: null,
28471
29133
  access: "create"
28472
29134
  },
29135
+ "recording.resumeForStorageMigration": {
29136
+ capName: "recording",
29137
+ capScope: "system",
29138
+ addonId: null,
29139
+ access: "create"
29140
+ },
28473
29141
  "recording.setDeviceConfig": {
28474
29142
  capName: "recording",
28475
29143
  capScope: "system",
28476
29144
  addonId: null,
28477
29145
  access: "create"
28478
29146
  },
29147
+ "recording.startStorageMigrationMove": {
29148
+ capName: "recording",
29149
+ capScope: "system",
29150
+ addonId: null,
29151
+ access: "create"
29152
+ },
29153
+ "recording.startStorageRebalance": {
29154
+ capName: "recording",
29155
+ capScope: "system",
29156
+ addonId: null,
29157
+ access: "create"
29158
+ },
28479
29159
  "recordingExport.cancelExport": {
28480
- capName: "recordingExport",
29160
+ capName: "recording-export",
28481
29161
  capScope: "system",
28482
29162
  addonId: null,
28483
29163
  access: "create"
28484
29164
  },
28485
29165
  "recordingExport.createExport": {
28486
- capName: "recordingExport",
29166
+ capName: "recording-export",
28487
29167
  capScope: "system",
28488
29168
  addonId: null,
28489
29169
  access: "create"
28490
29170
  },
28491
29171
  "recordingExport.deleteExport": {
28492
- capName: "recordingExport",
29172
+ capName: "recording-export",
28493
29173
  capScope: "system",
28494
29174
  addonId: null,
28495
29175
  access: "delete"
28496
29176
  },
28497
29177
  "recordingExport.getDownloadUrl": {
28498
- capName: "recordingExport",
29178
+ capName: "recording-export",
28499
29179
  capScope: "system",
28500
29180
  addonId: null,
28501
29181
  access: "view"
28502
29182
  },
28503
29183
  "recordingExport.getExport": {
28504
- capName: "recordingExport",
29184
+ capName: "recording-export",
28505
29185
  capScope: "system",
28506
29186
  addonId: null,
28507
29187
  access: "view"
28508
29188
  },
28509
29189
  "recordingExport.listExports": {
28510
- capName: "recordingExport",
29190
+ capName: "recording-export",
29191
+ capScope: "system",
29192
+ addonId: null,
29193
+ access: "view"
29194
+ },
29195
+ "recordingExport.readExportBytes": {
29196
+ capName: "recording-export",
28511
29197
  capScope: "system",
28512
29198
  addonId: null,
28513
29199
  access: "view"
@@ -28866,6 +29552,30 @@ Object.freeze({
28866
29552
  addonId: null,
28867
29553
  access: "view"
28868
29554
  },
29555
+ "storageMigration.cancel": {
29556
+ capName: "storage-migration",
29557
+ capScope: "system",
29558
+ addonId: null,
29559
+ access: "create"
29560
+ },
29561
+ "storageMigration.plan": {
29562
+ capName: "storage-migration",
29563
+ capScope: "system",
29564
+ addonId: null,
29565
+ access: "view"
29566
+ },
29567
+ "storageMigration.start": {
29568
+ capName: "storage-migration",
29569
+ capScope: "system",
29570
+ addonId: null,
29571
+ access: "create"
29572
+ },
29573
+ "storageMigration.status": {
29574
+ capName: "storage-migration",
29575
+ capScope: "system",
29576
+ addonId: null,
29577
+ access: "view"
29578
+ },
28869
29579
  "storageProvider.abortUpload": {
28870
29580
  capName: "storage-provider",
28871
29581
  capScope: "system",
@@ -29244,12 +29954,42 @@ Object.freeze({
29244
29954
  addonId: null,
29245
29955
  access: "create"
29246
29956
  },
29957
+ "terminalSession.adoptLegacyMonitor": {
29958
+ capName: "terminal-session",
29959
+ capScope: "system",
29960
+ addonId: null,
29961
+ access: "create"
29962
+ },
29247
29963
  "terminalSession.close": {
29248
29964
  capName: "terminal-session",
29249
29965
  capScope: "system",
29250
29966
  addonId: null,
29251
29967
  access: "create"
29252
29968
  },
29969
+ "terminalSession.createInstance": {
29970
+ capName: "terminal-session",
29971
+ capScope: "system",
29972
+ addonId: null,
29973
+ access: "create"
29974
+ },
29975
+ "terminalSession.deleteInstance": {
29976
+ capName: "terminal-session",
29977
+ capScope: "system",
29978
+ addonId: null,
29979
+ access: "delete"
29980
+ },
29981
+ "terminalSession.listInstances": {
29982
+ capName: "terminal-session",
29983
+ capScope: "system",
29984
+ addonId: null,
29985
+ access: "view"
29986
+ },
29987
+ "terminalSession.listLegacyCameras": {
29988
+ capName: "terminal-session",
29989
+ capScope: "system",
29990
+ addonId: null,
29991
+ access: "view"
29992
+ },
29253
29993
  "terminalSession.listProfiles": {
29254
29994
  capName: "terminal-session",
29255
29995
  capScope: "system",
@@ -29280,6 +30020,12 @@ Object.freeze({
29280
30020
  addonId: null,
29281
30021
  access: "create"
29282
30022
  },
30023
+ "terminalSession.setInstanceEnabled": {
30024
+ capName: "terminal-session",
30025
+ capScope: "system",
30026
+ addonId: null,
30027
+ access: "create"
30028
+ },
29283
30029
  "terminalSession.writeInput": {
29284
30030
  capName: "terminal-session",
29285
30031
  capScope: "system",
@@ -29824,6 +30570,104 @@ var FramerateField = number().int().min(1).max(60);
29824
30570
  var TargetsField = array(NcRuleTargetSchema).min(1);
29825
30571
  var PriorityField = number().int().min(1).max(5);
29826
30572
  /**
30573
+ * Explicit override of the DENSE sampling cadence, seconds.
30574
+ *
30575
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30576
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30577
+ * made that same base 3 s and rendered a person pass as two frames.)
30578
+ *
30579
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30580
+ * `denseCadenceSec` and played at `framerate` occupies
30581
+ *
30582
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30583
+ *
30584
+ * 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.
30585
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30586
+ * and therefore the length of a quiet night, does not move.
30587
+ *
30588
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30589
+ * the recording has them returns the same frames, requested twice. Must be
30590
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30591
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30592
+ * rather than letting the export cap reject the render hours after the window.
30593
+ */
30594
+ var DenseCadenceSecField = number().min(.1).max(3600);
30595
+ /**
30596
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30597
+ *
30598
+ * The operator-facing form of the arithmetic above: instead of solving for a
30599
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30600
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30601
+ * that range every ~583 ms.
30602
+ *
30603
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30604
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30605
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30606
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30607
+ * schema change and are the tracked follow-up.
30608
+ *
30609
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30610
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30611
+ * by real footage, never met by duplicating frames into motion that never
30612
+ * happened.
30613
+ */
30614
+ var MinDwellSecField = number().min(0).max(60);
30615
+ /**
30616
+ * Caption burned into the notification's preview frame.
30617
+ *
30618
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30619
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30620
+ * templating dialect for one field would be a second thing to explain.
30621
+ *
30622
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30623
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30624
+ * the reason this is not `.min(1)`.
30625
+ */
30626
+ var PreviewTextField = string().max(200);
30627
+ /**
30628
+ * Whether the notification's preview is a STILL or a short animation.
30629
+ *
30630
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30631
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30632
+ * night reads better as three seconds of motion than as one frame of it. Both
30633
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30634
+ * simply applies it to a dozen frames sampled across the render and assembles
30635
+ * them.
30636
+ *
30637
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30638
+ * seeks and a palette pass, and no rule that never asked for one should start
30639
+ * paying that on the deploy that shipped it.
30640
+ *
30641
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30642
+ */
30643
+ var PreviewModeField = _enum(["image", "gif"]);
30644
+ /**
30645
+ * Which detection classes the notification reports counts for.
30646
+ *
30647
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30648
+ * plan — no second query — aggregated per class. Absent or empty means "every
30649
+ * class the window actually contained", which is what an operator who never
30650
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30651
+ * counts cars all night).
30652
+ *
30653
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30654
+ * …). An unknown name simply never matches and reports nothing — it is not an
30655
+ * error, because a rule may legitimately name a class this camera's model does
30656
+ * not emit.
30657
+ *
30658
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30659
+ * - `{{detections}}` — total over the reported classes
30660
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30661
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30662
+ * one per class, `count_` + the class name
30663
+ *
30664
+ * With NO custom body template the summary is appended to the derived body, and
30665
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30666
+ * reads. With a custom template the operator owns every word — nothing is
30667
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30668
+ */
30669
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30670
+ /**
29827
30671
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29828
30672
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29829
30673
  * here (see the ownership note above).
@@ -29843,9 +30687,30 @@ var TimelapseRuleInputSchema = object({
29843
30687
  cadenceSec: CadenceSecField.default(15),
29844
30688
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29845
30689
  framerate: FramerateField.default(10),
30690
+ /**
30691
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30692
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30693
+ * field gets.
30694
+ */
30695
+ denseCadenceSec: DenseCadenceSecField.optional(),
30696
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30697
+ minDwellSec: MinDwellSecField.optional(),
29846
30698
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29847
30699
  targets: TargetsField,
29848
30700
  template: TimelapseTemplateSchema.optional(),
30701
+ /**
30702
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30703
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30704
+ *
30705
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30706
+ * the notification's title/body, and clearing it (`template: null`) must not
30707
+ * silently clear the caption too.
30708
+ */
30709
+ previewText: PreviewTextField.optional(),
30710
+ /** Still or animation — see {@link PreviewModeField}. */
30711
+ previewMode: PreviewModeField.default("image"),
30712
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30713
+ reportClasses: ReportClassesField.optional(),
29849
30714
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29850
30715
  priority: PriorityField.default(3)
29851
30716
  });
@@ -29856,8 +30721,13 @@ object({
29856
30721
  schedule: NcScheduleSchema.optional(),
29857
30722
  cadenceSec: CadenceSecField.optional(),
29858
30723
  framerate: FramerateField.optional(),
30724
+ denseCadenceSec: DenseCadenceSecField.optional(),
30725
+ minDwellSec: MinDwellSecField.optional(),
29859
30726
  targets: TargetsField.optional(),
29860
30727
  template: TimelapseTemplateSchema.nullable().optional(),
30728
+ previewText: PreviewTextField.optional(),
30729
+ previewMode: PreviewModeField.optional(),
30730
+ reportClasses: ReportClassesField.optional(),
29861
30731
  priority: PriorityField.optional()
29862
30732
  });
29863
30733
  TimelapseRuleInputSchema.extend({
@@ -29869,10 +30739,28 @@ TimelapseRuleInputSchema.extend({
29869
30739
  */
29870
30740
  ownerUserId: string().optional(),
29871
30741
  /**
29872
- * Epoch-ms of the last successful generation the 1-hour re-generation
29873
- * guard's durable state (predecessor parity). Absent = never generated.
30742
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30743
+ * rule. What a UI shows, and the compatibility floor for
30744
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29874
30745
  */
29875
30746
  lastGeneratedAt: number().optional(),
30747
+ /**
30748
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30749
+ * re-generation guard's real durable state.
30750
+ *
30751
+ * One rule covers several cameras and each renders its own video, so a rule
30752
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30753
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30754
+ * already done — and B's night is gone for good, because the window will not
30755
+ * come back.
30756
+ *
30757
+ * ADDITIVE, so the migration is free: a row written before this field simply
30758
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30759
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30760
+ * "never generated" would re-render and re-notify every camera of every rule
30761
+ * once, on the deploy that shipped the map.
30762
+ */
30763
+ generatedByDevice: record(string(), number()).optional(),
29876
30764
  /** userId of the caller who created the rule (server-stamped). */
29877
30765
  createdBy: string(),
29878
30766
  createdAt: number(),