@camstack/addon-mqtt-broker 1.2.13 → 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
  *
@@ -7581,7 +7604,15 @@ var RecordingConfigSchema = object({
7581
7604
  * Each completed/failed run also lands one durable ops-log row on its owning
7582
7605
  * addon surface.
7583
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.
7613
+ */
7584
7614
  var RelocateJobStateSchema = _enum([
7615
+ "queued",
7585
7616
  "running",
7586
7617
  "done",
7587
7618
  "failed",
@@ -7616,6 +7647,15 @@ var RelocateFootageInputSchema = object({
7616
7647
  /** Limits relocation to the logical profile class. Omit only for the
7617
7648
  * pre-orchestration compatibility path. */
7618
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(),
7619
7659
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7620
7660
  * never allowed to starve live writers. */
7621
7661
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7751,6 +7791,21 @@ var StorageLocationSchema = object({
7751
7791
  nodeId: string().optional(),
7752
7792
  isDefault: boolean().default(false),
7753
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(),
7754
7809
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7755
7810
  * for node-local locations it can reach) — never persisted, absent when the
7756
7811
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12102,7 +12157,8 @@ method(object({
12102
12157
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12103
12158
  /**
12104
12159
  * filesystem-browse — per-node capability for browsing the node's local
12105
- * 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
12106
12162
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12107
12163
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12108
12164
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13934,6 +13990,13 @@ var MaskGridDimsSchema = object({
13934
13990
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13935
13991
  * this one field keeps the schema additive — a rule still declares exactly
13936
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`.
13937
14000
  */
13938
14001
  var NcDeliverySchema = _enum([
13939
14002
  "immediate",
@@ -13948,15 +14011,32 @@ var NcDeliverySchema = _enum([
13948
14011
  * depend on a provider's raw event name or payload shape.
13949
14012
  */
13950
14013
  var NcSystemEventKindSchema = _enum([
13951
- "camera-online",
13952
- "camera-offline",
14014
+ "device-online",
14015
+ "device-offline",
14016
+ "device-disabled",
14017
+ "device-enabled",
13953
14018
  "stream-online",
13954
14019
  "stream-offline",
13955
14020
  "node-online",
13956
14021
  "node-offline",
13957
14022
  "addon-update-available",
13958
- "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"
13959
14038
  ]);
14039
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13960
14040
  /**
13961
14041
  * One coherent system-event condition. `kinds` is the required opt-in safety
13962
14042
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13965,6 +14045,18 @@ var NcSystemEventKindSchema = _enum([
13965
14045
  var NcSystemEventConditionSchema = object({
13966
14046
  kinds: array(NcSystemEventKindSchema).min(1),
13967
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(),
13968
14060
  nodeIds: array(string().min(1)).min(1).optional(),
13969
14061
  packageNames: array(string().min(1)).min(1).optional()
13970
14062
  });
@@ -14015,6 +14107,47 @@ var NcOccupancyConditionSchema = object({
14015
14107
  sustainSeconds: number().int().min(0).max(3600).default(15)
14016
14108
  });
14017
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
+ /**
14018
14151
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14019
14152
  *
14020
14153
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14287,7 +14420,33 @@ var NcConditionsSchema = object({
14287
14420
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14288
14421
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14289
14422
  */
14290
- 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()
14291
14450
  });
14292
14451
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14293
14452
  var NcRuleTargetSchema = object({
@@ -14401,6 +14560,73 @@ var NcThrottleSchema = object({
14401
14560
  */
14402
14561
  granularity: NcThrottleGranularitySchema.optional()
14403
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
+ });
14404
14630
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14405
14631
  var NcRuleInputSchema = object({
14406
14632
  name: string().min(1).max(200),
@@ -14461,7 +14687,13 @@ var NcRuleInputSchema = object({
14461
14687
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14462
14688
  * shape as every other actuation.
14463
14689
  */
14464
- 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()
14465
14697
  });
14466
14698
  /**
14467
14699
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14472,7 +14704,37 @@ var NcRuleInputSchema = object({
14472
14704
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14473
14705
  * `updateRule` patch.
14474
14706
  */
14475
- 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
+ });
14476
14738
  /** A persisted rule. */
14477
14739
  var NcRuleSchema = NcRuleInputSchema.extend({
14478
14740
  id: string(),
@@ -14773,6 +15035,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14773
15035
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14774
15036
  * copy would lie the first time a rule is disabled.
14775
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
+ });
14776
15057
  var NcAlarmModeCoverageSchema = object({
14777
15058
  mode: AlarmArmModeSchema,
14778
15059
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14780,7 +15061,18 @@ var NcAlarmModeCoverageSchema = object({
14780
15061
  /** At least one covering rule has no device scope, so the mode covers all. */
14781
15062
  allDevices: boolean(),
14782
15063
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14783
- 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([])
14784
15076
  });
14785
15077
  var NcAlarmConfigSchema = object({
14786
15078
  /**
@@ -17579,9 +17871,16 @@ var CameraStatusSchema = object({
17579
17871
  audio: CameraAudioStatusSchema.nullable(),
17580
17872
  recording: CameraRecordingStatusSchema.nullable(),
17581
17873
  /**
17582
- * Per-camera function switches an OPERATOR has turned off
17874
+ * Per-camera functions an OPERATOR has turned off
17583
17875
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17584
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
+ *
17585
17884
  * This is the difference between DISABLED and BROKEN. A camera whose
17586
17885
  * `detection` block reports zero fps and whose `switchedOff` contains
17587
17886
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -23090,7 +23389,19 @@ var RecordingManifestSchema = object({
23090
23389
  * profiles/subtrees/locations on this node). */
23091
23390
  var RecordingDeviceUsageSchema = object({
23092
23391
  deviceId: number(),
23093
- 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()
23094
23405
  });
23095
23406
  /** Recording storage usage + capacity for one storage location. */
23096
23407
  var RecordingLocationUsageSchema = object({
@@ -23118,6 +23429,57 @@ var RecordingStorageUsageSchema = object({
23118
23429
  locations: array(RecordingLocationUsageSchema)
23119
23430
  });
23120
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
+ /**
23121
23483
  * Result of locating footage at a wall-clock instant for one device/profile.
23122
23484
  * `segment` carries the covering segment's window; `gap` reports the forward
23123
23485
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23280,9 +23642,24 @@ method(object({
23280
23642
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23281
23643
  kind: "mutation",
23282
23644
  auth: "admin"
23645
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23646
+ kind: "mutation",
23647
+ auth: "admin"
23648
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
23649
+ kind: "query",
23650
+ auth: "admin"
23651
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23652
+ kind: "mutation",
23653
+ auth: "admin"
23654
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23655
+ kind: "query",
23656
+ auth: "admin"
23657
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23658
+ kind: "mutation",
23659
+ auth: "admin"
23283
23660
  });
23284
23661
  /**
23285
- * `recordingExport` cap — render a footage time range into a single downloadable
23662
+ * `recording-export` cap — render a footage time range into a single downloadable
23286
23663
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23287
23664
  * bounded lifetime with a durable history, auto-expiry, and optional
23288
23665
  * delete-after-download.
@@ -23297,10 +23674,42 @@ method(object({
23297
23674
  */
23298
23675
  /** Playback-speed multiplier for the render (1 = realtime). */
23299
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
+ });
23300
23701
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23301
23702
  var ExportTimelapseSchema = object({
23302
23703
  everyMs: number().int().positive(),
23303
- 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
+ });
23304
23713
  });
23305
23714
  /**
23306
23715
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23358,6 +23767,19 @@ var ExportDownloadSchema = object({
23358
23767
  url: string(),
23359
23768
  endpoints: array(string())
23360
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
+ });
23361
23783
  method(object({
23362
23784
  deviceId: number(),
23363
23785
  profile: string(),
@@ -23382,6 +23804,9 @@ method(object({
23382
23804
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23383
23805
  kind: "query",
23384
23806
  auth: "protected"
23807
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23808
+ kind: "query",
23809
+ auth: "protected"
23385
23810
  });
23386
23811
  /**
23387
23812
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -28575,6 +29000,12 @@ Object.freeze({
28575
29000
  addonId: null,
28576
29001
  access: "create"
28577
29002
  },
29003
+ "recording.cancelRelocateJob": {
29004
+ capName: "recording",
29005
+ capScope: "system",
29006
+ addonId: null,
29007
+ access: "create"
29008
+ },
28578
29009
  "recording.cancelStorageMigrationMove": {
28579
29010
  capName: "recording",
28580
29011
  capScope: "system",
@@ -28629,6 +29060,12 @@ Object.freeze({
28629
29060
  addonId: null,
28630
29061
  access: "view"
28631
29062
  },
29063
+ "recording.listRelocateJobs": {
29064
+ capName: "recording",
29065
+ capScope: "system",
29066
+ addonId: null,
29067
+ access: "view"
29068
+ },
28632
29069
  "recording.locateSegment": {
28633
29070
  capName: "recording",
28634
29071
  capScope: "system",
@@ -28641,6 +29078,12 @@ Object.freeze({
28641
29078
  addonId: null,
28642
29079
  access: "create"
28643
29080
  },
29081
+ "recording.planStorageRebalance": {
29082
+ capName: "recording",
29083
+ capScope: "system",
29084
+ addonId: null,
29085
+ access: "view"
29086
+ },
28644
29087
  "recording.pruneFootage": {
28645
29088
  capName: "recording",
28646
29089
  capScope: "system",
@@ -28665,6 +29108,12 @@ Object.freeze({
28665
29108
  addonId: null,
28666
29109
  access: "create"
28667
29110
  },
29111
+ "recording.relocateFootage": {
29112
+ capName: "recording",
29113
+ capScope: "system",
29114
+ addonId: null,
29115
+ access: "create"
29116
+ },
28668
29117
  "recording.renderClip": {
28669
29118
  capName: "recording",
28670
29119
  capScope: "system",
@@ -28701,38 +29150,50 @@ Object.freeze({
28701
29150
  addonId: null,
28702
29151
  access: "create"
28703
29152
  },
29153
+ "recording.startStorageRebalance": {
29154
+ capName: "recording",
29155
+ capScope: "system",
29156
+ addonId: null,
29157
+ access: "create"
29158
+ },
28704
29159
  "recordingExport.cancelExport": {
28705
- capName: "recordingExport",
29160
+ capName: "recording-export",
28706
29161
  capScope: "system",
28707
29162
  addonId: null,
28708
29163
  access: "create"
28709
29164
  },
28710
29165
  "recordingExport.createExport": {
28711
- capName: "recordingExport",
29166
+ capName: "recording-export",
28712
29167
  capScope: "system",
28713
29168
  addonId: null,
28714
29169
  access: "create"
28715
29170
  },
28716
29171
  "recordingExport.deleteExport": {
28717
- capName: "recordingExport",
29172
+ capName: "recording-export",
28718
29173
  capScope: "system",
28719
29174
  addonId: null,
28720
29175
  access: "delete"
28721
29176
  },
28722
29177
  "recordingExport.getDownloadUrl": {
28723
- capName: "recordingExport",
29178
+ capName: "recording-export",
28724
29179
  capScope: "system",
28725
29180
  addonId: null,
28726
29181
  access: "view"
28727
29182
  },
28728
29183
  "recordingExport.getExport": {
28729
- capName: "recordingExport",
29184
+ capName: "recording-export",
28730
29185
  capScope: "system",
28731
29186
  addonId: null,
28732
29187
  access: "view"
28733
29188
  },
28734
29189
  "recordingExport.listExports": {
28735
- capName: "recordingExport",
29190
+ capName: "recording-export",
29191
+ capScope: "system",
29192
+ addonId: null,
29193
+ access: "view"
29194
+ },
29195
+ "recordingExport.readExportBytes": {
29196
+ capName: "recording-export",
28736
29197
  capScope: "system",
28737
29198
  addonId: null,
28738
29199
  access: "view"
@@ -30109,6 +30570,104 @@ var FramerateField = number().int().min(1).max(60);
30109
30570
  var TargetsField = array(NcRuleTargetSchema).min(1);
30110
30571
  var PriorityField = number().int().min(1).max(5);
30111
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
+ /**
30112
30671
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
30113
30672
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
30114
30673
  * here (see the ownership note above).
@@ -30128,9 +30687,30 @@ var TimelapseRuleInputSchema = object({
30128
30687
  cadenceSec: CadenceSecField.default(15),
30129
30688
  /** Output frames per second of the assembled mp4 (predecessor parity). */
30130
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(),
30131
30698
  /** `notification-output` targets the finished video/thumbnail is sent to. */
30132
30699
  targets: TargetsField,
30133
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(),
30134
30714
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
30135
30715
  priority: PriorityField.default(3)
30136
30716
  });
@@ -30141,8 +30721,13 @@ object({
30141
30721
  schedule: NcScheduleSchema.optional(),
30142
30722
  cadenceSec: CadenceSecField.optional(),
30143
30723
  framerate: FramerateField.optional(),
30724
+ denseCadenceSec: DenseCadenceSecField.optional(),
30725
+ minDwellSec: MinDwellSecField.optional(),
30144
30726
  targets: TargetsField.optional(),
30145
30727
  template: TimelapseTemplateSchema.nullable().optional(),
30728
+ previewText: PreviewTextField.optional(),
30729
+ previewMode: PreviewModeField.optional(),
30730
+ reportClasses: ReportClassesField.optional(),
30146
30731
  priority: PriorityField.optional()
30147
30732
  });
30148
30733
  TimelapseRuleInputSchema.extend({
@@ -30154,10 +30739,28 @@ TimelapseRuleInputSchema.extend({
30154
30739
  */
30155
30740
  ownerUserId: string().optional(),
30156
30741
  /**
30157
- * Epoch-ms of the last successful generation the 1-hour re-generation
30158
- * 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.
30159
30745
  */
30160
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(),
30161
30764
  /** userId of the caller who created the rule (server-stamped). */
30162
30765
  createdBy: string(),
30163
30766
  createdAt: number(),