@camstack/addon-provider-wyze 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +954 -62
  2. package/dist/addon.mjs +954 -62
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7236,8 +7236,31 @@ var AdoptionJobSchema = object({
7236
7236
  error: string().nullable()
7237
7237
  });
7238
7238
  /**
7239
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7240
- * pipeline functions an operator thinks in terms of.
7239
+ * Per-camera FUNCTION SWITCHES.
7240
+ *
7241
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7242
+ *
7243
+ * This file shipped as "the one coherent on/off surface over the pipeline
7244
+ * functions an operator thinks in terms of". The operator's verdict on
7245
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7246
+ * every function already had a settings page of its own, and a second place to
7247
+ * turn it off is a second place to look. Each switch is going back to its own
7248
+ * component's original options — detection to the detection-pipeline wrapper
7249
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7250
+ * (which was always first-class; the switch was a veneer over
7251
+ * `recording.setDeviceConfig`), notifications to a notification-center
7252
+ * per-device setting, the two camera planes to their own components.
7253
+ *
7254
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7255
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7256
+ * straight from the authorities with no group in the middle. That rule was
7257
+ * never about a control panel.
7258
+ *
7259
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7260
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7261
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7262
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7263
+ * stop; nothing new may be built on it.
7241
7264
  *
7242
7265
  * ## This file adds no state
7243
7266
  *
@@ -7582,14 +7605,21 @@ var RecordingConfigSchema = object({
7582
7605
  /**
7583
7606
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7584
7607
  *
7585
- * One shape shared by the recorder's `relocateFootage` (segments) and
7586
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7587
- * page renders both movers with one component. Jobs are in-RAM (a restart
7588
- * forgets them re-running is safe by construction: copy-if-absent, delete
7589
- * after verify) and each completed/failed run also lands one durable ops-log
7590
- * row on the owning addon's surface.
7608
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7609
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7610
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7611
+ * Each completed/failed run also lands one durable ops-log row on its owning
7612
+ * addon surface.
7613
+ */
7614
+ /**
7615
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7616
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7617
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7618
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7619
+ * runs at all.
7591
7620
  */
7592
7621
  var RelocateJobStateSchema = _enum([
7622
+ "queued",
7593
7623
  "running",
7594
7624
  "done",
7595
7625
  "failed",
@@ -7614,19 +7644,109 @@ var RelocateJobSchema = object({
7614
7644
  finishedAt: number().nullable(),
7615
7645
  error: string().nullable()
7616
7646
  });
7647
+ /** Profile-derived footage selection used only by the migration coordinator:
7648
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7649
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7617
7650
  var RelocateFootageInputSchema = object({
7618
- deviceId: number().optional(),
7619
7651
  fromLocationId: string(),
7620
7652
  toLocationId: string(),
7621
7653
  entities: array(_enum(["segments"])).optional(),
7654
+ /** Limits relocation to the logical profile class. Omit only for the
7655
+ * pre-orchestration compatibility path. */
7656
+ footageClass: RelocateFootageClassSchema.optional(),
7657
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7658
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7659
+ * unit is a (camera, profile) pile, not a disk. */
7660
+ deviceId: number().int().optional(),
7661
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7662
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7663
+ * placement plan assigns those two independently, so a rebalance that could
7664
+ * only say "recordings" would move footage the plan never asked to move. */
7665
+ profiles: array(string()).optional(),
7622
7666
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7623
7667
  * never allowed to starve live writers. */
7624
7668
  throttleMbps: number().min(1).max(1e3).optional()
7625
7669
  });
