@camstack/addon-provider-homeassistant 1.2.24 → 1.2.25

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.
@@ -7323,8 +7323,31 @@ var AdoptionJobSchema = object({
7323
7323
  error: string().nullable()
7324
7324
  });
7325
7325
  /**
7326
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7327
- * pipeline functions an operator thinks in terms of.
7326
+ * Per-camera FUNCTION SWITCHES.
7327
+ *
7328
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7329
+ *
7330
+ * This file shipped as "the one coherent on/off surface over the pipeline
7331
+ * functions an operator thinks in terms of". The operator's verdict on
7332
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7333
+ * every function already had a settings page of its own, and a second place to
7334
+ * turn it off is a second place to look. Each switch is going back to its own
7335
+ * component's original options — detection to the detection-pipeline wrapper
7336
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7337
+ * (which was always first-class; the switch was a veneer over
7338
+ * `recording.setDeviceConfig`), notifications to a notification-center
7339
+ * per-device setting, the two camera planes to their own components.
7340
+ *
7341
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7342
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7343
+ * straight from the authorities with no group in the middle. That rule was
7344
+ * never about a control panel.
7345
+ *
7346
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7347
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7348
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7349
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7350
+ * stop; nothing new may be built on it.
7328
7351
  *
7329
7352
  * ## This file adds no state
7330
7353
  *
@@ -7675,7 +7698,15 @@ var RecordingConfigSchema = object({
7675
7698
  * Each completed/failed run also lands one durable ops-log row on its owning
7676
7699
  * addon surface.
7677
7700
  */
