@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.
@@ -7234,8 +7234,31 @@ var AdoptionJobSchema = object({
7234
7234
  error: string().nullable()
7235
7235
  });
7236
7236
  /**
7237
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7238
- * pipeline functions an operator thinks in terms of.
7237
+ * Per-camera FUNCTION SWITCHES.
7238
+ *
7239
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7240
+ *
7241
+ * This file shipped as "the one coherent on/off surface over the pipeline
7242
+ * functions an operator thinks in terms of". The operator's verdict on
7243
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7244
+ * every function already had a settings page of its own, and a second place to
7245
+ * turn it off is a second place to look. Each switch is going back to its own
7246
+ * component's original options — detection to the detection-pipeline wrapper
7247
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7248
+ * (which was always first-class; the switch was a veneer over
7249
+ * `recording.setDeviceConfig`), notifications to a notification-center
7250
+ * per-device setting, the two camera planes to their own components.
7251
+ *
7252
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7253
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7254
+ * straight from the authorities with no group in the middle. That rule was
7255
+ * never about a control panel.
7256
+ *
7257
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7258
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7259
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7260
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7261
+ * stop; nothing new may be built on it.
7239
7262
  *
7240
7263
  * ## This file adds no state
7241
7264
  *
@@ -7580,14 +7603,21 @@ var RecordingConfigSchema = object({
7580
7603
  /**
7581
7604
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7582
7605
  *
7583
- * One shape shared by the recorder's `relocateFootage` (segments) and
7584
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7585
- * page renders both movers with one component. Jobs are in-RAM (a restart
7586
- * forgets them re-running is safe by construction: copy-if-absent, delete
7587
- * after verify) and each completed/failed run also lands one durable ops-log
7588
- * row on the owning addon's surface.
7606
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7607
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7608
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7609
+ * Each completed/failed run also lands one durable ops-log row on its owning
7610
+ * addon surface.
7611
+ */
7612
+ /**
7613
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7614
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7615
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7616
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7617
+ * runs at all.
7589
7618
  */
7590
7619
  var RelocateJobStateSchema = _enum([
7620
+ "queued",
7591
7621
  "running",
7592
7622
  "done",
7593
7623
  "failed",
@@ -7612,19 +7642,109 @@ var RelocateJobSchema = object({
7612
7642
  finishedAt: number().nullable(),
7613
7643
  error: string().nullable()
7614
7644
  });
7645
+ /** Profile-derived footage selection used only by the migration coordinator:
7646
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7647
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7615
7648
  var RelocateFootageInputSchema = object({
7616
- deviceId: number().optional(),
7617
7649
  fromLocationId: string(),
7618
7650
  toLocationId: string(),
7619
7651
  entities: array(_enum(["segments"])).optional(),
7652
+ /** Limits relocation to the logical profile class. Omit only for the
7653
+ * pre-orchestration compatibility path. */
7654
+ footageClass: RelocateFootageClassSchema.optional(),
7655
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7656
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7657
+ * unit is a (camera, profile) pile, not a disk. */
7658
+ deviceId: number().int().optional(),
7659
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7660
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7661
+ * placement plan assigns those two independently, so a rebalance that could
7662
+ * only say "recordings" would move footage the plan never asked to move. */
7663
+ profiles: array(string()).optional(),
7620
7664
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7621
7665
  * never allowed to starve live writers. */
7622
7666
  throttleMbps: number().min(1).max(1e3).optional()
7623
7667
  });