7626
- var RelocateMediaInputSchema = object({
7627
- deviceId: number().optional(),
7670
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7671
+ * from persistent recording settings: a migration never changes
7672
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7673
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7674
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7675
+ var StorageMigrationMediaMoveInputSchema = object({
7628
7676
  toLocationId: string(),
7629
7677
  throttleMbps: number().min(1).max(1e3).optional()
7678
+ }).extend({ leaseId: string().min(1) });
7679
+ /** The independently selectable logical storage classes. `recordings`
7680
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7681
+ * segments; `eventMedia` is post-analysis blobs. */
7682
+ var StorageMigrationClassSchema = _enum([
7683
+ "recordings",
7684
+ "recordingsLow",
7685
+ "eventMedia"
7686
+ ]);
7687
+ /** A destination is always an existing, fully-qualified location id. The
7688
+ * migration API intentionally never changes a source location's `basePath`:
7689
+ * callers create a new `<type>:<slug>` location, then select it here. */
7690
+ var StorageMigrationDestinationsSchema = object({
7691
+ recordings: string().min(1).optional(),
7692
+ recordingsLow: string().min(1).optional(),
7693
+ eventMedia: string().min(1).optional()
7694
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7695
+ /** Shared input for planning and starting an orchestrated storage migration. */
7696
+ var StorageMigrationInputSchema = object({
7697
+ destinations: StorageMigrationDestinationsSchema,
7698
+ throttleMbps: number().min(1).max(1e3).optional()
7699
+ });
7700
+ /** The durable coordinator state machine. The only phase that changes default
7701
+ * locations is `repointing`, after every selected mover has completed and been
7702
+ * verified. */
7703
+ var StorageMigrationPhaseSchema = _enum([
7704
+ "planning",
7705
+ "pausing",
7706
+ "moving",
7707
+ "verifying",
7708
+ "repointing",
7709
+ "refreshing",
7710
+ "resuming",
7711
+ "done",
7712
+ "failed",
7713
+ "cancelled"
7714
+ ]);
7715
+ var StorageMigrationParticipantSchema = _enum([
7716
+ "pipeline",
7717
+ "recorder",
7718
+ "analytics"
7719
+ ]);
7720
+ var StorageMigrationMoveSchema = object({
7721
+ storageClass: StorageMigrationClassSchema,
7722
+ fromLocationId: string(),
7723
+ toLocationId: string(),
7724
+ moverJobId: string().nullable(),
7725
+ state: RelocateJobStateSchema.nullable(),
7726
+ error: string().nullable()
7727
+ });
7728
+ var StorageMigrationJobSchema = object({
7729
+ jobId: string(),
7730
+ phase: StorageMigrationPhaseSchema,
7731
+ destinations: StorageMigrationDestinationsSchema,
7732
+ throttleMbps: number(),
7733
+ moves: array(StorageMigrationMoveSchema),
7734
+ pauseLeaseId: string().nullable(),
7735
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7736
+ repointed: boolean(),
7737
+ cancelRequested: boolean(),
7738
+ startedAt: number(),
7739
+ updatedAt: number(),
7740
+ finishedAt: number().nullable(),
7741
+ error: string().nullable()
7742
+ });
7743
+ var StorageMigrationPlanSchema = object({
7744
+ destinations: StorageMigrationDestinationsSchema,
7745
+ moves: array(object({
7746
+ storageClass: StorageMigrationClassSchema,
7747
+ fromLocationId: string(),
7748
+ toLocationId: string()
7749
+ }))
7630
7750
  });
7631
7751
  /**
7632
7752
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7678,6 +7798,21 @@ var StorageLocationSchema = object({
7678
7798
  nodeId: string().optional(),
7679
7799
  isDefault: boolean().default(false),
7680
7800
  isSystem: boolean().default(false),
7801
+ /**
7802
+ * Operator opt-in: whether consumers that BALANCE across several locations
7803
+ * of a type may write here. Recordings reads it today; event media and
7804
+ * backups are the next consumers, which is why the flag lives on the
7805
+ * location rather than in any one addon's store — nothing has to be
7806
+ * extended to add the next consumer.
7807
+ *
7808
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7809
+ * flag existed reads back with no flag and keeps working exactly as before;
7810
+ * that is the whole compat story, and it is why no migration ships with it.
7811
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7812
+ * disk must not silently start writing to it); the default of a type is
7813
+ * always stamped `true`.
7814
+ */
7815
+ enabled: boolean().optional(),
7681
7816
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7682
7817
  * for node-local locations it can reach) — never persisted, absent when the
7683
7818
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12247,7 +12382,8 @@ method(object({
12247
12382
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12248
12383
  /**
12249
12384
  * filesystem-browse — per-node capability for browsing the node's local
12250
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12385
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12386
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12251
12387
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12252
12388
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12253
12389
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14088,6 +14224,13 @@ var MaskGridDimsSchema = object({
14088
14224
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14089
14225
  * this one field keeps the schema additive — a rule still declares exactly
14090
14226
  * one trigger.
14227
+ *
14228
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14229
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14230
+ * mirror.ts` fails the build on a member the app cannot render) and every
14231
+ * member costs a release train. A sustained-sound rule is therefore an
14232
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14233
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14091
14234
  */
14092
14235
  var NcDeliverySchema = _enum([
14093
14236
  "immediate",
@@ -14102,15 +14245,32 @@ var NcDeliverySchema = _enum([
14102
14245
  * depend on a provider's raw event name or payload shape.
14103
14246
  */
14104
14247
  var NcSystemEventKindSchema = _enum([
14105
- "camera-online",
14106
- "camera-offline",
14248
+ "device-online",
14249
+ "device-offline",
14250
+ "device-disabled",
14251
+ "device-enabled",
14107
14252
  "stream-online",
14108
14253
  "stream-offline",
14109
14254
  "node-online",
14110
14255
  "node-offline",
14111
14256
  "addon-update-available",
14112
- "server-update-available"
14257
+ "server-update-available",
14258
+ "alarm-triggered",
14259
+ "alarm-armed",
14260
+ "alarm-disarmed",
14261
+ "camera-online",
14262
+ "camera-offline",
14263
+ "camera-disabled",
14264
+ "camera-enabled"
14265
+ ]);
14266
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14267
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14268
+ "camera-online",
14269
+ "camera-offline",
14270
+ "camera-disabled",
14271
+ "camera-enabled"
14113
14272
  ]);
14273
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14114
14274
  /**
14115
14275
  * One coherent system-event condition. `kinds` is the required opt-in safety
14116
14276
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14119,6 +14279,18 @@ var NcSystemEventKindSchema = _enum([
14119
14279
  var NcSystemEventConditionSchema = object({
14120
14280
  kinds: array(NcSystemEventKindSchema).min(1),
14121
14281
  deviceIds: array(number().int()).min(1).optional(),
14282
+ /**
14283
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14284
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14285
+ * is what a liveness rule means when nobody said otherwise.
14286
+ *
14287
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14288
+ * one reason: the intake cannot know which devices this household cares
14289
+ * about, and a producer-side filter is one no operator can change. Fails
14290
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14291
+ * does not carry) matches no `deviceTypes` list.
14292
+ */
14293
+ deviceTypes: array(string().min(1)).min(1).optional(),
14122
14294
  nodeIds: array(string().min(1)).min(1).optional(),
14123
14295
  packageNames: array(string().min(1)).min(1).optional()
14124
14296
  });
@@ -14169,6 +14341,47 @@ var NcOccupancyConditionSchema = object({
14169
14341
  sustainSeconds: number().int().min(0).max(3600).default(15)
14170
14342
  });
14171
14343
  /**
14344
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14345
+ *
14346
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14347
+ * reference notifier uses, so an operator moving between them re-uses what
14348
+ * they already know): a rule matches when, over a sampling window of
14349
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14350
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14351
+ *
14352
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14353
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14354
+ * - `labels` — the classifier put at least one of these labels on it.
14355
+ *
14356
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14357
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14358
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14359
+ * is given** — a window in which every sample is trivially a hit would fire on
14360
+ * silence, so the engine refuses such a condition rather than notifying on
14361
+ * nothing (the schema cannot express "at least one of" without becoming a
14362
+ * ZodEffects the cap path would have to special-case).
14363
+ *
14364
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14365
+ * must be FULL before it can match — a window that has been open for two
14366
+ * seconds of its ten is 100% of nothing, and firing on it would make
14367
+ * `samplingSeconds` decorative.
14368
+ *
14369
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14370
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14371
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14372
+ * an operator who typed `dog` mean the same thing.
14373
+ */
14374
+ var NcAudioConditionSchema = object({
14375
+ /** Audio macro labels; absent = any sound (level-only rule). */
14376
+ labels: array(string().min(1)).min(1).optional(),
14377
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14378
+ dbThreshold: number().min(-96).max(0).optional(),
14379
+ /** Percentage of the window's samples that must be hits (1–100). */
14380
+ hitPercent: number().int().min(1).max(100).default(60),
14381
+ /** Length of the sampling window in seconds. */
14382
+ samplingSeconds: number().int().min(1).max(300).default(10)
14383
+ });
14384
+ /**
14172
14385
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14173
14386
  *
14174
14387
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14441,7 +14654,33 @@ var NcConditionsSchema = object({
14441
14654
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14442
14655
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14443
14656
  */
14444
- occupancy: NcOccupancyConditionSchema.optional()
14657
+ occupancy: NcOccupancyConditionSchema.optional(),
14658
+ /**
14659
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14660
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14661
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14662
+ * a window that is not full yet, neither filter given). See
14663
+ * {@link NcAudioCondition}.
14664
+ *
14665
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14666
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14667
+ * a detection, a track or a device event (the same fail-closed pairing
14668
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14669
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14670
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14671
+ * classified sample) stays exactly as it was for rules that already use it.
14672
+ *
14673
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14674
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14675
+ * (`camstack/src/data/notification-center.ts`, guarded by
14676
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14677
+ * condition fields it does not know when a rule is saved from the phone.
14678
+ * Publishing an editor for a condition the app cannot round-trip is how an
14679
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14680
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14681
+ * does an audio rule become authorable.
14682
+ */
14683
+ audio: NcAudioConditionSchema.optional()
14445
14684
  });
14446
14685
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14447
14686
  var NcRuleTargetSchema = object({
@@ -14555,6 +14794,73 @@ var NcThrottleSchema = object({
14555
14794
  */
14556
14795
  granularity: NcThrottleGranularitySchema.optional()
14557
14796
  });
14797
+ /**
14798
+ * How long the confirm gate may hold ONE notification, and how big the picture
14799
+ * it judges may be.
14800
+ *
14801
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14802
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14803
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14804
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14805
+ * tokens for pixels the model pools away.
14806
+ */
14807
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14808
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14809
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14810
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14811
+ var NcConfirmExpectSchema = object({
14812
+ op: _enum([
14813
+ ">=",
14814
+ ">",
14815
+ "<=",
14816
+ "<",
14817
+ "=="
14818
+ ]),
14819
+ count: number().int().min(0).max(1e3)
14820
+ });
14821
+ /**
14822
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14823
+ * to ship and says whether it agrees with the rule.
14824
+ *
14825
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14826
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14827
+ * on the operator's phone is not a verdict about this notification.
14828
+ *
14829
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14830
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14831
+ * the default and every fail-open is COUNTED, because a gate that always fails
14832
+ * open looks in the log exactly like a gate that works.
14833
+ *
14834
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14835
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14836
+ * production failures in one day), so the gate reads absent as the constant
14837
+ * above rather than trusting a parse it may never have seen.
14838
+ */
14839
+ var NcConfirmSchema = object({
14840
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14841
+ * same thing, and both mean "deliver exactly as before". */
14842
+ enabled: boolean().default(false),
14843
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14844
+ profileId: string().optional(),
14845
+ /**
14846
+ * The operator's question, in his own words. Absent = a question derived
14847
+ * from the rule (its class and its expectation).
14848
+ *
14849
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14850
+ * banners, signage and plates as instructions if you let them reach the
14851
+ * prompt — proven live — so the authoritative contract stays in the system
14852
+ * turn and only rule-authored words land here.
14853
+ */
14854
+ prompt: string().max(1e3).optional(),
14855
+ /** Fire only when the model's count satisfies this. Absent = the model's
14856
+ * own boolean verdict decides. */
14857
+ expect: NcConfirmExpectSchema.optional(),
14858
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14859
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14860
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14861
+ /** Longest edge the judged image is downscaled to before it is sent. */
14862
+ maxImagePx: number().int().min(64).max(2048).default(448)
14863
+ });
14558
14864
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14559
14865
  var NcRuleInputSchema = object({
14560
14866
  name: string().min(1).max(200),
@@ -14615,7 +14921,13 @@ var NcRuleInputSchema = object({
14615
14921
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14616
14922
  * shape as every other actuation.
14617
14923
  */
14618
- actions: NcRuleActionsSchema.optional()
14924
+ actions: NcRuleActionsSchema.optional(),
14925
+ /**
14926
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14927
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14928
+ * did, and absent is the only way to say that without a migration.
14929
+ */
14930
+ confirm: NcConfirmSchema.optional()
14619
14931
  });
14620
14932
  /**
14621
14933
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14626,7 +14938,37 @@ var NcRuleInputSchema = object({
14626
14938
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14627
14939
  * `updateRule` patch.
14628
14940
  */
14629
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14941
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14942
+ disabledTargetIds: array(string()).optional(),
14943
+ /**
14944
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14945
+ *
14946
+ * It makes the key optional to SUPPLY; the parse still materialises the
14947
+ * default when the key is absent. And `NcRuleStore.update` merges with
14948
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14949
+ * one — which made every partial edit destructive:
14950
+ *
14951
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14952
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14953
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14954
+ *
14955
+ * A rule scoped to one camera and one zone silently became a rule that
14956
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14957
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14958
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14959
+ * within a minute of a two-field patch.
14960
+ *
14961
+ * So every defaulted field is re-declared here WITHOUT its default. The
14962
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14963
+ * conditions remains a real instruction ("clear them") — and only the
14964
+ * absent key is now genuinely absent.
14965
+ */
14966
+ enabled: boolean().optional(),
14967
+ conditions: NcConditionsSchema.optional(),
14968
+ media: NcMediaPolicySchema.optional(),
14969
+ throttle: NcThrottleSchema.optional(),
14970
+ priority: number().int().min(1).max(5).optional()
14971
+ });
14630
14972
  /** A persisted rule. */
14631
14973
  var NcRuleSchema = NcRuleInputSchema.extend({
14632
14974
  id: string(),
@@ -14927,6 +15269,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14927
15269
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14928
15270
  * copy would lie the first time a rule is disabled.
14929
15271
  */
15272
+ /**
15273
+ * Why a device a mode NAMES is nonetheless not armed by it.
15274
+ *
15275
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15276
+ * per-camera notification switch the Notification Center already owns,
15277
+ * `detection-off` is the device's own detection binding being inactive, and
15278
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15279
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15280
+ * with the switches the operator actually used.
15281
+ */
15282
+ var NcAlarmSkipReasonSchema = _enum([
15283
+ "muted",
15284
+ "detection-off",
15285
+ "offline"
15286
+ ]);
15287
+ var NcAlarmSkippedDeviceSchema = object({
15288
+ deviceId: number().int(),
15289
+ reason: NcAlarmSkipReasonSchema
15290
+ });
14930
15291
  var NcAlarmModeCoverageSchema = object({
14931
15292
  mode: AlarmArmModeSchema,
14932
15293
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14934,7 +15295,18 @@ var NcAlarmModeCoverageSchema = object({
14934
15295
  /** At least one covering rule has no device scope, so the mode covers all. */
14935
15296
  allDevices: boolean(),
14936
15297
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14937
- deviceIds: array(number().int())
15298
+ deviceIds: array(number().int()),
15299
+ /**
15300
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15301
+ * excludes it.
15302
+ *
15303
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15304
+ * twelve makes it false in exactly the way nobody notices until an incident.
15305
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15306
+ * still parses as "nothing known to be skipped" rather than failing the whole
15307
+ * alarm tab.
15308
+ */
15309
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14938
15310
  });
14939
15311
  var NcAlarmConfigSchema = object({
14940
15312
  /**
@@ -16297,13 +16669,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16297
16669
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16298
16670
  kind: "mutation",
16299
16671
  auth: "admin"
16300
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16672
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16301
16673
  kind: "mutation",
16302
16674
  auth: "admin"
16303
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16304
- kind: "query",
16675
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16676
+ kind: "mutation",
16305
16677
  auth: "admin"
16306
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16678
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16679
+ kind: "mutation",
16680
+ auth: "admin"
16681
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16682
+ kind: "mutation",
16683
+ auth: "admin"
16684
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16307
16685
  kind: "mutation",
16308
16686
  auth: "admin"
16309
16687
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17760,9 +18138,16 @@ var CameraStatusSchema = object({
17760
18138
  audio: CameraAudioStatusSchema.nullable(),
17761
18139
  recording: CameraRecordingStatusSchema.nullable(),
17762
18140
  /**
17763
- * Per-camera function switches an OPERATOR has turned off
18141
+ * Per-camera functions an OPERATOR has turned off
17764
18142
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17765
18143
  *
18144
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18145
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18146
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18147
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18148
+ * The badge outlives the control panel: the panel was a convenience, this is
18149
+ * the difference between a camera being off and a camera being dead.
18150
+ *
17766
18151
  * This is the difference between DISABLED and BROKEN. A camera whose
17767
18152
  * `detection` block reports zero fps and whose `switchedOff` contains
17768
18153
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17833,7 +18218,13 @@ var NodeInferenceDevicesSchema = object({
17833
18218
  reachable: boolean(),
17834
18219
  devices: array(NodeInferenceDeviceSchema).readonly()
17835
18220
  });
17836
- method(object({
18221
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18222
+ kind: "mutation",
18223
+ auth: "admin"
18224
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18225
+ kind: "mutation",
18226
+ auth: "admin"
18227
+ }), method(object({
17837
18228
  deviceId: number(),
17838
18229
  agentNodeId: string()
17839
18230
  }), object({ success: literal(true) }), {
@@ -18363,24 +18754,28 @@ var snapshotCapability = {
18363
18754
  *
18364
18755
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18365
18756
  * the wrapper happens to hold and never captures. Under D93 the client
18366
- * versions its image URL on that answer, and an image REQUEST is what enrols
18367
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18368
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18369
- * — so a URL painted in a previous session comes off disk with no network,
18370
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18371
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18372
- * HTTP requests, and the fleet only recovered because a later poll happened
18373
- * to observe a different identity.
18757
+ * versions its image URL on that answer, and an image REQUEST was the only
18758
+ * demand signal. Both of those are satisfiable by the client's own image
18759
+ * cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
18760
+ * in a previous session comes off disk with no network, no demand, and no
18761
+ * capture. Measured on the live hub: reopening after two minutes idle
18762
+ * painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
18763
+ * fleet only recovered because a later poll happened to observe a different
18764
+ * identity.
18374
18765
  *
18375
18766
  * ## The two properties that fix it
18376
18767
  *
18377
18768
  * **It is an RPC, so no client cache can answer it.** The demand signal
18378
- * always reaches the wrapper. This method therefore MAY create keep-warm
18379
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18380
- * distinction is not "one is newer" but that the overview poll is app-wide
18381
- * (a creating overview would warm every camera on the install) while this is
18382
- * called by a rendered surface naming the tiles it is actually painting, at
18383
- * the width it is painting them.
18769
+ * always reaches the wrapper. This method therefore CAPTURES, where
18770
+ * `getSnapshotOverview` must never (D93) — the distinction is not "one is
18771
+ * newer" but that the overview poll is app-wide (a capturing overview would
18772
+ * dial every camera on the install) while this is called by a rendered
18773
+ * surface naming the tiles it is actually painting, at the width it is
18774
+ * painting them.
18775
+ *
18776
+ * Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
18777
+ * server-side keep-warm loop was removed (operator directive — on-demand,
18778
+ * always), so a camera nobody is looking at costs nothing at all.
18384
18779
  *
18385
18780
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18386
18781
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -18598,6 +18993,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18598
18993
  locationId: string(),
18599
18994
  targetBytes: number().int().positive()
18600
18995
  }), EvictResultSchema, { kind: "mutation" });
18996
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18997
+ kind: "mutation",
18998
+ auth: "admin"
18999
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
19000
+ kind: "mutation",
19001
+ auth: "admin"
19002
+ });
18601
19003
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18602
19004
  providerId: string().min(1),
18603
19005
  displayName: string().min(1),
@@ -18701,6 +19103,28 @@ var TerminalProfileInfoSchema = object({
18701
19103
  label: string(),
18702
19104
  description: string().optional()
18703
19105
  });
19106
+ /**
19107
+ * A durable operator-created Terminal instance. Profiles are templates; only
19108
+ * an instance declares a camera.
19109
+ */
19110
+ var TerminalInstanceInfoSchema = object({
19111
+ instanceId: string(),
19112
+ cameraStableId: string(),
19113
+ nodeId: string(),
19114
+ profileId: string(),
19115
+ profileLabel: string(),
19116
+ name: string(),
19117
+ enabled: boolean()
19118
+ });
19119
+ var TerminalLegacyCameraSchema = object({
19120
+ stableId: string(),
19121
+ nodeId: string(),
19122
+ profileId: string(),
19123
+ profileLabel: string(),
19124
+ name: string(),
19125
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19126
+ adoptable: boolean()
19127
+ });
18704
19128
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18705
19129
  seq: number().int().positive(),
18706
19130
  kind: literal("data"),
@@ -18717,7 +19141,29 @@ var TerminalOutputBatchSchema = object({
18717
19141
  snapshot: string().optional(),
18718
19142
  events: array(TerminalOutputEventSchema).readonly()
18719
19143
  });
18720
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19144
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19145
+ targetNodeId: string().min(1),
19146
+ profileId: string().min(1),
19147
+ name: string().trim().min(1).max(160).optional()
19148
+ }), TerminalInstanceInfoSchema, {
19149
+ kind: "mutation",
19150
+ auth: "admin"
19151
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19152
+ kind: "mutation",
19153
+ auth: "admin"
19154
+ }), method(object({
19155
+ instanceId: string().min(1),
19156
+ enabled: boolean()
19157
+ }), TerminalInstanceInfoSchema, {
19158
+ kind: "mutation",
19159
+ auth: "admin"
19160
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19161
+ stableId: string().min(1),
19162
+ name: string().trim().min(1).max(160).optional()
19163
+ }), TerminalInstanceInfoSchema, {
19164
+ kind: "mutation",
19165
+ auth: "admin"
19166
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18721
19167
  profileId: string(),
18722
19168
  cols: number().int().positive(),
18723
19169
  rows: number().int().positive()
@@ -18734,7 +19180,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18734
19180
  }), method(object({
18735
19181
  sessionId: string(),
18736
19182
  afterSeq: number().int().nonnegative(),
18737
- waitMs: number().int().min(0).max(2e3).default(0)
19183
+ waitMs: number().int().min(0).max(2e3).default(0),
19184
+ /**
19185
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19186
+ * browser's initial repaint remains immediate; the camera snapshot
19187
+ * relay uses it to avoid encoding a blank startup frame.
19188
+ */
19189
+ waitForOutput: boolean().optional()
18738
19190
  }), TerminalOutputBatchSchema, {
18739
19191
  kind: "mutation",
18740
19192
  auth: "admin",
@@ -21232,6 +21684,7 @@ var FaceInfoSchema = object({
21232
21684
  var FaceFilterEnum = _enum([
21233
21685
  "unassigned",
21234
21686
  "recognized",
21687
+ "identified",
21235
21688
  "all"
21236
21689
  ]);
21237
21690
  var MediaFileLiteSchema$1 = object({
@@ -21260,6 +21713,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21260
21713
  kind: "mutation",
21261
21714
  auth: "admin"
21262
21715
  }), method(object({
21716
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21717
+ deviceId: number().int().optional(),
21263
21718
  limit: number().int().positive().optional(),
21264
21719
  filter: FaceFilterEnum.optional(),
21265
21720
  /**
@@ -23540,6 +23995,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23540
23995
  capName: string().min(1).max(64),
23541
23996
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23542
23997
  valuePath: string().min(1).max(64)
23998
+ }),
23999
+ object({
24000
+ kind: literal("latest-recognition"),
24001
+ recognition: _enum(["person", "plate"])
23543
24002
  })
23544
24003
  ]);
23545
24004
  var OsdSlotBindingSchema = object({
@@ -23645,6 +24104,15 @@ method(object({ deviceId: number().int() }), object({
23645
24104
  }), object({ success: literal(true) }), {
23646
24105
  kind: "mutation",
23647
24106
  auth: "admin"
24107
+ }), method(object({
24108
+ sourceDeviceId: number().int(),
24109
+ targetDeviceId: number().int()
24110
+ }), object({
24111
+ copied: number().int().nonnegative(),
24112
+ skipped: number().int().nonnegative()
24113
+ }), {
24114
+ kind: "mutation",
24115
+ auth: "admin"
23648
24116
  }), method(object({
23649
24117
  deviceId: number().int(),
23650
24118
  slotId: string().min(1),
@@ -24567,7 +25035,19 @@ var RecordingManifestSchema = object({
24567
25035
  * profiles/subtrees/locations on this node). */
24568
25036
  var RecordingDeviceUsageSchema = object({
24569
25037
  deviceId: number(),
24570
- usedBytes: number()
25038
+ usedBytes: number(),
25039
+ /**
25040
+ * Start of this camera's OLDEST indexed segment, across every profile and
25041
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25042
+ * only honest answer to "is retention actually holding?" per camera.
25043
+ *
25044
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25045
+ * predates this field omits it entirely, and a hub whose types carry the
25046
+ * field must keep validating that older provider's payload: the framework
25047
+ * (types) and the addon ship on different trains, and the addon is usually
25048
+ * the later of the two.
25049
+ */
25050
+ oldestMs: number().nullable().optional()
24571
25051
  });
24572
25052
  /** Recording storage usage + capacity for one storage location. */
24573
25053
  var RecordingLocationUsageSchema = object({
@@ -24595,6 +25075,57 @@ var RecordingStorageUsageSchema = object({
24595
25075
  locations: array(RecordingLocationUsageSchema)
24596
25076
  });
24597
25077
  /**
25078
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25079
+ *
25080
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25081
+ * is the operator asking for the EXISTING archive to be brought into line with
25082
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25083
+ * location, run FIFO behind the single-flight mover.
25084
+ *
25085
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25086
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25087
+ * (empty on the plan).
25088
+ */
25089
+ var RecordingRebalanceMoveSchema = object({
25090
+ deviceId: number(),
25091
+ profile: string(),
25092
+ fromLocationId: string(),
25093
+ toLocationId: string(),
25094
+ bytes: number(),
25095
+ files: number().int()
25096
+ });
25097
+ /** Why a pile that is out of place is staying there. Every refusal is
25098
+ * reported: a rebalance that silently drops a camera reads exactly like one
25099
+ * that had nothing to do. */
25100
+ var RecordingRebalanceSkipReasonSchema = _enum([
25101
+ "unassigned",
25102
+ "target-not-writable",
25103
+ "below-threshold",
25104
+ "no-headroom"
25105
+ ]);
25106
+ var RecordingRebalanceSkipSchema = object({
25107
+ deviceId: number(),
25108
+ profile: string(),
25109
+ fromLocationId: string(),
25110
+ /** The location the plan wants; null when the camera has no assignment. */
25111
+ toLocationId: string().nullable(),
25112
+ bytes: number(),
25113
+ reason: RecordingRebalanceSkipReasonSchema
25114
+ });
25115
+ var RecordingRebalancePlanSchema = object({
25116
+ moves: array(RecordingRebalanceMoveSchema),
25117
+ skipped: array(RecordingRebalanceSkipSchema),
25118
+ bytesToMove: number(),
25119
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25120
+ jobIds: array(string())
25121
+ });
25122
+ var RecordingRebalanceInputSchema = object({
25123
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25124
+ throttleMbps: number().min(1).max(1e3).optional(),
25125
+ /** Ignore piles smaller than this (default 1 GB). */
25126
+ minMoveGb: number().min(0).optional()
25127
+ });
25128
+ /**
24598
25129
  * Result of locating footage at a wall-clock instant for one device/profile.
24599
25130
  * `segment` carries the covering segment's window; `gap` reports the forward
24600
25131
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24742,6 +25273,21 @@ method(object({
24742
25273
  }), {
24743
25274
  kind: "mutation",
24744
25275
  auth: "admin"
25276
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25277
+ kind: "mutation",
25278
+ auth: "admin"
25279
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25280
+ kind: "mutation",
25281
+ auth: "admin"
25282
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25283
+ kind: "mutation",
25284
+ auth: "admin"
25285
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25286
+ kind: "mutation",
25287
+ auth: "admin"
25288
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25289
+ kind: "mutation",
25290
+ auth: "admin"
24745
25291
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24746
25292
  kind: "mutation",
24747
25293
  auth: "admin"
@@ -24751,9 +25297,15 @@ method(object({
24751
25297
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24752
25298
  kind: "mutation",
24753
25299
  auth: "admin"
25300
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25301
+ kind: "query",
25302
+ auth: "admin"
25303
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25304
+ kind: "mutation",
25305
+ auth: "admin"
24754
25306
  });
24755
25307
  /**
24756
- * `recordingExport` cap — render a footage time range into a single downloadable
25308
+ * `recording-export` cap — render a footage time range into a single downloadable
24757
25309
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24758
25310
  * bounded lifetime with a durable history, auto-expiry, and optional
24759
25311
  * delete-after-download.
@@ -24768,10 +25320,42 @@ method(object({
24768
25320
  */
24769
25321
  /** Playback-speed multiplier for the render (1 = realtime). */
24770
25322
  var ExportSpeedSchema = number().min(.25).max(32);
25323
+ /**
25324
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25325
+ *
25326
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25327
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25328
+ * playlist. Handing it absolute epochs would make every call site responsible
25329
+ * for the same subtraction, and the one that forgot would emit a filter that
25330
+ * selects nothing — silently, as a uniform timelapse.
25331
+ */
25332
+ var ExportDenseRangeSchema = object({
25333
+ fromSec: number().nonnegative(),
25334
+ toSec: number().nonnegative()
25335
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25336
+ /**
25337
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25338
+ * listed ranges and at the base `everyMs` everywhere else.
25339
+ *
25340
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25341
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25342
+ */
25343
+ var ExportDenseSchema = object({
25344
+ everyMs: number().int().positive(),
25345
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25346
+ });
24771
25347
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24772
25348
  var ExportTimelapseSchema = object({
24773
25349
  everyMs: number().int().positive(),
24774
- outputFps: number().int().min(1).max(60).optional()
25350
+ outputFps: number().int().min(1).max(60).optional(),
25351
+ /** Optional second, FASTER rate over the intervals that matter. */
25352
+ dense: ExportDenseSchema.optional()
25353
+ }).superRefine((v, ctx) => {
25354
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25355
+ code: ZodIssueCode.custom,
25356
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25357
+ path: ["dense", "everyMs"]
25358
+ });
24775
25359
  });
24776
25360
  /**
24777
25361
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24829,6 +25413,19 @@ var ExportDownloadSchema = object({
24829
25413
  url: string(),
24830
25414
  endpoints: array(string())
24831
25415
  });
25416
+ /**
25417
+ * A finished export's bytes, inline.
25418
+ *
25419
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25420
+ * against, so nobody has to infer it from the base64 length.
25421
+ */
25422
+ var ExportBytesSchema = object({
25423
+ base64: string(),
25424
+ contentType: string(),
25425
+ /** Suggested filename, extension included. */
25426
+ name: string(),
25427
+ bytes: number().int().nonnegative()
25428
+ });
24832
25429
  method(object({
24833
25430
  deviceId: number(),
24834
25431
  profile: string(),
@@ -24853,6 +25450,9 @@ method(object({
24853
25450
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
24854
25451
  kind: "query",
24855
25452
  auth: "protected"
25453
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25454
+ kind: "query",
25455
+ auth: "protected"
24856
25456
  });
24857
25457
  /**
24858
25458
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30367,6 +30967,12 @@ Object.freeze({
30367
30967
  addonId: null,
30368
30968
  access: "delete"
30369
30969
  },
30970
+ "osdManager.copyDeviceConfiguration": {
30971
+ capName: "osd-manager",
30972
+ capScope: "system",
30973
+ addonId: null,
30974
+ access: "create"
30975
+ },
30370
30976
  "osdManager.getConditionSupport": {
30371
30977
  capName: "osd-manager",
30372
30978
  capScope: "system",
@@ -30463,7 +31069,7 @@ Object.freeze({
30463
31069
  addonId: null,
30464
31070
  access: "create"
30465
31071
  },
30466
- "pipelineAnalytics.cancelMediaRelocate": {
31072
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30467
31073
  capName: "pipeline-analytics",
30468
31074
  capScope: "device",
30469
31075
  addonId: null,
@@ -30535,12 +31141,6 @@ Object.freeze({
30535
31141
  addonId: null,
30536
31142
  access: "view"
30537
31143
  },
30538
- "pipelineAnalytics.getMediaRelocateStatus": {
30539
- capName: "pipeline-analytics",
30540
- capScope: "device",
30541
- addonId: null,
30542
- access: "view"
30543
- },
30544
31144
  "pipelineAnalytics.getMotionEvents": {
30545
31145
  capName: "pipeline-analytics",
30546
31146
  capScope: "device",
@@ -30577,6 +31177,12 @@ Object.freeze({
30577
31177
  addonId: null,
30578
31178
  access: "view"
30579
31179
  },
31180
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31181
+ capName: "pipeline-analytics",
31182
+ capScope: "device",
31183
+ addonId: null,
31184
+ access: "view"
31185
+ },
30580
31186
  "pipelineAnalytics.getTrack": {
30581
31187
  capName: "pipeline-analytics",
30582
31188
  capScope: "device",
@@ -30655,6 +31261,12 @@ Object.freeze({
30655
31261
  addonId: null,
30656
31262
  access: "view"
30657
31263
  },
31264
+ "pipelineAnalytics.pauseForStorageMigration": {
31265
+ capName: "pipeline-analytics",
31266
+ capScope: "device",
31267
+ addonId: null,
31268
+ access: "create"
31269
+ },
30658
31270
  "pipelineAnalytics.proposeRetrainAnnotations": {
30659
31271
  capName: "pipeline-analytics",
30660
31272
  capScope: "device",
@@ -30685,7 +31297,7 @@ Object.freeze({
30685
31297
  addonId: null,
30686
31298
  access: "create"
30687
31299
  },
30688
- "pipelineAnalytics.relocateMedia": {
31300
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
30689
31301
  capName: "pipeline-analytics",
30690
31302
  capScope: "device",
30691
31303
  addonId: null,
@@ -30697,6 +31309,12 @@ Object.freeze({
30697
31309
  addonId: null,
30698
31310
  access: "create"
30699
31311
  },
31312
+ "pipelineAnalytics.resumeForStorageMigration": {
31313
+ capName: "pipeline-analytics",
31314
+ capScope: "device",
31315
+ addonId: null,
31316
+ access: "create"
31317
+ },
30700
31318
  "pipelineAnalytics.saveRetrainAnnotations": {
30701
31319
  capName: "pipeline-analytics",
30702
31320
  capScope: "device",
@@ -30721,6 +31339,12 @@ Object.freeze({
30721
31339
  addonId: null,
30722
31340
  access: "create"
30723
31341
  },
31342
+ "pipelineAnalytics.startStorageMigrationMove": {
31343
+ capName: "pipeline-analytics",
31344
+ capScope: "device",
31345
+ addonId: null,
31346
+ access: "create"
31347
+ },
30724
31348
  "pipelineAnalytics.wipeAllAnalytics": {
30725
31349
  capName: "pipeline-analytics",
30726
31350
  capScope: "device",
@@ -31087,6 +31711,12 @@ Object.freeze({
31087
31711
  addonId: null,
31088
31712
  access: "view"
31089
31713
  },
31714
+ "pipelineOrchestrator.pauseForStorageMigration": {
31715
+ capName: "pipeline-orchestrator",
31716
+ capScope: "system",
31717
+ addonId: null,
31718
+ access: "create"
31719
+ },
31090
31720
  "pipelineOrchestrator.rebalance": {
31091
31721
  capName: "pipeline-orchestrator",
31092
31722
  capScope: "system",
@@ -31111,6 +31741,12 @@ Object.freeze({
31111
31741
  addonId: null,
31112
31742
  access: "view"
31113
31743
  },
31744
+ "pipelineOrchestrator.resumeForStorageMigration": {
31745
+ capName: "pipeline-orchestrator",
31746
+ capScope: "system",
31747
+ addonId: null,
31748
+ access: "create"
31749
+ },
31114
31750
  "pipelineOrchestrator.saveTemplate": {
31115
31751
  capName: "pipeline-orchestrator",
31116
31752
  capScope: "system",
@@ -31507,7 +32143,13 @@ Object.freeze({
31507
32143
  addonId: null,
31508
32144
  access: "create"
31509
32145
  },
31510
- "recording.cancelRelocate": {
32146
+ "recording.cancelRelocateJob": {
32147
+ capName: "recording",
32148
+ capScope: "system",
32149
+ addonId: null,
32150
+ access: "create"
32151
+ },
32152
+ "recording.cancelStorageMigrationMove": {
31511
32153
  capName: "recording",
31512
32154
  capScope: "system",
31513
32155
  addonId: null,
@@ -31543,7 +32185,7 @@ Object.freeze({
31543
32185
  addonId: null,
31544
32186
  access: "view"
31545
32187
  },
31546
- "recording.getRelocateStatus": {
32188
+ "recording.getStorageMigrationMoveStatus": {
31547
32189
  capName: "recording",
31548
32190
  capScope: "system",
31549
32191
  addonId: null,
@@ -31561,12 +32203,30 @@ Object.freeze({
31561
32203
  addonId: null,
31562
32204
  access: "view"
31563
32205
  },
32206
+ "recording.listRelocateJobs": {
32207
+ capName: "recording",
32208
+ capScope: "system",
32209
+ addonId: null,
32210
+ access: "view"
32211
+ },
31564
32212
  "recording.locateSegment": {
31565
32213
  capName: "recording",
31566
32214
  capScope: "system",
31567
32215
  addonId: null,
31568
32216
  access: "view"
31569
32217
  },
32218
+ "recording.pauseForStorageMigration": {
32219
+ capName: "recording",
32220
+ capScope: "system",
32221
+ addonId: null,
32222
+ access: "create"
32223
+ },
32224
+ "recording.planStorageRebalance": {
32225
+ capName: "recording",
32226
+ capScope: "system",
32227
+ addonId: null,
32228
+ access: "view"
32229
+ },
31570
32230
  "recording.pruneFootage": {
31571
32231
  capName: "recording",
31572
32232
  capScope: "system",
@@ -31585,6 +32245,12 @@ Object.freeze({
31585
32245
  addonId: null,
31586
32246
  access: "view"
31587
32247
  },
32248
+ "recording.refreshStorageLocationsForMigration": {
32249
+ capName: "recording",
32250
+ capScope: "system",
32251
+ addonId: null,
32252
+ access: "create"
32253
+ },
31588
32254
  "recording.relocateFootage": {
31589
32255
  capName: "recording",
31590
32256
  capScope: "system",
@@ -31609,44 +32275,68 @@ Object.freeze({
31609
32275
  addonId: null,
31610
32276
  access: "create"
31611
32277
  },
32278
+ "recording.resumeForStorageMigration": {
32279
+ capName: "recording",
32280
+ capScope: "system",
32281
+ addonId: null,
32282
+ access: "create"
32283
+ },
31612
32284
  "recording.setDeviceConfig": {
31613
32285
  capName: "recording",
31614
32286
  capScope: "system",
31615
32287
  addonId: null,
31616
32288
  access: "create"
31617
32289
  },
32290
+ "recording.startStorageMigrationMove": {
32291
+ capName: "recording",
32292
+ capScope: "system",
32293
+ addonId: null,
32294
+ access: "create"
32295
+ },
32296
+ "recording.startStorageRebalance": {
32297
+ capName: "recording",
32298
+ capScope: "system",
32299
+ addonId: null,
32300
+ access: "create"
32301
+ },
31618
32302
  "recordingExport.cancelExport": {
31619
- capName: "recordingExport",
32303
+ capName: "recording-export",
31620
32304
  capScope: "system",
31621
32305
  addonId: null,
31622
32306
  access: "create"
31623
32307
  },
31624
32308
  "recordingExport.createExport": {
31625
- capName: "recordingExport",
32309
+ capName: "recording-export",
31626
32310
  capScope: "system",
31627
32311
  addonId: null,
31628
32312
  access: "create"
31629
32313
  },
31630
32314
  "recordingExport.deleteExport": {
31631
- capName: "recordingExport",
32315
+ capName: "recording-export",
31632
32316
  capScope: "system",
31633
32317
  addonId: null,
31634
32318
  access: "delete"
31635
32319
  },
31636
32320
  "recordingExport.getDownloadUrl": {
31637
- capName: "recordingExport",
32321
+ capName: "recording-export",
31638
32322
  capScope: "system",
31639
32323
  addonId: null,
31640
32324
  access: "view"
31641
32325
  },
31642
32326
  "recordingExport.getExport": {
31643
- capName: "recordingExport",
32327
+ capName: "recording-export",
31644
32328
  capScope: "system",
31645
32329
  addonId: null,
31646
32330
  access: "view"
31647
32331
  },
31648
32332
  "recordingExport.listExports": {
31649
- capName: "recordingExport",
32333
+ capName: "recording-export",
32334
+ capScope: "system",
32335
+ addonId: null,
32336
+ access: "view"
32337
+ },
32338
+ "recordingExport.readExportBytes": {
32339
+ capName: "recording-export",
31650
32340
  capScope: "system",
31651
32341
  addonId: null,
31652
32342
  access: "view"
@@ -32005,6 +32695,30 @@ Object.freeze({
32005
32695
  addonId: null,
32006
32696
  access: "view"
32007
32697
  },
32698
+ "storageMigration.cancel": {
32699
+ capName: "storage-migration",
32700
+ capScope: "system",
32701
+ addonId: null,
32702
+ access: "create"
32703
+ },
32704
+ "storageMigration.plan": {
32705
+ capName: "storage-migration",
32706
+ capScope: "system",
32707
+ addonId: null,
32708
+ access: "view"
32709
+ },
32710
+ "storageMigration.start": {
32711
+ capName: "storage-migration",
32712
+ capScope: "system",
32713
+ addonId: null,
32714
+ access: "create"
32715
+ },
32716
+ "storageMigration.status": {
32717
+ capName: "storage-migration",
32718
+ capScope: "system",
32719
+ addonId: null,
32720
+ access: "view"
32721
+ },
32008
32722
  "storageProvider.abortUpload": {
32009
32723
  capName: "storage-provider",
32010
32724
  capScope: "system",
@@ -32383,12 +33097,42 @@ Object.freeze({
32383
33097
  addonId: null,
32384
33098
  access: "create"
32385
33099
  },
33100
+ "terminalSession.adoptLegacyMonitor": {
33101
+ capName: "terminal-session",
33102
+ capScope: "system",
33103
+ addonId: null,
33104
+ access: "create"
33105
+ },
32386
33106
  "terminalSession.close": {
32387
33107
  capName: "terminal-session",
32388
33108
  capScope: "system",
32389
33109
  addonId: null,
32390
33110
  access: "create"
32391
33111
  },
33112
+ "terminalSession.createInstance": {
33113
+ capName: "terminal-session",
33114
+ capScope: "system",
33115
+ addonId: null,
33116
+ access: "create"
33117
+ },
33118
+ "terminalSession.deleteInstance": {
33119
+ capName: "terminal-session",
33120
+ capScope: "system",
33121
+ addonId: null,
33122
+ access: "delete"
33123
+ },
33124
+ "terminalSession.listInstances": {
33125
+ capName: "terminal-session",
33126
+ capScope: "system",
33127
+ addonId: null,
33128
+ access: "view"
33129
+ },
33130
+ "terminalSession.listLegacyCameras": {
33131
+ capName: "terminal-session",
33132
+ capScope: "system",
33133
+ addonId: null,
33134
+ access: "view"
33135
+ },
32392
33136
  "terminalSession.listProfiles": {
32393
33137
  capName: "terminal-session",
32394
33138
  capScope: "system",
@@ -32419,6 +33163,12 @@ Object.freeze({
32419
33163
  addonId: null,
32420
33164
  access: "create"
32421
33165
  },
33166
+ "terminalSession.setInstanceEnabled": {
33167
+ capName: "terminal-session",
33168
+ capScope: "system",
33169
+ addonId: null,
33170
+ access: "create"
33171
+ },
32422
33172
  "terminalSession.writeInput": {
32423
33173
  capName: "terminal-session",
32424
33174
  capScope: "system",
@@ -32963,6 +33713,104 @@ var FramerateField = number().int().min(1).max(60);
32963
33713
  var TargetsField = array(NcRuleTargetSchema).min(1);
32964
33714
  var PriorityField = number().int().min(1).max(5);
32965
33715
  /**
33716
+ * Explicit override of the DENSE sampling cadence, seconds.
33717
+ *
33718
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33719
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33720
+ * made that same base 3 s and rendered a person pass as two frames.)
33721
+ *
33722
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33723
+ * `denseCadenceSec` and played at `framerate` occupies
33724
+ *
33725
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33726
+ *
33727
+ * 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.
33728
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33729
+ * and therefore the length of a quiet night, does not move.
33730
+ *
33731
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33732
+ * the recording has them returns the same frames, requested twice. Must be
33733
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33734
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33735
+ * rather than letting the export cap reject the render hours after the window.
33736
+ */
33737
+ var DenseCadenceSecField = number().min(.1).max(3600);
33738
+ /**
33739
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33740
+ *
33741
+ * The operator-facing form of the arithmetic above: instead of solving for a
33742
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33743
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33744
+ * that range every ~583 ms.
33745
+ *
33746
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33747
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33748
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33749
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33750
+ * schema change and are the tracked follow-up.
33751
+ *
33752
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33753
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33754
+ * by real footage, never met by duplicating frames into motion that never
33755
+ * happened.
33756
+ */
33757
+ var MinDwellSecField = number().min(0).max(60);
33758
+ /**
33759
+ * Caption burned into the notification's preview frame.
33760
+ *
33761
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33762
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33763
+ * templating dialect for one field would be a second thing to explain.
33764
+ *
33765
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33766
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33767
+ * the reason this is not `.min(1)`.
33768
+ */
33769
+ var PreviewTextField = string().max(200);
33770
+ /**
33771
+ * Whether the notification's preview is a STILL or a short animation.
33772
+ *
33773
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33774
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33775
+ * night reads better as three seconds of motion than as one frame of it. Both
33776
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33777
+ * simply applies it to a dozen frames sampled across the render and assembles
33778
+ * them.
33779
+ *
33780
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33781
+ * seeks and a palette pass, and no rule that never asked for one should start
33782
+ * paying that on the deploy that shipped it.
33783
+ *
33784
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33785
+ */
33786
+ var PreviewModeField = _enum(["image", "gif"]);
33787
+ /**
33788
+ * Which detection classes the notification reports counts for.
33789
+ *
33790
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33791
+ * plan — no second query — aggregated per class. Absent or empty means "every
33792
+ * class the window actually contained", which is what an operator who never
33793
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33794
+ * counts cars all night).
33795
+ *
33796
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33797
+ * …). An unknown name simply never matches and reports nothing — it is not an
33798
+ * error, because a rule may legitimately name a class this camera's model does
33799
+ * not emit.
33800
+ *
33801
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33802
+ * - `{{detections}}` — total over the reported classes
33803
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33804
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33805
+ * one per class, `count_` + the class name
33806
+ *
33807
+ * With NO custom body template the summary is appended to the derived body, and
33808
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33809
+ * reads. With a custom template the operator owns every word — nothing is
33810
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33811
+ */
33812
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
33813
+ /**
32966
33814
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
32967
33815
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
32968
33816
  * here (see the ownership note above).
@@ -32982,9 +33830,30 @@ var TimelapseRuleInputSchema = object({
32982
33830
  cadenceSec: CadenceSecField.default(15),
32983
33831
  /** Output frames per second of the assembled mp4 (predecessor parity). */
32984
33832
  framerate: FramerateField.default(10),
33833
+ /**
33834
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33835
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33836
+ * field gets.
33837
+ */
33838
+ denseCadenceSec: DenseCadenceSecField.optional(),
33839
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33840
+ minDwellSec: MinDwellSecField.optional(),
32985
33841
  /** `notification-output` targets the finished video/thumbnail is sent to. */
32986
33842
  targets: TargetsField,
32987
33843
  template: TimelapseTemplateSchema.optional(),
33844
+ /**
33845
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33846
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33847
+ *
33848
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33849
+ * the notification's title/body, and clearing it (`template: null`) must not
33850
+ * silently clear the caption too.
33851
+ */
33852
+ previewText: PreviewTextField.optional(),
33853
+ /** Still or animation — see {@link PreviewModeField}. */
33854
+ previewMode: PreviewModeField.default("image"),
33855
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33856
+ reportClasses: ReportClassesField.optional(),
32988
33857
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
32989
33858
  priority: PriorityField.default(3)
32990
33859
  });
@@ -32995,8 +33864,13 @@ object({
32995
33864
  schedule: NcScheduleSchema.optional(),
32996
33865
  cadenceSec: CadenceSecField.optional(),
32997
33866
  framerate: FramerateField.optional(),
33867
+ denseCadenceSec: DenseCadenceSecField.optional(),
33868
+ minDwellSec: MinDwellSecField.optional(),
32998
33869
  targets: TargetsField.optional(),
32999
33870
  template: TimelapseTemplateSchema.nullable().optional(),
33871
+ previewText: PreviewTextField.optional(),
33872
+ previewMode: PreviewModeField.optional(),
33873
+ reportClasses: ReportClassesField.optional(),
33000
33874
  priority: PriorityField.optional()
33001
33875
  });
33002
33876
  TimelapseRuleInputSchema.extend({
@@ -33008,10 +33882,28 @@ TimelapseRuleInputSchema.extend({
33008
33882
  */
33009
33883
  ownerUserId: string().optional(),
33010
33884
  /**
33011
- * Epoch-ms of the last successful generation the 1-hour re-generation
33012
- * guard's durable state (predecessor parity). Absent = never generated.
33885
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33886
+ * rule. What a UI shows, and the compatibility floor for
33887
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33013
33888
  */
33014
33889
  lastGeneratedAt: number().optional(),
33890
+ /**
33891
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33892
+ * re-generation guard's real durable state.
33893
+ *
33894
+ * One rule covers several cameras and each renders its own video, so a rule
33895
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33896
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33897
+ * already done — and B's night is gone for good, because the window will not
33898
+ * come back.
33899
+ *
33900
+ * ADDITIVE, so the migration is free: a row written before this field simply
33901
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33902
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33903
+ * "never generated" would re-render and re-notify every camera of every rule
33904
+ * once, on the deploy that shipped the map.
33905
+ */
33906
+ generatedByDevice: record(string(), number()).optional(),
33015
33907
  /** userId of the caller who created the rule (server-stamped). */
33016
33908
  createdBy: string(),
33017
33909
  createdAt: number(),