7701
+ /**
7702
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7703
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7704
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7705
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7706
+ * runs at all.
7707
+ */
7678
7708
  var RelocateJobStateSchema = _enum([
7709
+ "queued",
7679
7710
  "running",
7680
7711
  "done",
7681
7712
  "failed",
@@ -7710,6 +7741,15 @@ var RelocateFootageInputSchema = object({
7710
7741
  /** Limits relocation to the logical profile class. Omit only for the
7711
7742
  * pre-orchestration compatibility path. */
7712
7743
  footageClass: RelocateFootageClassSchema.optional(),
7744
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7745
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7746
+ * unit is a (camera, profile) pile, not a disk. */
7747
+ deviceId: number().int().optional(),
7748
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7749
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7750
+ * placement plan assigns those two independently, so a rebalance that could
7751
+ * only say "recordings" would move footage the plan never asked to move. */
7752
+ profiles: array(string()).optional(),
7713
7753
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7714
7754
  * never allowed to starve live writers. */
7715
7755
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7845,6 +7885,21 @@ var StorageLocationSchema = object({
7845
7885
  nodeId: string().optional(),
7846
7886
  isDefault: boolean().default(false),
7847
7887
  isSystem: boolean().default(false),
7888
+ /**
7889
+ * Operator opt-in: whether consumers that BALANCE across several locations
7890
+ * of a type may write here. Recordings reads it today; event media and
7891
+ * backups are the next consumers, which is why the flag lives on the
7892
+ * location rather than in any one addon's store — nothing has to be
7893
+ * extended to add the next consumer.
7894
+ *
7895
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7896
+ * flag existed reads back with no flag and keeps working exactly as before;
7897
+ * that is the whole compat story, and it is why no migration ships with it.
7898
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7899
+ * disk must not silently start writing to it); the default of a type is
7900
+ * always stamped `true`.
7901
+ */
7902
+ enabled: boolean().optional(),
7848
7903
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7849
7904
  * for node-local locations it can reach) — never persisted, absent when the
7850
7905
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12552,7 +12607,8 @@ method(object({
12552
12607
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12553
12608
  /**
12554
12609
  * filesystem-browse — per-node capability for browsing the node's local
12555
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12610
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12611
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12556
12612
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12557
12613
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12558
12614
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14407,6 +14463,13 @@ var MaskGridDimsSchema = object({
14407
14463
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14408
14464
  * this one field keeps the schema additive — a rule still declares exactly
14409
14465
  * one trigger.
14466
+ *
14467
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14468
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14469
+ * mirror.ts` fails the build on a member the app cannot render) and every
14470
+ * member costs a release train. A sustained-sound rule is therefore an
14471
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14472
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14410
14473
  */
14411
14474
  var NcDeliverySchema = _enum([
14412
14475
  "immediate",
@@ -14421,15 +14484,32 @@ var NcDeliverySchema = _enum([
14421
14484
  * depend on a provider's raw event name or payload shape.
14422
14485
  */
14423
14486
  var NcSystemEventKindSchema = _enum([
14424
- "camera-online",
14425
- "camera-offline",
14487
+ "device-online",
14488
+ "device-offline",
14489
+ "device-disabled",
14490
+ "device-enabled",
14426
14491
  "stream-online",
14427
14492
  "stream-offline",
14428
14493
  "node-online",
14429
14494
  "node-offline",
14430
14495
  "addon-update-available",
14431
- "server-update-available"
14496
+ "server-update-available",
14497
+ "alarm-triggered",
14498
+ "alarm-armed",
14499
+ "alarm-disarmed",
14500
+ "camera-online",
14501
+ "camera-offline",
14502
+ "camera-disabled",
14503
+ "camera-enabled"
14504
+ ]);
14505
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14506
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14507
+ "camera-online",
14508
+ "camera-offline",
14509
+ "camera-disabled",
14510
+ "camera-enabled"
14432
14511
  ]);
14512
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14433
14513
  /**
14434
14514
  * One coherent system-event condition. `kinds` is the required opt-in safety
14435
14515
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14438,6 +14518,18 @@ var NcSystemEventKindSchema = _enum([
14438
14518
  var NcSystemEventConditionSchema = object({
14439
14519
  kinds: array(NcSystemEventKindSchema).min(1),
14440
14520
  deviceIds: array(number().int()).min(1).optional(),
14521
+ /**
14522
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14523
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14524
+ * is what a liveness rule means when nobody said otherwise.
14525
+ *
14526
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14527
+ * one reason: the intake cannot know which devices this household cares
14528
+ * about, and a producer-side filter is one no operator can change. Fails
14529
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14530
+ * does not carry) matches no `deviceTypes` list.
14531
+ */
14532
+ deviceTypes: array(string().min(1)).min(1).optional(),
14441
14533
  nodeIds: array(string().min(1)).min(1).optional(),
14442
14534
  packageNames: array(string().min(1)).min(1).optional()
14443
14535
  });
@@ -14488,6 +14580,47 @@ var NcOccupancyConditionSchema = object({
14488
14580
  sustainSeconds: number().int().min(0).max(3600).default(15)
14489
14581
  });
14490
14582
  /**
14583
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14584
+ *
14585
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14586
+ * reference notifier uses, so an operator moving between them re-uses what
14587
+ * they already know): a rule matches when, over a sampling window of
14588
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14589
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14590
+ *
14591
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14592
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14593
+ * - `labels` — the classifier put at least one of these labels on it.
14594
+ *
14595
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14596
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14597
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14598
+ * is given** — a window in which every sample is trivially a hit would fire on
14599
+ * silence, so the engine refuses such a condition rather than notifying on
14600
+ * nothing (the schema cannot express "at least one of" without becoming a
14601
+ * ZodEffects the cap path would have to special-case).
14602
+ *
14603
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14604
+ * must be FULL before it can match — a window that has been open for two
14605
+ * seconds of its ten is 100% of nothing, and firing on it would make
14606
+ * `samplingSeconds` decorative.
14607
+ *
14608
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14609
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14610
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14611
+ * an operator who typed `dog` mean the same thing.
14612
+ */
14613
+ var NcAudioConditionSchema = object({
14614
+ /** Audio macro labels; absent = any sound (level-only rule). */
14615
+ labels: array(string().min(1)).min(1).optional(),
14616
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14617
+ dbThreshold: number().min(-96).max(0).optional(),
14618
+ /** Percentage of the window's samples that must be hits (1–100). */
14619
+ hitPercent: number().int().min(1).max(100).default(60),
14620
+ /** Length of the sampling window in seconds. */
14621
+ samplingSeconds: number().int().min(1).max(300).default(10)
14622
+ });
14623
+ /**
14491
14624
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14492
14625
  *
14493
14626
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14760,7 +14893,33 @@ var NcConditionsSchema = object({
14760
14893
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14761
14894
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14762
14895
  */
14763
- occupancy: NcOccupancyConditionSchema.optional()
14896
+ occupancy: NcOccupancyConditionSchema.optional(),
14897
+ /**
14898
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14899
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14900
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14901
+ * a window that is not full yet, neither filter given). See
14902
+ * {@link NcAudioCondition}.
14903
+ *
14904
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14905
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14906
+ * a detection, a track or a device event (the same fail-closed pairing
14907
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14908
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14909
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14910
+ * classified sample) stays exactly as it was for rules that already use it.
14911
+ *
14912
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14913
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14914
+ * (`camstack/src/data/notification-center.ts`, guarded by
14915
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14916
+ * condition fields it does not know when a rule is saved from the phone.
14917
+ * Publishing an editor for a condition the app cannot round-trip is how an
14918
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14919
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14920
+ * does an audio rule become authorable.
14921
+ */
14922
+ audio: NcAudioConditionSchema.optional()
14764
14923
  });
14765
14924
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14766
14925
  var NcRuleTargetSchema = object({
@@ -14874,6 +15033,73 @@ var NcThrottleSchema = object({
14874
15033
  */
14875
15034
  granularity: NcThrottleGranularitySchema.optional()
14876
15035
  });
15036
+ /**
15037
+ * How long the confirm gate may hold ONE notification, and how big the picture
15038
+ * it judges may be.
15039
+ *
15040
+ * The clamp is the product decision, not a coincidence of the model: p50 was
15041
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
15042
+ * arrives after the visitor has gone is not a notification. 448 px was enough
15043
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
15044
+ * tokens for pixels the model pools away.
15045
+ */
15046
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15047
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15048
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15049
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15050
+ var NcConfirmExpectSchema = object({
15051
+ op: _enum([
15052
+ ">=",
15053
+ ">",
15054
+ "<=",
15055
+ "<",
15056
+ "=="
15057
+ ]),
15058
+ count: number().int().min(0).max(1e3)
15059
+ });
15060
+ /**
15061
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15062
+ * to ship and says whether it agrees with the rule.
15063
+ *
15064
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15065
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15066
+ * on the operator's phone is not a verdict about this notification.
15067
+ *
15068
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15069
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15070
+ * the default and every fail-open is COUNTED, because a gate that always fails
15071
+ * open looks in the log exactly like a gate that works.
15072
+ *
15073
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15074
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15075
+ * production failures in one day), so the gate reads absent as the constant
15076
+ * above rather than trusting a parse it may never have seen.
15077
+ */
15078
+ var NcConfirmSchema = object({
15079
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15080
+ * same thing, and both mean "deliver exactly as before". */
15081
+ enabled: boolean().default(false),
15082
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15083
+ profileId: string().optional(),
15084
+ /**
15085
+ * The operator's question, in his own words. Absent = a question derived
15086
+ * from the rule (its class and its expectation).
15087
+ *
15088
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15089
+ * banners, signage and plates as instructions if you let them reach the
15090
+ * prompt — proven live — so the authoritative contract stays in the system
15091
+ * turn and only rule-authored words land here.
15092
+ */
15093
+ prompt: string().max(1e3).optional(),
15094
+ /** Fire only when the model's count satisfies this. Absent = the model's
15095
+ * own boolean verdict decides. */
15096
+ expect: NcConfirmExpectSchema.optional(),
15097
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15098
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15099
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15100
+ /** Longest edge the judged image is downscaled to before it is sent. */
15101
+ maxImagePx: number().int().min(64).max(2048).default(448)
15102
+ });
14877
15103
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14878
15104
  var NcRuleInputSchema = object({
14879
15105
  name: string().min(1).max(200),
@@ -14934,7 +15160,13 @@ var NcRuleInputSchema = object({
14934
15160
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14935
15161
  * shape as every other actuation.
14936
15162
  */
14937
- actions: NcRuleActionsSchema.optional()
15163
+ actions: NcRuleActionsSchema.optional(),
15164
+ /**
15165
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15166
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15167
+ * did, and absent is the only way to say that without a migration.
15168
+ */
15169
+ confirm: NcConfirmSchema.optional()
14938
15170
  });
14939
15171
  /**
14940
15172
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14945,7 +15177,37 @@ var NcRuleInputSchema = object({
14945
15177
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14946
15178
  * `updateRule` patch.
14947
15179
  */
14948
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15180
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15181
+ disabledTargetIds: array(string()).optional(),
15182
+ /**
15183
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15184
+ *
15185
+ * It makes the key optional to SUPPLY; the parse still materialises the
15186
+ * default when the key is absent. And `NcRuleStore.update` merges with
15187
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15188
+ * one — which made every partial edit destructive:
15189
+ *
15190
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15191
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15192
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15193
+ *
15194
+ * A rule scoped to one camera and one zone silently became a rule that
15195
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15196
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15197
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15198
+ * within a minute of a two-field patch.
15199
+ *
15200
+ * So every defaulted field is re-declared here WITHOUT its default. The
15201
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15202
+ * conditions remains a real instruction ("clear them") — and only the
15203
+ * absent key is now genuinely absent.
15204
+ */
15205
+ enabled: boolean().optional(),
15206
+ conditions: NcConditionsSchema.optional(),
15207
+ media: NcMediaPolicySchema.optional(),
15208
+ throttle: NcThrottleSchema.optional(),
15209
+ priority: number().int().min(1).max(5).optional()
15210
+ });
14949
15211
  /** A persisted rule. */
14950
15212
  var NcRuleSchema = NcRuleInputSchema.extend({
14951
15213
  id: string(),
@@ -15246,6 +15508,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15246
15508
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15247
15509
  * copy would lie the first time a rule is disabled.
15248
15510
  */
15511
+ /**
15512
+ * Why a device a mode NAMES is nonetheless not armed by it.
15513
+ *
15514
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15515
+ * per-camera notification switch the Notification Center already owns,
15516
+ * `detection-off` is the device's own detection binding being inactive, and
15517
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15518
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15519
+ * with the switches the operator actually used.
15520
+ */
15521
+ var NcAlarmSkipReasonSchema = _enum([
15522
+ "muted",
15523
+ "detection-off",
15524
+ "offline"
15525
+ ]);
15526
+ var NcAlarmSkippedDeviceSchema = object({
15527
+ deviceId: number().int(),
15528
+ reason: NcAlarmSkipReasonSchema
15529
+ });
15249
15530
  var NcAlarmModeCoverageSchema = object({
15250
15531
  mode: AlarmArmModeSchema,
15251
15532
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15253,7 +15534,18 @@ var NcAlarmModeCoverageSchema = object({
15253
15534
  /** At least one covering rule has no device scope, so the mode covers all. */
15254
15535
  allDevices: boolean(),
15255
15536
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15256
- deviceIds: array(number().int())
15537
+ deviceIds: array(number().int()),
15538
+ /**
15539
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15540
+ * excludes it.
15541
+ *
15542
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15543
+ * twelve makes it false in exactly the way nobody notices until an incident.
15544
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15545
+ * still parses as "nothing known to be skipped" rather than failing the whole
15546
+ * alarm tab.
15547
+ */
15548
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15257
15549
  });
15258
15550
  var NcAlarmConfigSchema = object({
15259
15551
  /**
@@ -18091,9 +18383,16 @@ var CameraStatusSchema = object({
18091
18383
  audio: CameraAudioStatusSchema.nullable(),
18092
18384
  recording: CameraRecordingStatusSchema.nullable(),
18093
18385
  /**
18094
- * Per-camera function switches an OPERATOR has turned off
18386
+ * Per-camera functions an OPERATOR has turned off
18095
18387
  * ([D61](../../../../docs/decisions/adr-0067.md)).
18096
18388
  *
18389
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18390
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18391
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18392
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18393
+ * The badge outlives the control panel: the panel was a convenience, this is
18394
+ * the difference between a camera being off and a camera being dead.
18395
+ *
18097
18396
  * This is the difference between DISABLED and BROKEN. A camera whose
18098
18397
  * `detection` block reports zero fps and whose `switchedOff` contains
18099
18398
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -24924,7 +25223,19 @@ var RecordingManifestSchema = object({
24924
25223
  * profiles/subtrees/locations on this node). */
24925
25224
  var RecordingDeviceUsageSchema = object({
24926
25225
  deviceId: number(),
24927
- usedBytes: number()
25226
+ usedBytes: number(),
25227
+ /**
25228
+ * Start of this camera's OLDEST indexed segment, across every profile and
25229
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25230
+ * only honest answer to "is retention actually holding?" per camera.
25231
+ *
25232
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25233
+ * predates this field omits it entirely, and a hub whose types carry the
25234
+ * field must keep validating that older provider's payload: the framework
25235
+ * (types) and the addon ship on different trains, and the addon is usually
25236
+ * the later of the two.
25237
+ */
25238
+ oldestMs: number().nullable().optional()
24928
25239
  });
24929
25240
  /** Recording storage usage + capacity for one storage location. */
24930
25241
  var RecordingLocationUsageSchema = object({
@@ -24952,6 +25263,57 @@ var RecordingStorageUsageSchema = object({
24952
25263
  locations: array(RecordingLocationUsageSchema)
24953
25264
  });
24954
25265
  /**
25266
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25267
+ *
25268
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25269
+ * is the operator asking for the EXISTING archive to be brought into line with
25270
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25271
+ * location, run FIFO behind the single-flight mover.
25272
+ *
25273
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25274
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25275
+ * (empty on the plan).
25276
+ */
25277
+ var RecordingRebalanceMoveSchema = object({
25278
+ deviceId: number(),
25279
+ profile: string(),
25280
+ fromLocationId: string(),
25281
+ toLocationId: string(),
25282
+ bytes: number(),
25283
+ files: number().int()
25284
+ });
25285
+ /** Why a pile that is out of place is staying there. Every refusal is
25286
+ * reported: a rebalance that silently drops a camera reads exactly like one
25287
+ * that had nothing to do. */
25288
+ var RecordingRebalanceSkipReasonSchema = _enum([
25289
+ "unassigned",
25290
+ "target-not-writable",
25291
+ "below-threshold",
25292
+ "no-headroom"
25293
+ ]);
25294
+ var RecordingRebalanceSkipSchema = object({
25295
+ deviceId: number(),
25296
+ profile: string(),
25297
+ fromLocationId: string(),
25298
+ /** The location the plan wants; null when the camera has no assignment. */
25299
+ toLocationId: string().nullable(),
25300
+ bytes: number(),
25301
+ reason: RecordingRebalanceSkipReasonSchema
25302
+ });
25303
+ var RecordingRebalancePlanSchema = object({
25304
+ moves: array(RecordingRebalanceMoveSchema),
25305
+ skipped: array(RecordingRebalanceSkipSchema),
25306
+ bytesToMove: number(),
25307
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25308
+ jobIds: array(string())
25309
+ });
25310
+ var RecordingRebalanceInputSchema = object({
25311
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25312
+ throttleMbps: number().min(1).max(1e3).optional(),
25313
+ /** Ignore piles smaller than this (default 1 GB). */
25314
+ minMoveGb: number().min(0).optional()
25315
+ });
25316
+ /**
24955
25317
  * Result of locating footage at a wall-clock instant for one device/profile.
24956
25318
  * `segment` carries the covering segment's window; `gap` reports the forward
24957
25319
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25114,9 +25476,24 @@ method(object({
25114
25476
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25115
25477
  kind: "mutation",
25116
25478
  auth: "admin"
25479
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25480
+ kind: "mutation",
25481
+ auth: "admin"
25482
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
25483
+ kind: "query",
25484
+ auth: "admin"
25485
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25486
+ kind: "mutation",
25487
+ auth: "admin"
25488
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25489
+ kind: "query",
25490
+ auth: "admin"
25491
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25492
+ kind: "mutation",
25493
+ auth: "admin"
25117
25494
  });
25118
25495
  /**
25119
- * `recordingExport` cap — render a footage time range into a single downloadable
25496
+ * `recording-export` cap — render a footage time range into a single downloadable
25120
25497
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25121
25498
  * bounded lifetime with a durable history, auto-expiry, and optional
25122
25499
  * delete-after-download.
@@ -25131,10 +25508,42 @@ method(object({
25131
25508
  */
25132
25509
  /** Playback-speed multiplier for the render (1 = realtime). */
25133
25510
  var ExportSpeedSchema = number().min(.25).max(32);
25511
+ /**
25512
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25513
+ *
25514
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25515
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25516
+ * playlist. Handing it absolute epochs would make every call site responsible
25517
+ * for the same subtraction, and the one that forgot would emit a filter that
25518
+ * selects nothing — silently, as a uniform timelapse.
25519
+ */
25520
+ var ExportDenseRangeSchema = object({
25521
+ fromSec: number().nonnegative(),
25522
+ toSec: number().nonnegative()
25523
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25524
+ /**
25525
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25526
+ * listed ranges and at the base `everyMs` everywhere else.
25527
+ *
25528
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25529
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25530
+ */
25531
+ var ExportDenseSchema = object({
25532
+ everyMs: number().int().positive(),
25533
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25534
+ });
25134
25535
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25135
25536
  var ExportTimelapseSchema = object({
25136
25537
  everyMs: number().int().positive(),
25137
- outputFps: number().int().min(1).max(60).optional()
25538
+ outputFps: number().int().min(1).max(60).optional(),
25539
+ /** Optional second, FASTER rate over the intervals that matter. */
25540
+ dense: ExportDenseSchema.optional()
25541
+ }).superRefine((v, ctx) => {
25542
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25543
+ code: ZodIssueCode.custom,
25544
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25545
+ path: ["dense", "everyMs"]
25546
+ });
25138
25547
  });
25139
25548
  /**
25140
25549
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25192,6 +25601,19 @@ var ExportDownloadSchema = object({
25192
25601
  url: string(),
25193
25602
  endpoints: array(string())
25194
25603
  });
25604
+ /**
25605
+ * A finished export's bytes, inline.
25606
+ *
25607
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25608
+ * against, so nobody has to infer it from the base64 length.
25609
+ */
25610
+ var ExportBytesSchema = object({
25611
+ base64: string(),
25612
+ contentType: string(),
25613
+ /** Suggested filename, extension included. */
25614
+ name: string(),
25615
+ bytes: number().int().nonnegative()
25616
+ });
25195
25617
  method(object({
25196
25618
  deviceId: number(),
25197
25619
  profile: string(),
@@ -25216,6 +25638,9 @@ method(object({
25216
25638
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25217
25639
  kind: "query",
25218
25640
  auth: "protected"
25641
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25642
+ kind: "query",
25643
+ auth: "protected"
25219
25644
  });
25220
25645
  /**
25221
25646
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31893,6 +32318,12 @@ Object.freeze({
31893
32318
  addonId: null,
31894
32319
  access: "create"
31895
32320
  },
32321
+ "recording.cancelRelocateJob": {
32322
+ capName: "recording",
32323
+ capScope: "system",
32324
+ addonId: null,
32325
+ access: "create"
32326
+ },
31896
32327
  "recording.cancelStorageMigrationMove": {
31897
32328
  capName: "recording",
31898
32329
  capScope: "system",
@@ -31947,6 +32378,12 @@ Object.freeze({
31947
32378
  addonId: null,
31948
32379
  access: "view"
31949
32380
  },
32381
+ "recording.listRelocateJobs": {
32382
+ capName: "recording",
32383
+ capScope: "system",
32384
+ addonId: null,
32385
+ access: "view"
32386
+ },
31950
32387
  "recording.locateSegment": {
31951
32388
  capName: "recording",
31952
32389
  capScope: "system",
@@ -31959,6 +32396,12 @@ Object.freeze({
31959
32396
  addonId: null,
31960
32397
  access: "create"
31961
32398
  },
32399
+ "recording.planStorageRebalance": {
32400
+ capName: "recording",
32401
+ capScope: "system",
32402
+ addonId: null,
32403
+ access: "view"
32404
+ },
31962
32405
  "recording.pruneFootage": {
31963
32406
  capName: "recording",
31964
32407
  capScope: "system",
@@ -31983,6 +32426,12 @@ Object.freeze({
31983
32426
  addonId: null,
31984
32427
  access: "create"
31985
32428
  },
32429
+ "recording.relocateFootage": {
32430
+ capName: "recording",
32431
+ capScope: "system",
32432
+ addonId: null,
32433
+ access: "create"
32434
+ },
31986
32435
  "recording.renderClip": {
31987
32436
  capName: "recording",
31988
32437
  capScope: "system",
@@ -32019,38 +32468,50 @@ Object.freeze({
32019
32468
  addonId: null,
32020
32469
  access: "create"
32021
32470
  },
32471
+ "recording.startStorageRebalance": {
32472
+ capName: "recording",
32473
+ capScope: "system",
32474
+ addonId: null,
32475
+ access: "create"
32476
+ },
32022
32477
  "recordingExport.cancelExport": {
32023
- capName: "recordingExport",
32478
+ capName: "recording-export",
32024
32479
  capScope: "system",
32025
32480
  addonId: null,
32026
32481
  access: "create"
32027
32482
  },
32028
32483
  "recordingExport.createExport": {
32029
- capName: "recordingExport",
32484
+ capName: "recording-export",
32030
32485
  capScope: "system",
32031
32486
  addonId: null,
32032
32487
  access: "create"
32033
32488
  },
32034
32489
  "recordingExport.deleteExport": {
32035
- capName: "recordingExport",
32490
+ capName: "recording-export",
32036
32491
  capScope: "system",
32037
32492
  addonId: null,
32038
32493
  access: "delete"
32039
32494
  },
32040
32495
  "recordingExport.getDownloadUrl": {
32041
- capName: "recordingExport",
32496
+ capName: "recording-export",
32042
32497
  capScope: "system",
32043
32498
  addonId: null,
32044
32499
  access: "view"
32045
32500
  },
32046
32501
  "recordingExport.getExport": {
32047
- capName: "recordingExport",
32502
+ capName: "recording-export",
32048
32503
  capScope: "system",
32049
32504
  addonId: null,
32050
32505
  access: "view"
32051
32506
  },
32052
32507
  "recordingExport.listExports": {
32053
- capName: "recordingExport",
32508
+ capName: "recording-export",
32509
+ capScope: "system",
32510
+ addonId: null,
32511
+ access: "view"
32512
+ },
32513
+ "recordingExport.readExportBytes": {
32514
+ capName: "recording-export",
32054
32515
  capScope: "system",
32055
32516
  addonId: null,
32056
32517
  access: "view"
@@ -33634,6 +34095,104 @@ var FramerateField = number().int().min(1).max(60);
33634
34095
  var TargetsField = array(NcRuleTargetSchema).min(1);
33635
34096
  var PriorityField = number().int().min(1).max(5);
33636
34097
  /**
34098
+ * Explicit override of the DENSE sampling cadence, seconds.
34099
+ *
34100
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34101
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34102
+ * made that same base 3 s and rendered a person pass as two frames.)
34103
+ *
34104
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34105
+ * `denseCadenceSec` and played at `framerate` occupies
34106
+ *
34107
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34108
+ *
34109
+ * 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.
34110
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34111
+ * and therefore the length of a quiet night, does not move.
34112
+ *
34113
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34114
+ * the recording has them returns the same frames, requested twice. Must be
34115
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34116
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34117
+ * rather than letting the export cap reject the render hours after the window.
34118
+ */
34119
+ var DenseCadenceSecField = number().min(.1).max(3600);
34120
+ /**
34121
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34122
+ *
34123
+ * The operator-facing form of the arithmetic above: instead of solving for a
34124
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34125
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34126
+ * that range every ~583 ms.
34127
+ *
34128
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34129
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34130
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34131
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34132
+ * schema change and are the tracked follow-up.
34133
+ *
34134
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34135
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34136
+ * by real footage, never met by duplicating frames into motion that never
34137
+ * happened.
34138
+ */
34139
+ var MinDwellSecField = number().min(0).max(60);
34140
+ /**
34141
+ * Caption burned into the notification's preview frame.
34142
+ *
34143
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34144
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34145
+ * templating dialect for one field would be a second thing to explain.
34146
+ *
34147
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34148
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34149
+ * the reason this is not `.min(1)`.
34150
+ */
34151
+ var PreviewTextField = string().max(200);
34152
+ /**
34153
+ * Whether the notification's preview is a STILL or a short animation.
34154
+ *
34155
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34156
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34157
+ * night reads better as three seconds of motion than as one frame of it. Both
34158
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34159
+ * simply applies it to a dozen frames sampled across the render and assembles
34160
+ * them.
34161
+ *
34162
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34163
+ * seeks and a palette pass, and no rule that never asked for one should start
34164
+ * paying that on the deploy that shipped it.
34165
+ *
34166
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34167
+ */
34168
+ var PreviewModeField = _enum(["image", "gif"]);
34169
+ /**
34170
+ * Which detection classes the notification reports counts for.
34171
+ *
34172
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34173
+ * plan — no second query — aggregated per class. Absent or empty means "every
34174
+ * class the window actually contained", which is what an operator who never
34175
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34176
+ * counts cars all night).
34177
+ *
34178
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34179
+ * …). An unknown name simply never matches and reports nothing — it is not an
34180
+ * error, because a rule may legitimately name a class this camera's model does
34181
+ * not emit.
34182
+ *
34183
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34184
+ * - `{{detections}}` — total over the reported classes
34185
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34186
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34187
+ * one per class, `count_` + the class name
34188
+ *
34189
+ * With NO custom body template the summary is appended to the derived body, and
34190
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34191
+ * reads. With a custom template the operator owns every word — nothing is
34192
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34193
+ */
34194
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34195
+ /**
33637
34196
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33638
34197
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33639
34198
  * here (see the ownership note above).
@@ -33653,9 +34212,30 @@ var TimelapseRuleInputSchema = object({
33653
34212
  cadenceSec: CadenceSecField.default(15),
33654
34213
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33655
34214
  framerate: FramerateField.default(10),
34215
+ /**
34216
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34217
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34218
+ * field gets.
34219
+ */
34220
+ denseCadenceSec: DenseCadenceSecField.optional(),
34221
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34222
+ minDwellSec: MinDwellSecField.optional(),
33656
34223
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33657
34224
  targets: TargetsField,
33658
34225
  template: TimelapseTemplateSchema.optional(),
34226
+ /**
34227
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34228
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34229
+ *
34230
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34231
+ * the notification's title/body, and clearing it (`template: null`) must not
34232
+ * silently clear the caption too.
34233
+ */
34234
+ previewText: PreviewTextField.optional(),
34235
+ /** Still or animation — see {@link PreviewModeField}. */
34236
+ previewMode: PreviewModeField.default("image"),
34237
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34238
+ reportClasses: ReportClassesField.optional(),
33659
34239
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33660
34240
  priority: PriorityField.default(3)
33661
34241
  });
@@ -33666,8 +34246,13 @@ object({
33666
34246
  schedule: NcScheduleSchema.optional(),
33667
34247
  cadenceSec: CadenceSecField.optional(),
33668
34248
  framerate: FramerateField.optional(),
34249
+ denseCadenceSec: DenseCadenceSecField.optional(),
34250
+ minDwellSec: MinDwellSecField.optional(),
33669
34251
  targets: TargetsField.optional(),
33670
34252
  template: TimelapseTemplateSchema.nullable().optional(),
34253
+ previewText: PreviewTextField.optional(),
34254
+ previewMode: PreviewModeField.optional(),
34255
+ reportClasses: ReportClassesField.optional(),
33671
34256
  priority: PriorityField.optional()
33672
34257
  });
33673
34258
  TimelapseRuleInputSchema.extend({
@@ -33679,10 +34264,28 @@ TimelapseRuleInputSchema.extend({
33679
34264
  */
33680
34265
  ownerUserId: string().optional(),
33681
34266
  /**
33682
- * Epoch-ms of the last successful generation the 1-hour re-generation
33683
- * guard's durable state (predecessor parity). Absent = never generated.
34267
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34268
+ * rule. What a UI shows, and the compatibility floor for
34269
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33684
34270
  */
33685
34271
  lastGeneratedAt: number().optional(),
34272
+ /**
34273
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34274
+ * re-generation guard's real durable state.
34275
+ *
34276
+ * One rule covers several cameras and each renders its own video, so a rule
34277
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34278
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34279
+ * already done — and B's night is gone for good, because the window will not
34280
+ * come back.
34281
+ *
34282
+ * ADDITIVE, so the migration is free: a row written before this field simply
34283
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34284
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34285
+ * "never generated" would re-render and re-notify every camera of every rule
34286
+ * once, on the deploy that shipped the map.
34287
+ */
34288
+ generatedByDevice: record(string(), number()).optional(),
33686
34289
  /** userId of the caller who created the rule (server-stamped). */
33687
34290
  createdBy: string(),
33688
34291
  createdAt: number(),