7624
- var RelocateMediaInputSchema = object({
7625
- deviceId: number().optional(),
7668
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7669
+ * from persistent recording settings: a migration never changes
7670
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7671
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7672
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7673
+ var StorageMigrationMediaMoveInputSchema = object({
7626
7674
  toLocationId: string(),
7627
7675
  throttleMbps: number().min(1).max(1e3).optional()
7676
+ }).extend({ leaseId: string().min(1) });
7677
+ /** The independently selectable logical storage classes. `recordings`
7678
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7679
+ * segments; `eventMedia` is post-analysis blobs. */
7680
+ var StorageMigrationClassSchema = _enum([
7681
+ "recordings",
7682
+ "recordingsLow",
7683
+ "eventMedia"
7684
+ ]);
7685
+ /** A destination is always an existing, fully-qualified location id. The
7686
+ * migration API intentionally never changes a source location's `basePath`:
7687
+ * callers create a new `<type>:<slug>` location, then select it here. */
7688
+ var StorageMigrationDestinationsSchema = object({
7689
+ recordings: string().min(1).optional(),
7690
+ recordingsLow: string().min(1).optional(),
7691
+ eventMedia: string().min(1).optional()
7692
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7693
+ /** Shared input for planning and starting an orchestrated storage migration. */
7694
+ var StorageMigrationInputSchema = object({
7695
+ destinations: StorageMigrationDestinationsSchema,
7696
+ throttleMbps: number().min(1).max(1e3).optional()
7697
+ });
7698
+ /** The durable coordinator state machine. The only phase that changes default
7699
+ * locations is `repointing`, after every selected mover has completed and been
7700
+ * verified. */
7701
+ var StorageMigrationPhaseSchema = _enum([
7702
+ "planning",
7703
+ "pausing",
7704
+ "moving",
7705
+ "verifying",
7706
+ "repointing",
7707
+ "refreshing",
7708
+ "resuming",
7709
+ "done",
7710
+ "failed",
7711
+ "cancelled"
7712
+ ]);
7713
+ var StorageMigrationParticipantSchema = _enum([
7714
+ "pipeline",
7715
+ "recorder",
7716
+ "analytics"
7717
+ ]);
7718
+ var StorageMigrationMoveSchema = object({
7719
+ storageClass: StorageMigrationClassSchema,
7720
+ fromLocationId: string(),
7721
+ toLocationId: string(),
7722
+ moverJobId: string().nullable(),
7723
+ state: RelocateJobStateSchema.nullable(),
7724
+ error: string().nullable()
7725
+ });
7726
+ var StorageMigrationJobSchema = object({
7727
+ jobId: string(),
7728
+ phase: StorageMigrationPhaseSchema,
7729
+ destinations: StorageMigrationDestinationsSchema,
7730
+ throttleMbps: number(),
7731
+ moves: array(StorageMigrationMoveSchema),
7732
+ pauseLeaseId: string().nullable(),
7733
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7734
+ repointed: boolean(),
7735
+ cancelRequested: boolean(),
7736
+ startedAt: number(),
7737
+ updatedAt: number(),
7738
+ finishedAt: number().nullable(),
7739
+ error: string().nullable()
7740
+ });
7741
+ var StorageMigrationPlanSchema = object({
7742
+ destinations: StorageMigrationDestinationsSchema,
7743
+ moves: array(object({
7744
+ storageClass: StorageMigrationClassSchema,
7745
+ fromLocationId: string(),
7746
+ toLocationId: string()
7747
+ }))
7628
7748
  });
7629
7749
  /**
7630
7750
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7676,6 +7796,21 @@ var StorageLocationSchema = object({
7676
7796
  nodeId: string().optional(),
7677
7797
  isDefault: boolean().default(false),
7678
7798
  isSystem: boolean().default(false),
7799
+ /**
7800
+ * Operator opt-in: whether consumers that BALANCE across several locations
7801
+ * of a type may write here. Recordings reads it today; event media and
7802
+ * backups are the next consumers, which is why the flag lives on the
7803
+ * location rather than in any one addon's store — nothing has to be
7804
+ * extended to add the next consumer.
7805
+ *
7806
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7807
+ * flag existed reads back with no flag and keeps working exactly as before;
7808
+ * that is the whole compat story, and it is why no migration ships with it.
7809
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7810
+ * disk must not silently start writing to it); the default of a type is
7811
+ * always stamped `true`.
7812
+ */
7813
+ enabled: boolean().optional(),
7679
7814
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7680
7815
  * for node-local locations it can reach) — never persisted, absent when the
7681
7816
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12027,7 +12162,8 @@ method(object({
12027
12162
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12028
12163
  /**
12029
12164
  * filesystem-browse — per-node capability for browsing the node's local
12030
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12165
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12166
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12031
12167
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12032
12168
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12033
12169
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13859,6 +13995,13 @@ var MaskGridDimsSchema = object({
13859
13995
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13860
13996
  * this one field keeps the schema additive — a rule still declares exactly
13861
13997
  * one trigger.
13998
+ *
13999
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14000
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14001
+ * mirror.ts` fails the build on a member the app cannot render) and every
14002
+ * member costs a release train. A sustained-sound rule is therefore an
14003
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14004
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13862
14005
  */
13863
14006
  var NcDeliverySchema = _enum([
13864
14007
  "immediate",
@@ -13873,15 +14016,32 @@ var NcDeliverySchema = _enum([
13873
14016
  * depend on a provider's raw event name or payload shape.
13874
14017
  */
13875
14018
  var NcSystemEventKindSchema = _enum([
13876
- "camera-online",
13877
- "camera-offline",
14019
+ "device-online",
14020
+ "device-offline",
14021
+ "device-disabled",
14022
+ "device-enabled",
13878
14023
  "stream-online",
13879
14024
  "stream-offline",
13880
14025
  "node-online",
13881
14026
  "node-offline",
13882
14027
  "addon-update-available",
13883
- "server-update-available"
14028
+ "server-update-available",
14029
+ "alarm-triggered",
14030
+ "alarm-armed",
14031
+ "alarm-disarmed",
14032
+ "camera-online",
14033
+ "camera-offline",
14034
+ "camera-disabled",
14035
+ "camera-enabled"
14036
+ ]);
14037
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14038
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14039
+ "camera-online",
14040
+ "camera-offline",
14041
+ "camera-disabled",
14042
+ "camera-enabled"
13884
14043
  ]);
14044
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13885
14045
  /**
13886
14046
  * One coherent system-event condition. `kinds` is the required opt-in safety
13887
14047
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13890,6 +14050,18 @@ var NcSystemEventKindSchema = _enum([
13890
14050
  var NcSystemEventConditionSchema = object({
13891
14051
  kinds: array(NcSystemEventKindSchema).min(1),
13892
14052
  deviceIds: array(number().int()).min(1).optional(),
14053
+ /**
14054
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14055
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14056
+ * is what a liveness rule means when nobody said otherwise.
14057
+ *
14058
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14059
+ * one reason: the intake cannot know which devices this household cares
14060
+ * about, and a producer-side filter is one no operator can change. Fails
14061
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14062
+ * does not carry) matches no `deviceTypes` list.
14063
+ */
14064
+ deviceTypes: array(string().min(1)).min(1).optional(),
13893
14065
  nodeIds: array(string().min(1)).min(1).optional(),
13894
14066
  packageNames: array(string().min(1)).min(1).optional()
13895
14067
  });
@@ -13940,6 +14112,47 @@ var NcOccupancyConditionSchema = object({
13940
14112
  sustainSeconds: number().int().min(0).max(3600).default(15)
13941
14113
  });
13942
14114
  /**
14115
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14116
+ *
14117
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14118
+ * reference notifier uses, so an operator moving between them re-uses what
14119
+ * they already know): a rule matches when, over a sampling window of
14120
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14121
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14122
+ *
14123
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14124
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14125
+ * - `labels` — the classifier put at least one of these labels on it.
14126
+ *
14127
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14128
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14129
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14130
+ * is given** — a window in which every sample is trivially a hit would fire on
14131
+ * silence, so the engine refuses such a condition rather than notifying on
14132
+ * nothing (the schema cannot express "at least one of" without becoming a
14133
+ * ZodEffects the cap path would have to special-case).
14134
+ *
14135
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14136
+ * must be FULL before it can match — a window that has been open for two
14137
+ * seconds of its ten is 100% of nothing, and firing on it would make
14138
+ * `samplingSeconds` decorative.
14139
+ *
14140
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14141
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14142
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14143
+ * an operator who typed `dog` mean the same thing.
14144
+ */
14145
+ var NcAudioConditionSchema = object({
14146
+ /** Audio macro labels; absent = any sound (level-only rule). */
14147
+ labels: array(string().min(1)).min(1).optional(),
14148
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14149
+ dbThreshold: number().min(-96).max(0).optional(),
14150
+ /** Percentage of the window's samples that must be hits (1–100). */
14151
+ hitPercent: number().int().min(1).max(100).default(60),
14152
+ /** Length of the sampling window in seconds. */
14153
+ samplingSeconds: number().int().min(1).max(300).default(10)
14154
+ });
14155
+ /**
13943
14156
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13944
14157
  *
13945
14158
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14212,7 +14425,33 @@ var NcConditionsSchema = object({
14212
14425
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14213
14426
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14214
14427
  */
14215
- occupancy: NcOccupancyConditionSchema.optional()
14428
+ occupancy: NcOccupancyConditionSchema.optional(),
14429
+ /**
14430
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14431
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14432
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14433
+ * a window that is not full yet, neither filter given). See
14434
+ * {@link NcAudioCondition}.
14435
+ *
14436
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14437
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14438
+ * a detection, a track or a device event (the same fail-closed pairing
14439
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14440
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14441
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14442
+ * classified sample) stays exactly as it was for rules that already use it.
14443
+ *
14444
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14445
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14446
+ * (`camstack/src/data/notification-center.ts`, guarded by
14447
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14448
+ * condition fields it does not know when a rule is saved from the phone.
14449
+ * Publishing an editor for a condition the app cannot round-trip is how an
14450
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14451
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14452
+ * does an audio rule become authorable.
14453
+ */
14454
+ audio: NcAudioConditionSchema.optional()
14216
14455
  });
14217
14456
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14218
14457
  var NcRuleTargetSchema = object({
@@ -14326,6 +14565,73 @@ var NcThrottleSchema = object({
14326
14565
  */
14327
14566
  granularity: NcThrottleGranularitySchema.optional()
14328
14567
  });
14568
+ /**
14569
+ * How long the confirm gate may hold ONE notification, and how big the picture
14570
+ * it judges may be.
14571
+ *
14572
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14573
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14574
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14575
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14576
+ * tokens for pixels the model pools away.
14577
+ */
14578
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14579
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14580
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14581
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14582
+ var NcConfirmExpectSchema = object({
14583
+ op: _enum([
14584
+ ">=",
14585
+ ">",
14586
+ "<=",
14587
+ "<",
14588
+ "=="
14589
+ ]),
14590
+ count: number().int().min(0).max(1e3)
14591
+ });
14592
+ /**
14593
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14594
+ * to ship and says whether it agrees with the rule.
14595
+ *
14596
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14597
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14598
+ * on the operator's phone is not a verdict about this notification.
14599
+ *
14600
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14601
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14602
+ * the default and every fail-open is COUNTED, because a gate that always fails
14603
+ * open looks in the log exactly like a gate that works.
14604
+ *
14605
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14606
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14607
+ * production failures in one day), so the gate reads absent as the constant
14608
+ * above rather than trusting a parse it may never have seen.
14609
+ */
14610
+ var NcConfirmSchema = object({
14611
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14612
+ * same thing, and both mean "deliver exactly as before". */
14613
+ enabled: boolean().default(false),
14614
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14615
+ profileId: string().optional(),
14616
+ /**
14617
+ * The operator's question, in his own words. Absent = a question derived
14618
+ * from the rule (its class and its expectation).
14619
+ *
14620
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14621
+ * banners, signage and plates as instructions if you let them reach the
14622
+ * prompt — proven live — so the authoritative contract stays in the system
14623
+ * turn and only rule-authored words land here.
14624
+ */
14625
+ prompt: string().max(1e3).optional(),
14626
+ /** Fire only when the model's count satisfies this. Absent = the model's
14627
+ * own boolean verdict decides. */
14628
+ expect: NcConfirmExpectSchema.optional(),
14629
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14630
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14631
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14632
+ /** Longest edge the judged image is downscaled to before it is sent. */
14633
+ maxImagePx: number().int().min(64).max(2048).default(448)
14634
+ });
14329
14635
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14330
14636
  var NcRuleInputSchema = object({
14331
14637
  name: string().min(1).max(200),
@@ -14386,7 +14692,13 @@ var NcRuleInputSchema = object({
14386
14692
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14387
14693
  * shape as every other actuation.
14388
14694
  */
14389
- actions: NcRuleActionsSchema.optional()
14695
+ actions: NcRuleActionsSchema.optional(),
14696
+ /**
14697
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14698
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14699
+ * did, and absent is the only way to say that without a migration.
14700
+ */
14701
+ confirm: NcConfirmSchema.optional()
14390
14702
  });
14391
14703
  /**
14392
14704
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14397,7 +14709,37 @@ var NcRuleInputSchema = object({
14397
14709
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14398
14710
  * `updateRule` patch.
14399
14711
  */
14400
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14712
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14713
+ disabledTargetIds: array(string()).optional(),
14714
+ /**
14715
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14716
+ *
14717
+ * It makes the key optional to SUPPLY; the parse still materialises the
14718
+ * default when the key is absent. And `NcRuleStore.update` merges with
14719
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14720
+ * one — which made every partial edit destructive:
14721
+ *
14722
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14723
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14724
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14725
+ *
14726
+ * A rule scoped to one camera and one zone silently became a rule that
14727
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14728
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14729
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14730
+ * within a minute of a two-field patch.
14731
+ *
14732
+ * So every defaulted field is re-declared here WITHOUT its default. The
14733
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14734
+ * conditions remains a real instruction ("clear them") — and only the
14735
+ * absent key is now genuinely absent.
14736
+ */
14737
+ enabled: boolean().optional(),
14738
+ conditions: NcConditionsSchema.optional(),
14739
+ media: NcMediaPolicySchema.optional(),
14740
+ throttle: NcThrottleSchema.optional(),
14741
+ priority: number().int().min(1).max(5).optional()
14742
+ });
14401
14743
  /** A persisted rule. */
14402
14744
  var NcRuleSchema = NcRuleInputSchema.extend({
14403
14745
  id: string(),
@@ -14698,6 +15040,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14698
15040
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14699
15041
  * copy would lie the first time a rule is disabled.
14700
15042
  */
15043
+ /**
15044
+ * Why a device a mode NAMES is nonetheless not armed by it.
15045
+ *
15046
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15047
+ * per-camera notification switch the Notification Center already owns,
15048
+ * `detection-off` is the device's own detection binding being inactive, and
15049
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15050
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15051
+ * with the switches the operator actually used.
15052
+ */
15053
+ var NcAlarmSkipReasonSchema = _enum([
15054
+ "muted",
15055
+ "detection-off",
15056
+ "offline"
15057
+ ]);
15058
+ var NcAlarmSkippedDeviceSchema = object({
15059
+ deviceId: number().int(),
15060
+ reason: NcAlarmSkipReasonSchema
15061
+ });
14701
15062
  var NcAlarmModeCoverageSchema = object({
14702
15063
  mode: AlarmArmModeSchema,
14703
15064
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14705,7 +15066,18 @@ var NcAlarmModeCoverageSchema = object({
14705
15066
  /** At least one covering rule has no device scope, so the mode covers all. */
14706
15067
  allDevices: boolean(),
14707
15068
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14708
- deviceIds: array(number().int())
15069
+ deviceIds: array(number().int()),
15070
+ /**
15071
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15072
+ * excludes it.
15073
+ *
15074
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15075
+ * twelve makes it false in exactly the way nobody notices until an incident.
15076
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15077
+ * still parses as "nothing known to be skipped" rather than failing the whole
15078
+ * alarm tab.
15079
+ */
15080
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14709
15081
  });
14710
15082
  var NcAlarmConfigSchema = object({
14711
15083
  /**
@@ -16068,13 +16440,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16068
16440
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16069
16441
  kind: "mutation",
16070
16442
  auth: "admin"
16071
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16443
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16072
16444
  kind: "mutation",
16073
16445
  auth: "admin"
16074
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16075
- kind: "query",
16446
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16447
+ kind: "mutation",
16076
16448
  auth: "admin"
16077
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16449
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16450
+ kind: "mutation",
16451
+ auth: "admin"
16452
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16453
+ kind: "mutation",
16454
+ auth: "admin"
16455
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16078
16456
  kind: "mutation",
16079
16457
  auth: "admin"
16080
16458
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17498,9 +17876,16 @@ var CameraStatusSchema = object({
17498
17876
  audio: CameraAudioStatusSchema.nullable(),
17499
17877
  recording: CameraRecordingStatusSchema.nullable(),
17500
17878
  /**
17501
- * Per-camera function switches an OPERATOR has turned off
17879
+ * Per-camera functions an OPERATOR has turned off
17502
17880
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17503
17881
  *
17882
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17883
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17884
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17885
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17886
+ * The badge outlives the control panel: the panel was a convenience, this is
17887
+ * the difference between a camera being off and a camera being dead.
17888
+ *
17504
17889
  * This is the difference between DISABLED and BROKEN. A camera whose
17505
17890
  * `detection` block reports zero fps and whose `switchedOff` contains
17506
17891
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17571,7 +17956,13 @@ var NodeInferenceDevicesSchema = object({
17571
17956
  reachable: boolean(),
17572
17957
  devices: array(NodeInferenceDeviceSchema).readonly()
17573
17958
  });
17574
- method(object({
17959
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17960
+ kind: "mutation",
17961
+ auth: "admin"
17962
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17963
+ kind: "mutation",
17964
+ auth: "admin"
17965
+ }), method(object({
17575
17966
  deviceId: number(),
17576
17967
  agentNodeId: string()
17577
17968
  }), object({ success: literal(true) }), {
@@ -18245,6 +18636,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18245
18636
  locationId: string(),
18246
18637
  targetBytes: number().int().positive()
18247
18638
  }), EvictResultSchema, { kind: "mutation" });
18639
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18640
+ kind: "mutation",
18641
+ auth: "admin"
18642
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18643
+ kind: "mutation",
18644
+ auth: "admin"
18645
+ });
18248
18646
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18249
18647
  providerId: string().min(1),
18250
18648
  displayName: string().min(1),
@@ -18348,6 +18746,28 @@ var TerminalProfileInfoSchema = object({
18348
18746
  label: string(),
18349
18747
  description: string().optional()
18350
18748
  });
18749
+ /**
18750
+ * A durable operator-created Terminal instance. Profiles are templates; only
18751
+ * an instance declares a camera.
18752
+ */
18753
+ var TerminalInstanceInfoSchema = object({
18754
+ instanceId: string(),
18755
+ cameraStableId: string(),
18756
+ nodeId: string(),
18757
+ profileId: string(),
18758
+ profileLabel: string(),
18759
+ name: string(),
18760
+ enabled: boolean()
18761
+ });
18762
+ var TerminalLegacyCameraSchema = object({
18763
+ stableId: string(),
18764
+ nodeId: string(),
18765
+ profileId: string(),
18766
+ profileLabel: string(),
18767
+ name: string(),
18768
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18769
+ adoptable: boolean()
18770
+ });
18351
18771
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18352
18772
  seq: number().int().positive(),
18353
18773
  kind: literal("data"),
@@ -18364,7 +18784,29 @@ var TerminalOutputBatchSchema = object({
18364
18784
  snapshot: string().optional(),
18365
18785
  events: array(TerminalOutputEventSchema).readonly()
18366
18786
  });
18367
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18787
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18788
+ targetNodeId: string().min(1),
18789
+ profileId: string().min(1),
18790
+ name: string().trim().min(1).max(160).optional()
18791
+ }), TerminalInstanceInfoSchema, {
18792
+ kind: "mutation",
18793
+ auth: "admin"
18794
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18795
+ kind: "mutation",
18796
+ auth: "admin"
18797
+ }), method(object({
18798
+ instanceId: string().min(1),
18799
+ enabled: boolean()
18800
+ }), TerminalInstanceInfoSchema, {
18801
+ kind: "mutation",
18802
+ auth: "admin"
18803
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18804
+ stableId: string().min(1),
18805
+ name: string().trim().min(1).max(160).optional()
18806
+ }), TerminalInstanceInfoSchema, {
18807
+ kind: "mutation",
18808
+ auth: "admin"
18809
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18368
18810
  profileId: string(),
18369
18811
  cols: number().int().positive(),
18370
18812
  rows: number().int().positive()
@@ -18381,7 +18823,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18381
18823
  }), method(object({
18382
18824
  sessionId: string(),
18383
18825
  afterSeq: number().int().nonnegative(),
18384
- waitMs: number().int().min(0).max(2e3).default(0)
18826
+ waitMs: number().int().min(0).max(2e3).default(0),
18827
+ /**
18828
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18829
+ * browser's initial repaint remains immediate; the camera snapshot
18830
+ * relay uses it to avoid encoding a blank startup frame.
18831
+ */
18832
+ waitForOutput: boolean().optional()
18385
18833
  }), TerminalOutputBatchSchema, {
18386
18834
  kind: "mutation",
18387
18835
  auth: "admin",
@@ -20322,6 +20770,7 @@ var FaceInfoSchema = object({
20322
20770
  var FaceFilterEnum = _enum([
20323
20771
  "unassigned",
20324
20772
  "recognized",
20773
+ "identified",
20325
20774
  "all"
20326
20775
  ]);
20327
20776
  var MediaFileLiteSchema$1 = object({
@@ -20350,6 +20799,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20350
20799
  kind: "mutation",
20351
20800
  auth: "admin"
20352
20801
  }), method(object({
20802
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20803
+ deviceId: number().int().optional(),
20353
20804
  limit: number().int().positive().optional(),
20354
20805
  filter: FaceFilterEnum.optional(),
20355
20806
  /**
@@ -22115,6 +22566,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22115
22566
  capName: string().min(1).max(64),
22116
22567
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22117
22568
  valuePath: string().min(1).max(64)
22569
+ }),
22570
+ object({
22571
+ kind: literal("latest-recognition"),
22572
+ recognition: _enum(["person", "plate"])
22118
22573
  })
22119
22574
  ]);
22120
22575
  var OsdSlotBindingSchema = object({
@@ -22220,6 +22675,15 @@ method(object({ deviceId: number().int() }), object({
22220
22675
  }), object({ success: literal(true) }), {
22221
22676
  kind: "mutation",
22222
22677
  auth: "admin"
22678
+ }), method(object({
22679
+ sourceDeviceId: number().int(),
22680
+ targetDeviceId: number().int()
22681
+ }), object({
22682
+ copied: number().int().nonnegative(),
22683
+ skipped: number().int().nonnegative()
22684
+ }), {
22685
+ kind: "mutation",
22686
+ auth: "admin"
22223
22687
  }), method(object({
22224
22688
  deviceId: number().int(),
22225
22689
  slotId: string().min(1),
@@ -22930,7 +23394,19 @@ var RecordingManifestSchema = object({
22930
23394
  * profiles/subtrees/locations on this node). */
22931
23395
  var RecordingDeviceUsageSchema = object({
22932
23396
  deviceId: number(),
22933
- usedBytes: number()
23397
+ usedBytes: number(),
23398
+ /**
23399
+ * Start of this camera's OLDEST indexed segment, across every profile and
23400
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23401
+ * only honest answer to "is retention actually holding?" per camera.
23402
+ *
23403
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23404
+ * predates this field omits it entirely, and a hub whose types carry the
23405
+ * field must keep validating that older provider's payload: the framework
23406
+ * (types) and the addon ship on different trains, and the addon is usually
23407
+ * the later of the two.
23408
+ */
23409
+ oldestMs: number().nullable().optional()
22934
23410
  });
22935
23411
  /** Recording storage usage + capacity for one storage location. */
22936
23412
  var RecordingLocationUsageSchema = object({
@@ -22958,6 +23434,57 @@ var RecordingStorageUsageSchema = object({
22958
23434
  locations: array(RecordingLocationUsageSchema)
22959
23435
  });
22960
23436
  /**
23437
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23438
+ *
23439
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23440
+ * is the operator asking for the EXISTING archive to be brought into line with
23441
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23442
+ * location, run FIFO behind the single-flight mover.
23443
+ *
23444
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23445
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23446
+ * (empty on the plan).
23447
+ */
23448
+ var RecordingRebalanceMoveSchema = object({
23449
+ deviceId: number(),
23450
+ profile: string(),
23451
+ fromLocationId: string(),
23452
+ toLocationId: string(),
23453
+ bytes: number(),
23454
+ files: number().int()
23455
+ });
23456
+ /** Why a pile that is out of place is staying there. Every refusal is
23457
+ * reported: a rebalance that silently drops a camera reads exactly like one
23458
+ * that had nothing to do. */
23459
+ var RecordingRebalanceSkipReasonSchema = _enum([
23460
+ "unassigned",
23461
+ "target-not-writable",
23462
+ "below-threshold",
23463
+ "no-headroom"
23464
+ ]);
23465
+ var RecordingRebalanceSkipSchema = object({
23466
+ deviceId: number(),
23467
+ profile: string(),
23468
+ fromLocationId: string(),
23469
+ /** The location the plan wants; null when the camera has no assignment. */
23470
+ toLocationId: string().nullable(),
23471
+ bytes: number(),
23472
+ reason: RecordingRebalanceSkipReasonSchema
23473
+ });
23474
+ var RecordingRebalancePlanSchema = object({
23475
+ moves: array(RecordingRebalanceMoveSchema),
23476
+ skipped: array(RecordingRebalanceSkipSchema),
23477
+ bytesToMove: number(),
23478
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23479
+ jobIds: array(string())
23480
+ });
23481
+ var RecordingRebalanceInputSchema = object({
23482
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23483
+ throttleMbps: number().min(1).max(1e3).optional(),
23484
+ /** Ignore piles smaller than this (default 1 GB). */
23485
+ minMoveGb: number().min(0).optional()
23486
+ });
23487
+ /**
22961
23488
  * Result of locating footage at a wall-clock instant for one device/profile.
22962
23489
  * `segment` carries the covering segment's window; `gap` reports the forward
22963
23490
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23105,6 +23632,21 @@ method(object({
23105
23632
  }), {
23106
23633
  kind: "mutation",
23107
23634
  auth: "admin"
23635
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23636
+ kind: "mutation",
23637
+ auth: "admin"
23638
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23639
+ kind: "mutation",
23640
+ auth: "admin"
23641
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23642
+ kind: "mutation",
23643
+ auth: "admin"
23644
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23645
+ kind: "mutation",
23646
+ auth: "admin"
23647
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23648
+ kind: "mutation",
23649
+ auth: "admin"
23108
23650
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23109
23651
  kind: "mutation",
23110
23652
  auth: "admin"
@@ -23114,9 +23656,15 @@ method(object({
23114
23656
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23115
23657
  kind: "mutation",
23116
23658
  auth: "admin"
23659
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23660
+ kind: "query",
23661
+ auth: "admin"
23662
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23663
+ kind: "mutation",
23664
+ auth: "admin"
23117
23665
  });
23118
23666
  /**
23119
- * `recordingExport` cap — render a footage time range into a single downloadable
23667
+ * `recording-export` cap — render a footage time range into a single downloadable
23120
23668
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23121
23669
  * bounded lifetime with a durable history, auto-expiry, and optional
23122
23670
  * delete-after-download.
@@ -23131,10 +23679,42 @@ method(object({
23131
23679
  */
23132
23680
  /** Playback-speed multiplier for the render (1 = realtime). */
23133
23681
  var ExportSpeedSchema = number().min(.25).max(32);
23682
+ /**
23683
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23684
+ *
23685
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23686
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23687
+ * playlist. Handing it absolute epochs would make every call site responsible
23688
+ * for the same subtraction, and the one that forgot would emit a filter that
23689
+ * selects nothing — silently, as a uniform timelapse.
23690
+ */
23691
+ var ExportDenseRangeSchema = object({
23692
+ fromSec: number().nonnegative(),
23693
+ toSec: number().nonnegative()
23694
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23695
+ /**
23696
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23697
+ * listed ranges and at the base `everyMs` everywhere else.
23698
+ *
23699
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23700
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23701
+ */
23702
+ var ExportDenseSchema = object({
23703
+ everyMs: number().int().positive(),
23704
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23705
+ });
23134
23706
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23135
23707
  var ExportTimelapseSchema = object({
23136
23708
  everyMs: number().int().positive(),
23137
- outputFps: number().int().min(1).max(60).optional()
23709
+ outputFps: number().int().min(1).max(60).optional(),
23710
+ /** Optional second, FASTER rate over the intervals that matter. */
23711
+ dense: ExportDenseSchema.optional()
23712
+ }).superRefine((v, ctx) => {
23713
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23714
+ code: ZodIssueCode.custom,
23715
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23716
+ path: ["dense", "everyMs"]
23717
+ });
23138
23718
  });
23139
23719
  /**
23140
23720
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23192,6 +23772,19 @@ var ExportDownloadSchema = object({
23192
23772
  url: string(),
23193
23773
  endpoints: array(string())
23194
23774
  });
23775
+ /**
23776
+ * A finished export's bytes, inline.
23777
+ *
23778
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23779
+ * against, so nobody has to infer it from the base64 length.
23780
+ */
23781
+ var ExportBytesSchema = object({
23782
+ base64: string(),
23783
+ contentType: string(),
23784
+ /** Suggested filename, extension included. */
23785
+ name: string(),
23786
+ bytes: number().int().nonnegative()
23787
+ });
23195
23788
  method(object({
23196
23789
  deviceId: number(),
23197
23790
  profile: string(),
@@ -23216,6 +23809,9 @@ method(object({
23216
23809
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23217
23810
  kind: "query",
23218
23811
  auth: "protected"
23812
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23813
+ kind: "query",
23814
+ auth: "protected"
23219
23815
  });
23220
23816
  /**
23221
23817
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27233,6 +27829,12 @@ Object.freeze({
27233
27829
  addonId: null,
27234
27830
  access: "delete"
27235
27831
  },
27832
+ "osdManager.copyDeviceConfiguration": {
27833
+ capName: "osd-manager",
27834
+ capScope: "system",
27835
+ addonId: null,
27836
+ access: "create"
27837
+ },
27236
27838
  "osdManager.getConditionSupport": {
27237
27839
  capName: "osd-manager",
27238
27840
  capScope: "system",
@@ -27329,7 +27931,7 @@ Object.freeze({
27329
27931
  addonId: null,
27330
27932
  access: "create"
27331
27933
  },
27332
- "pipelineAnalytics.cancelMediaRelocate": {
27934
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27333
27935
  capName: "pipeline-analytics",
27334
27936
  capScope: "device",
27335
27937
  addonId: null,
@@ -27401,12 +28003,6 @@ Object.freeze({
27401
28003
  addonId: null,
27402
28004
  access: "view"
27403
28005
  },
27404
- "pipelineAnalytics.getMediaRelocateStatus": {
27405
- capName: "pipeline-analytics",
27406
- capScope: "device",
27407
- addonId: null,
27408
- access: "view"
27409
- },
27410
28006
  "pipelineAnalytics.getMotionEvents": {
27411
28007
  capName: "pipeline-analytics",
27412
28008
  capScope: "device",
@@ -27443,6 +28039,12 @@ Object.freeze({
27443
28039
  addonId: null,
27444
28040
  access: "view"
27445
28041
  },
28042
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28043
+ capName: "pipeline-analytics",
28044
+ capScope: "device",
28045
+ addonId: null,
28046
+ access: "view"
28047
+ },
27446
28048
  "pipelineAnalytics.getTrack": {
27447
28049
  capName: "pipeline-analytics",
27448
28050
  capScope: "device",
@@ -27521,6 +28123,12 @@ Object.freeze({
27521
28123
  addonId: null,
27522
28124
  access: "view"
27523
28125
  },
28126
+ "pipelineAnalytics.pauseForStorageMigration": {
28127
+ capName: "pipeline-analytics",
28128
+ capScope: "device",
28129
+ addonId: null,
28130
+ access: "create"
28131
+ },
27524
28132
  "pipelineAnalytics.proposeRetrainAnnotations": {
27525
28133
  capName: "pipeline-analytics",
27526
28134
  capScope: "device",
@@ -27551,7 +28159,7 @@ Object.freeze({
27551
28159
  addonId: null,
27552
28160
  access: "create"
27553
28161
  },
27554
- "pipelineAnalytics.relocateMedia": {
28162
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27555
28163
  capName: "pipeline-analytics",
27556
28164
  capScope: "device",
27557
28165
  addonId: null,
@@ -27563,6 +28171,12 @@ Object.freeze({
27563
28171
  addonId: null,
27564
28172
  access: "create"
27565
28173
  },
28174
+ "pipelineAnalytics.resumeForStorageMigration": {
28175
+ capName: "pipeline-analytics",
28176
+ capScope: "device",
28177
+ addonId: null,
28178
+ access: "create"
28179
+ },
27566
28180
  "pipelineAnalytics.saveRetrainAnnotations": {
27567
28181
  capName: "pipeline-analytics",
27568
28182
  capScope: "device",
@@ -27587,6 +28201,12 @@ Object.freeze({
27587
28201
  addonId: null,
27588
28202
  access: "create"
27589
28203
  },
28204
+ "pipelineAnalytics.startStorageMigrationMove": {
28205
+ capName: "pipeline-analytics",
28206
+ capScope: "device",
28207
+ addonId: null,
28208
+ access: "create"
28209
+ },
27590
28210
  "pipelineAnalytics.wipeAllAnalytics": {
27591
28211
  capName: "pipeline-analytics",
27592
28212
  capScope: "device",
@@ -27953,6 +28573,12 @@ Object.freeze({
27953
28573
  addonId: null,
27954
28574
  access: "view"
27955
28575
  },
28576
+ "pipelineOrchestrator.pauseForStorageMigration": {
28577
+ capName: "pipeline-orchestrator",
28578
+ capScope: "system",
28579
+ addonId: null,
28580
+ access: "create"
28581
+ },
27956
28582
  "pipelineOrchestrator.rebalance": {
27957
28583
  capName: "pipeline-orchestrator",
27958
28584
  capScope: "system",
@@ -27977,6 +28603,12 @@ Object.freeze({
27977
28603
  addonId: null,
27978
28604
  access: "view"
27979
28605
  },
28606
+ "pipelineOrchestrator.resumeForStorageMigration": {
28607
+ capName: "pipeline-orchestrator",
28608
+ capScope: "system",
28609
+ addonId: null,
28610
+ access: "create"
28611
+ },
27980
28612
  "pipelineOrchestrator.saveTemplate": {
27981
28613
  capName: "pipeline-orchestrator",
27982
28614
  capScope: "system",
@@ -28373,7 +29005,13 @@ Object.freeze({
28373
29005
  addonId: null,
28374
29006
  access: "create"
28375
29007
  },
28376
- "recording.cancelRelocate": {
29008
+ "recording.cancelRelocateJob": {
29009
+ capName: "recording",
29010
+ capScope: "system",
29011
+ addonId: null,
29012
+ access: "create"
29013
+ },
29014
+ "recording.cancelStorageMigrationMove": {
28377
29015
  capName: "recording",
28378
29016
  capScope: "system",
28379
29017
  addonId: null,
@@ -28409,7 +29047,7 @@ Object.freeze({
28409
29047
  addonId: null,
28410
29048
  access: "view"
28411
29049
  },
28412
- "recording.getRelocateStatus": {
29050
+ "recording.getStorageMigrationMoveStatus": {
28413
29051
  capName: "recording",
28414
29052
  capScope: "system",
28415
29053
  addonId: null,
@@ -28427,12 +29065,30 @@ Object.freeze({
28427
29065
  addonId: null,
28428
29066
  access: "view"
28429
29067
  },
29068
+ "recording.listRelocateJobs": {
29069
+ capName: "recording",
29070
+ capScope: "system",
29071
+ addonId: null,
29072
+ access: "view"
29073
+ },
28430
29074
  "recording.locateSegment": {
28431
29075
  capName: "recording",
28432
29076
  capScope: "system",
28433
29077
  addonId: null,
28434
29078
  access: "view"
28435
29079
  },
29080
+ "recording.pauseForStorageMigration": {
29081
+ capName: "recording",
29082
+ capScope: "system",
29083
+ addonId: null,
29084
+ access: "create"
29085
+ },
29086
+ "recording.planStorageRebalance": {
29087
+ capName: "recording",
29088
+ capScope: "system",
29089
+ addonId: null,
29090
+ access: "view"
29091
+ },
28436
29092
  "recording.pruneFootage": {
28437
29093
  capName: "recording",
28438
29094
  capScope: "system",
@@ -28451,6 +29107,12 @@ Object.freeze({
28451
29107
  addonId: null,
28452
29108
  access: "view"
28453
29109
  },
29110
+ "recording.refreshStorageLocationsForMigration": {
29111
+ capName: "recording",
29112
+ capScope: "system",
29113
+ addonId: null,
29114
+ access: "create"
29115
+ },
28454
29116
  "recording.relocateFootage": {
28455
29117
  capName: "recording",
28456
29118
  capScope: "system",
@@ -28475,44 +29137,68 @@ Object.freeze({
28475
29137
  addonId: null,
28476
29138
  access: "create"
28477
29139
  },
29140
+ "recording.resumeForStorageMigration": {
29141
+ capName: "recording",
29142
+ capScope: "system",
29143
+ addonId: null,
29144
+ access: "create"
29145
+ },
28478
29146
  "recording.setDeviceConfig": {
28479
29147
  capName: "recording",
28480
29148
  capScope: "system",
28481
29149
  addonId: null,
28482
29150
  access: "create"
28483
29151
  },
29152
+ "recording.startStorageMigrationMove": {
29153
+ capName: "recording",
29154
+ capScope: "system",
29155
+ addonId: null,
29156
+ access: "create"
29157
+ },
29158
+ "recording.startStorageRebalance": {
29159
+ capName: "recording",
29160
+ capScope: "system",
29161
+ addonId: null,
29162
+ access: "create"
29163
+ },
28484
29164
  "recordingExport.cancelExport": {
28485
- capName: "recordingExport",
29165
+ capName: "recording-export",
28486
29166
  capScope: "system",
28487
29167
  addonId: null,
28488
29168
  access: "create"
28489
29169
  },
28490
29170
  "recordingExport.createExport": {
28491
- capName: "recordingExport",
29171
+ capName: "recording-export",
28492
29172
  capScope: "system",
28493
29173
  addonId: null,
28494
29174
  access: "create"
28495
29175
  },
28496
29176
  "recordingExport.deleteExport": {
28497
- capName: "recordingExport",
29177
+ capName: "recording-export",
28498
29178
  capScope: "system",
28499
29179
  addonId: null,
28500
29180
  access: "delete"
28501
29181
  },
28502
29182
  "recordingExport.getDownloadUrl": {
28503
- capName: "recordingExport",
29183
+ capName: "recording-export",
28504
29184
  capScope: "system",
28505
29185
  addonId: null,
28506
29186
  access: "view"
28507
29187
  },
28508
29188
  "recordingExport.getExport": {
28509
- capName: "recordingExport",
29189
+ capName: "recording-export",
28510
29190
  capScope: "system",
28511
29191
  addonId: null,
28512
29192
  access: "view"
28513
29193
  },
28514
29194
  "recordingExport.listExports": {
28515
- capName: "recordingExport",
29195
+ capName: "recording-export",
29196
+ capScope: "system",
29197
+ addonId: null,
29198
+ access: "view"
29199
+ },
29200
+ "recordingExport.readExportBytes": {
29201
+ capName: "recording-export",
28516
29202
  capScope: "system",
28517
29203
  addonId: null,
28518
29204
  access: "view"
@@ -28871,6 +29557,30 @@ Object.freeze({
28871
29557
  addonId: null,
28872
29558
  access: "view"
28873
29559
  },
29560
+ "storageMigration.cancel": {
29561
+ capName: "storage-migration",
29562
+ capScope: "system",
29563
+ addonId: null,
29564
+ access: "create"
29565
+ },
29566
+ "storageMigration.plan": {
29567
+ capName: "storage-migration",
29568
+ capScope: "system",
29569
+ addonId: null,
29570
+ access: "view"
29571
+ },
29572
+ "storageMigration.start": {
29573
+ capName: "storage-migration",
29574
+ capScope: "system",
29575
+ addonId: null,
29576
+ access: "create"
29577
+ },
29578
+ "storageMigration.status": {
29579
+ capName: "storage-migration",
29580
+ capScope: "system",
29581
+ addonId: null,
29582
+ access: "view"
29583
+ },
28874
29584
  "storageProvider.abortUpload": {
28875
29585
  capName: "storage-provider",
28876
29586
  capScope: "system",
@@ -29249,12 +29959,42 @@ Object.freeze({
29249
29959
  addonId: null,
29250
29960
  access: "create"
29251
29961
  },
29962
+ "terminalSession.adoptLegacyMonitor": {
29963
+ capName: "terminal-session",
29964
+ capScope: "system",
29965
+ addonId: null,
29966
+ access: "create"
29967
+ },
29252
29968
  "terminalSession.close": {
29253
29969
  capName: "terminal-session",
29254
29970
  capScope: "system",
29255
29971
  addonId: null,
29256
29972
  access: "create"
29257
29973
  },
29974
+ "terminalSession.createInstance": {
29975
+ capName: "terminal-session",
29976
+ capScope: "system",
29977
+ addonId: null,
29978
+ access: "create"
29979
+ },
29980
+ "terminalSession.deleteInstance": {
29981
+ capName: "terminal-session",
29982
+ capScope: "system",
29983
+ addonId: null,
29984
+ access: "delete"
29985
+ },
29986
+ "terminalSession.listInstances": {
29987
+ capName: "terminal-session",
29988
+ capScope: "system",
29989
+ addonId: null,
29990
+ access: "view"
29991
+ },
29992
+ "terminalSession.listLegacyCameras": {
29993
+ capName: "terminal-session",
29994
+ capScope: "system",
29995
+ addonId: null,
29996
+ access: "view"
29997
+ },
29258
29998
  "terminalSession.listProfiles": {
29259
29999
  capName: "terminal-session",
29260
30000
  capScope: "system",
@@ -29285,6 +30025,12 @@ Object.freeze({
29285
30025
  addonId: null,
29286
30026
  access: "create"
29287
30027
  },
30028
+ "terminalSession.setInstanceEnabled": {
30029
+ capName: "terminal-session",
30030
+ capScope: "system",
30031
+ addonId: null,
30032
+ access: "create"
30033
+ },
29288
30034
  "terminalSession.writeInput": {
29289
30035
  capName: "terminal-session",
29290
30036
  capScope: "system",
@@ -29829,6 +30575,104 @@ var FramerateField = number().int().min(1).max(60);
29829
30575
  var TargetsField = array(NcRuleTargetSchema).min(1);
29830
30576
  var PriorityField = number().int().min(1).max(5);
29831
30577
  /**
30578
+ * Explicit override of the DENSE sampling cadence, seconds.
30579
+ *
30580
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30581
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30582
+ * made that same base 3 s and rendered a person pass as two frames.)
30583
+ *
30584
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30585
+ * `denseCadenceSec` and played at `framerate` occupies
30586
+ *
30587
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30588
+ *
30589
+ * 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.
30590
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30591
+ * and therefore the length of a quiet night, does not move.
30592
+ *
30593
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30594
+ * the recording has them returns the same frames, requested twice. Must be
30595
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30596
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30597
+ * rather than letting the export cap reject the render hours after the window.
30598
+ */
30599
+ var DenseCadenceSecField = number().min(.1).max(3600);
30600
+ /**
30601
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30602
+ *
30603
+ * The operator-facing form of the arithmetic above: instead of solving for a
30604
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30605
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30606
+ * that range every ~583 ms.
30607
+ *
30608
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30609
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30610
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30611
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30612
+ * schema change and are the tracked follow-up.
30613
+ *
30614
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30615
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30616
+ * by real footage, never met by duplicating frames into motion that never
30617
+ * happened.
30618
+ */
30619
+ var MinDwellSecField = number().min(0).max(60);
30620
+ /**
30621
+ * Caption burned into the notification's preview frame.
30622
+ *
30623
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30624
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30625
+ * templating dialect for one field would be a second thing to explain.
30626
+ *
30627
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30628
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30629
+ * the reason this is not `.min(1)`.
30630
+ */
30631
+ var PreviewTextField = string().max(200);
30632
+ /**
30633
+ * Whether the notification's preview is a STILL or a short animation.
30634
+ *
30635
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30636
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30637
+ * night reads better as three seconds of motion than as one frame of it. Both
30638
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30639
+ * simply applies it to a dozen frames sampled across the render and assembles
30640
+ * them.
30641
+ *
30642
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30643
+ * seeks and a palette pass, and no rule that never asked for one should start
30644
+ * paying that on the deploy that shipped it.
30645
+ *
30646
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30647
+ */
30648
+ var PreviewModeField = _enum(["image", "gif"]);
30649
+ /**
30650
+ * Which detection classes the notification reports counts for.
30651
+ *
30652
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30653
+ * plan — no second query — aggregated per class. Absent or empty means "every
30654
+ * class the window actually contained", which is what an operator who never
30655
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30656
+ * counts cars all night).
30657
+ *
30658
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30659
+ * …). An unknown name simply never matches and reports nothing — it is not an
30660
+ * error, because a rule may legitimately name a class this camera's model does
30661
+ * not emit.
30662
+ *
30663
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30664
+ * - `{{detections}}` — total over the reported classes
30665
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30666
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30667
+ * one per class, `count_` + the class name
30668
+ *
30669
+ * With NO custom body template the summary is appended to the derived body, and
30670
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30671
+ * reads. With a custom template the operator owns every word — nothing is
30672
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30673
+ */
30674
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30675
+ /**
29832
30676
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29833
30677
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29834
30678
  * here (see the ownership note above).
@@ -29848,9 +30692,30 @@ var TimelapseRuleInputSchema = object({
29848
30692
  cadenceSec: CadenceSecField.default(15),
29849
30693
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29850
30694
  framerate: FramerateField.default(10),
30695
+ /**
30696
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30697
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30698
+ * field gets.
30699
+ */
30700
+ denseCadenceSec: DenseCadenceSecField.optional(),
30701
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30702
+ minDwellSec: MinDwellSecField.optional(),
29851
30703
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29852
30704
  targets: TargetsField,
29853
30705
  template: TimelapseTemplateSchema.optional(),
30706
+ /**
30707
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30708
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30709
+ *
30710
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30711
+ * the notification's title/body, and clearing it (`template: null`) must not
30712
+ * silently clear the caption too.
30713
+ */
30714
+ previewText: PreviewTextField.optional(),
30715
+ /** Still or animation — see {@link PreviewModeField}. */
30716
+ previewMode: PreviewModeField.default("image"),
30717
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30718
+ reportClasses: ReportClassesField.optional(),
29854
30719
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29855
30720
  priority: PriorityField.default(3)
29856
30721
  });
@@ -29861,8 +30726,13 @@ object({
29861
30726
  schedule: NcScheduleSchema.optional(),
29862
30727
  cadenceSec: CadenceSecField.optional(),
29863
30728
  framerate: FramerateField.optional(),
30729
+ denseCadenceSec: DenseCadenceSecField.optional(),
30730
+ minDwellSec: MinDwellSecField.optional(),
29864
30731
  targets: TargetsField.optional(),
29865
30732
  template: TimelapseTemplateSchema.nullable().optional(),
30733
+ previewText: PreviewTextField.optional(),
30734
+ previewMode: PreviewModeField.optional(),
30735
+ reportClasses: ReportClassesField.optional(),
29866
30736
  priority: PriorityField.optional()
29867
30737
  });
29868
30738
  TimelapseRuleInputSchema.extend({
@@ -29874,10 +30744,28 @@ TimelapseRuleInputSchema.extend({
29874
30744
  */
29875
30745
  ownerUserId: string().optional(),
29876
30746
  /**
29877
- * Epoch-ms of the last successful generation the 1-hour re-generation
29878
- * guard's durable state (predecessor parity). Absent = never generated.
30747
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30748
+ * rule. What a UI shows, and the compatibility floor for
30749
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29879
30750
  */
29880
30751
  lastGeneratedAt: number().optional(),
30752
+ /**
30753
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30754
+ * re-generation guard's real durable state.
30755
+ *
30756
+ * One rule covers several cameras and each renders its own video, so a rule
30757
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30758
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30759
+ * already done — and B's night is gone for good, because the window will not
30760
+ * come back.
30761
+ *
30762
+ * ADDITIVE, so the migration is free: a row written before this field simply
30763
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30764
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30765
+ * "never generated" would re-render and re-notify every camera of every rule
30766
+ * once, on the deploy that shipped the map.
30767
+ */
30768
+ generatedByDevice: record(string(), number()).optional(),
29881
30769
  /** userId of the caller who created the rule (server-stamped). */
29882
30770
  createdBy: string(),
29883
30771
  createdAt: number(),