@camstack/types 1.2.62 → 1.2.64

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.
package/dist/index.js CHANGED
@@ -584,6 +584,19 @@ function resolveRunnerId(decl, addonId) {
584
584
  function resolveAddonPlacement(decl) {
585
585
  return resolveAddonExecution(decl).placement;
586
586
  }
587
+ /**
588
+ * True when a `@camstack/system` builtin opted out of the in-process rule and
589
+ * must be planned as a forked runner (`execution.isolate`).
590
+ *
591
+ * ONE predicate, because the hub asks this question in three places that must
592
+ * agree: the runner plan (`buildAddonGroupPlan`), the "does this boot
593
+ * in-process" filter, and `isForkedAddonEntry` (which decides route mounts,
594
+ * data-plane mounts, restart and uninstall). They diverged once before for
595
+ * `auth-oidc` and the addon's routes were mounted against an async UDS proxy.
596
+ */
597
+ function isIsolatedBuiltin(decl) {
598
+ return decl.execution?.isolate === true;
599
+ }
587
600
  //#endregion
588
601
  //#region src/interfaces/adoption-job.ts
589
602
  /**
@@ -1675,7 +1688,15 @@ function deriveRecordingMode(config) {
1675
1688
  * Each completed/failed run also lands one durable ops-log row on its owning
1676
1689
  * addon surface.
1677
1690
  */
1691
+ /**
1692
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
1693
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
1694
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
1695
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
1696
+ * runs at all.
1697
+ */
1678
1698
  var RelocateJobStateSchema = zod.z.enum([
1699
+ "queued",
1679
1700
  "running",
1680
1701
  "done",
1681
1702
  "failed",
@@ -1710,6 +1731,15 @@ var RelocateFootageInputSchema = zod.z.object({
1710
1731
  /** Limits relocation to the logical profile class. Omit only for the
1711
1732
  * pre-orchestration compatibility path. */
1712
1733
  footageClass: RelocateFootageClassSchema.optional(),
1734
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
1735
+ * is what a whole-disk drain means. The rebalance path always sets it: its
1736
+ * unit is a (camera, profile) pile, not a disk. */
1737
+ deviceId: zod.z.number().int().optional(),
1738
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
1739
+ * Finer than `footageClass`, which cannot separate high from mid — and the
1740
+ * placement plan assigns those two independently, so a rebalance that could
1741
+ * only say "recordings" would move footage the plan never asked to move. */
1742
+ profiles: zod.z.array(zod.z.string()).optional(),
1713
1743
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
1714
1744
  * never allowed to starve live writers. */
1715
1745
  throttleMbps: zod.z.number().min(1).max(1e3).optional()
@@ -1857,6 +1887,21 @@ var StorageLocationSchema = zod.z.object({
1857
1887
  nodeId: zod.z.string().optional(),
1858
1888
  isDefault: zod.z.boolean().default(false),
1859
1889
  isSystem: zod.z.boolean().default(false),
1890
+ /**
1891
+ * Operator opt-in: whether consumers that BALANCE across several locations
1892
+ * of a type may write here. Recordings reads it today; event media and
1893
+ * backups are the next consumers, which is why the flag lives on the
1894
+ * location rather than in any one addon's store — nothing has to be
1895
+ * extended to add the next consumer.
1896
+ *
1897
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
1898
+ * flag existed reads back with no flag and keeps working exactly as before;
1899
+ * that is the whole compat story, and it is why no migration ships with it.
1900
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
1901
+ * disk must not silently start writing to it); the default of a type is
1902
+ * always stamped `true`.
1903
+ */
1904
+ enabled: zod.z.boolean().optional(),
1860
1905
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
1861
1906
  * for node-local locations it can reach) — never persisted, absent when the
1862
1907
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -9296,7 +9341,8 @@ var embeddingEncoderCapability = {
9296
9341
  //#region src/capabilities/filesystem-browse.cap.ts
9297
9342
  /**
9298
9343
  * filesystem-browse — per-node capability for browsing the node's local
9299
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
9344
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
9345
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
9300
9346
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
9301
9347
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
9302
9348
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -9317,9 +9363,9 @@ var filesystemBrowseCapability = {
9317
9363
  mode: "singleton",
9318
9364
  internal: true,
9319
9365
  methods: {
9320
- /** The allowed roots browsing is sandboxed to on this node. */
9366
+ /** The roots `createDir` is sandboxed to on this node. Browsing is not confined to them. */
9321
9367
  listAllowedRoots: require_sleep.method(zod.z.void(), zod.z.array(zod.z.string()).readonly(), { auth: "admin" }),
9322
- /** Immediate subdirectories of `path` (must be within an allowed root) + free/total bytes. */
9368
+ /** Immediate subdirectories of any absolute `path` + free/total bytes. Read-only. */
9323
9369
  browse: require_sleep.method(zod.z.object({ path: zod.z.string() }), BrowseResultSchema, { auth: "admin" }),
9324
9370
  /** Create a subdirectory (within an allowed root). Returns its absolute path. */
9325
9371
  createDir: require_sleep.method(zod.z.object({ path: zod.z.string() }), zod.z.object({ path: zod.z.string() }), {
@@ -11794,6 +11840,13 @@ var MaskGridDimsSchema = zod.z.object({
11794
11840
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
11795
11841
  * this one field keeps the schema additive — a rule still declares exactly
11796
11842
  * one trigger.
11843
+ *
11844
+ * AUDIO rules add no member here, for the reason occupancy added none: the
11845
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
11846
+ * mirror.ts` fails the build on a member the app cannot render) and every
11847
+ * member costs a release train. A sustained-sound rule is therefore an
11848
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
11849
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
11797
11850
  */
11798
11851
  var NcDeliverySchema = zod.z.enum([
11799
11852
  "immediate",
@@ -11808,16 +11861,51 @@ var NcDeliverySchema = zod.z.enum([
11808
11861
  * depend on a provider's raw event name or payload shape.
11809
11862
  */
11810
11863
  var NcSystemEventKindSchema = zod.z.enum([
11811
- "camera-online",
11812
- "camera-offline",
11864
+ "device-online",
11865
+ "device-offline",
11866
+ "device-disabled",
11867
+ "device-enabled",
11813
11868
  "stream-online",
11814
11869
  "stream-offline",
11815
11870
  "node-online",
11816
11871
  "node-offline",
11817
11872
  "addon-update-available",
11818
- "server-update-available"
11873
+ "server-update-available",
11874
+ "alarm-triggered",
11875
+ "alarm-armed",
11876
+ "alarm-disarmed",
11877
+ "camera-online",
11878
+ "camera-offline",
11879
+ "camera-disabled",
11880
+ "camera-enabled"
11881
+ ]);
11882
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
11883
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
11884
+ "camera-online",
11885
+ "camera-offline",
11886
+ "camera-disabled",
11887
+ "camera-enabled"
11819
11888
  ]);
11820
11889
  /**
11890
+ * The kinds a rule may be AUTHORED with — every schema member except the
11891
+ * legacy tail. Editors render THIS list; the schema still parses the tail so a
11892
+ * durable row (and an unmigrated rule) survives being read.
11893
+ */
11894
+ var NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
11895
+ /**
11896
+ * The panel's three transitions, as ONE list.
11897
+ *
11898
+ * Named here rather than spelled out at each of the four sites that need them
11899
+ * (the emitter, the intake, the editor group, the combined-notification gate),
11900
+ * because a fourth transition added to the enum and forgotten at one of them is
11901
+ * an alarm state nobody can be notified about.
11902
+ */
11903
+ var NC_ALARM_SYSTEM_EVENT_KINDS = [
11904
+ "alarm-triggered",
11905
+ "alarm-armed",
11906
+ "alarm-disarmed"
11907
+ ];
11908
+ /**
11821
11909
  * One coherent system-event condition. `kinds` is the required opt-in safety
11822
11910
  * gate; the remaining lists are optional narrowing filters relevant to the
11823
11911
  * selected kinds.
@@ -11825,6 +11913,18 @@ var NcSystemEventKindSchema = zod.z.enum([
11825
11913
  var NcSystemEventConditionSchema = zod.z.object({
11826
11914
  kinds: zod.z.array(NcSystemEventKindSchema).min(1),
11827
11915
  deviceIds: zod.z.array(zod.z.number().int()).min(1).optional(),
11916
+ /**
11917
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
11918
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
11919
+ * is what a liveness rule means when nobody said otherwise.
11920
+ *
11921
+ * This is where "only my cameras" is expressed, and it lives on the rule for
11922
+ * one reason: the intake cannot know which devices this household cares
11923
+ * about, and a producer-side filter is one no operator can change. Fails
11924
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
11925
+ * does not carry) matches no `deviceTypes` list.
11926
+ */
11927
+ deviceTypes: zod.z.array(zod.z.string().min(1)).min(1).optional(),
11828
11928
  nodeIds: zod.z.array(zod.z.string().min(1)).min(1).optional(),
11829
11929
  packageNames: zod.z.array(zod.z.string().min(1)).min(1).optional()
11830
11930
  });
@@ -11883,6 +11983,59 @@ var NcOccupancyConditionSchema = zod.z.object({
11883
11983
  sustainSeconds: zod.z.number().int().min(0).max(3600).default(15)
11884
11984
  });
11885
11985
  /**
11986
+ * The dBFS floor the analyzer reports on digital silence
11987
+ * (`audio-analyzer-provider.ts`: `dbfs = rms > 0 ? 20*log10(rms) : -96`).
11988
+ *
11989
+ * It is the lower bound of {@link NcAudioConditionSchema.shape.dbThreshold} for
11990
+ * one reason worth stating out loud: **the scale is dBFS and it is
11991
+ * NEGATIVE-GOING** — `0` is full scale and silence reads as a large negative
11992
+ * number. An operator (or a UI) that writes `60` meaning "60 decibels, quite
11993
+ * loud" would author a threshold NO sample can ever reach, and the rule would
11994
+ * look broken rather than mis-configured. The schema range rejects it instead.
11995
+ */
11996
+ var NC_AUDIO_DBFS_FLOOR = -96;
11997
+ /**
11998
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
11999
+ *
12000
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
12001
+ * reference notifier uses, so an operator moving between them re-uses what
12002
+ * they already know): a rule matches when, over a sampling window of
12003
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
12004
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
12005
+ *
12006
+ * - `dbThreshold` — its level is at or above this many dBFS (see
12007
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
12008
+ * - `labels` — the classifier put at least one of these labels on it.
12009
+ *
12010
+ * Both are OPTIONAL and independent, which is the point of the shape: a
12011
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
12012
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
12013
+ * is given** — a window in which every sample is trivially a hit would fire on
12014
+ * silence, so the engine refuses such a condition rather than notifying on
12015
+ * nothing (the schema cannot express "at least one of" without becoming a
12016
+ * ZodEffects the cap path would have to special-case).
12017
+ *
12018
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
12019
+ * must be FULL before it can match — a window that has been open for two
12020
+ * seconds of its ten is 100% of nothing, and firing on it would make
12021
+ * `samplingSeconds` decorative.
12022
+ *
12023
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
12024
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
12025
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
12026
+ * an operator who typed `dog` mean the same thing.
12027
+ */
12028
+ var NcAudioConditionSchema = zod.z.object({
12029
+ /** Audio macro labels; absent = any sound (level-only rule). */
12030
+ labels: zod.z.array(zod.z.string().min(1)).min(1).optional(),
12031
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
12032
+ dbThreshold: zod.z.number().min(-96).max(0).optional(),
12033
+ /** Percentage of the window's samples that must be hits (1–100). */
12034
+ hitPercent: zod.z.number().int().min(1).max(100).default(60),
12035
+ /** Length of the sampling window in seconds. */
12036
+ samplingSeconds: zod.z.number().int().min(1).max(300).default(10)
12037
+ });
12038
+ /**
11886
12039
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
11887
12040
  *
11888
12041
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -12166,7 +12319,33 @@ var NcConditionsSchema = zod.z.object({
12166
12319
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
12167
12320
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
12168
12321
  */
12169
- occupancy: NcOccupancyConditionSchema.optional()
12322
+ occupancy: NcOccupancyConditionSchema.optional(),
12323
+ /**
12324
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
12325
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
12326
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
12327
+ * a window that is not full yet, neither filter given). See
12328
+ * {@link NcAudioCondition}.
12329
+ *
12330
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
12331
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
12332
+ * a detection, a track or a device event (the same fail-closed pairing
12333
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
12334
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
12335
+ * (an `immediate` rule naming an `audio-*` class, one notification per
12336
+ * classified sample) stays exactly as it was for rules that already use it.
12337
+ *
12338
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
12339
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
12340
+ * (`camstack/src/data/notification-center.ts`, guarded by
12341
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
12342
+ * condition fields it does not know when a rule is saved from the phone.
12343
+ * Publishing an editor for a condition the app cannot round-trip is how an
12344
+ * operator loses a rule's conditions by opening it — so the descriptor, the
12345
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
12346
+ * does an audio rule become authorable.
12347
+ */
12348
+ audio: NcAudioConditionSchema.optional()
12170
12349
  });
12171
12350
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
12172
12351
  var NcRuleTargetSchema = zod.z.object({
@@ -12280,6 +12459,74 @@ var NcThrottleSchema = zod.z.object({
12280
12459
  */
12281
12460
  granularity: NcThrottleGranularitySchema.optional()
12282
12461
  });
12462
+ /**
12463
+ * How long the confirm gate may hold ONE notification, and how big the picture
12464
+ * it judges may be.
12465
+ *
12466
+ * The clamp is the product decision, not a coincidence of the model: p50 was
12467
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
12468
+ * arrives after the visitor has gone is not a notification. 448 px was enough
12469
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
12470
+ * tokens for pixels the model pools away.
12471
+ */
12472
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
12473
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
12474
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
12475
+ var NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = 448;
12476
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
12477
+ var NcConfirmExpectSchema = zod.z.object({
12478
+ op: zod.z.enum([
12479
+ ">=",
12480
+ ">",
12481
+ "<=",
12482
+ "<",
12483
+ "=="
12484
+ ]),
12485
+ count: zod.z.number().int().min(0).max(1e3)
12486
+ });
12487
+ /**
12488
+ * AI CONFIRM — a vision model looks at the picture this notification is about
12489
+ * to ship and says whether it agrees with the rule.
12490
+ *
12491
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
12492
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
12493
+ * on the operator's phone is not a verdict about this notification.
12494
+ *
12495
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
12496
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
12497
+ * the default and every fail-open is COUNTED, because a gate that always fails
12498
+ * open looks in the log exactly like a gate that works.
12499
+ *
12500
+ * Every field is `.optional()` rather than relied on as a Zod default at the
12501
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
12502
+ * production failures in one day), so the gate reads absent as the constant
12503
+ * above rather than trusting a parse it may never have seen.
12504
+ */
12505
+ var NcConfirmSchema = zod.z.object({
12506
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
12507
+ * same thing, and both mean "deliver exactly as before". */
12508
+ enabled: zod.z.boolean().default(false),
12509
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
12510
+ profileId: zod.z.string().optional(),
12511
+ /**
12512
+ * The operator's question, in his own words. Absent = a question derived
12513
+ * from the rule (its class and its expectation).
12514
+ *
12515
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
12516
+ * banners, signage and plates as instructions if you let them reach the
12517
+ * prompt — proven live — so the authoritative contract stays in the system
12518
+ * turn and only rule-authored words land here.
12519
+ */
12520
+ prompt: zod.z.string().max(1e3).optional(),
12521
+ /** Fire only when the model's count satisfies this. Absent = the model's
12522
+ * own boolean verdict decides. */
12523
+ expect: NcConfirmExpectSchema.optional(),
12524
+ timeoutMs: zod.z.number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
12525
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
12526
+ onTimeout: zod.z.enum(["fire", "suppress"]).default("fire"),
12527
+ /** Longest edge the judged image is downscaled to before it is sent. */
12528
+ maxImagePx: zod.z.number().int().min(64).max(2048).default(448)
12529
+ });
12283
12530
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
12284
12531
  var NcRuleInputSchema = zod.z.object({
12285
12532
  name: zod.z.string().min(1).max(200),
@@ -12340,7 +12587,13 @@ var NcRuleInputSchema = zod.z.object({
12340
12587
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
12341
12588
  * shape as every other actuation.
12342
12589
  */
12343
- actions: NcRuleActionsSchema.optional()
12590
+ actions: NcRuleActionsSchema.optional(),
12591
+ /**
12592
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
12593
+ * a rule that predates the gate must keep delivering byte-for-byte as it
12594
+ * did, and absent is the only way to say that without a migration.
12595
+ */
12596
+ confirm: NcConfirmSchema.optional()
12344
12597
  });
12345
12598
  /**
12346
12599
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -12351,7 +12604,37 @@ var NcRuleInputSchema = zod.z.object({
12351
12604
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
12352
12605
  * `updateRule` patch.
12353
12606
  */
12354
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: zod.z.array(zod.z.string()).optional() });
12607
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
12608
+ disabledTargetIds: zod.z.array(zod.z.string()).optional(),
12609
+ /**
12610
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
12611
+ *
12612
+ * It makes the key optional to SUPPLY; the parse still materialises the
12613
+ * default when the key is absent. And `NcRuleStore.update` merges with
12614
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
12615
+ * one — which made every partial edit destructive:
12616
+ *
12617
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
12618
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
12619
+ * setEnabled(ruleId, false) → conditions reset to `{}`
12620
+ *
12621
+ * A rule scoped to one camera and one zone silently became a rule that
12622
+ * matches EVERY event on EVERY camera, and lost its `media` policy
12623
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
12624
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
12625
+ * within a minute of a two-field patch.
12626
+ *
12627
+ * So every defaulted field is re-declared here WITHOUT its default. The
12628
+ * inner defaults still apply when the caller DOES send the key — `{}` for
12629
+ * conditions remains a real instruction ("clear them") — and only the
12630
+ * absent key is now genuinely absent.
12631
+ */
12632
+ enabled: zod.z.boolean().optional(),
12633
+ conditions: NcConditionsSchema.optional(),
12634
+ media: NcMediaPolicySchema.optional(),
12635
+ throttle: NcThrottleSchema.optional(),
12636
+ priority: zod.z.number().int().min(1).max(5).optional()
12637
+ });
12355
12638
  /** A persisted rule. */
12356
12639
  var NcRuleSchema = NcRuleInputSchema.extend({
12357
12640
  id: zod.z.string(),
@@ -12464,12 +12747,20 @@ var NC_CONDITION_CATALOG = [
12464
12747
  valueType: "systemEvent",
12465
12748
  options: [
12466
12749
  {
12467
- value: "camera-online",
12468
- label: "Camera online"
12750
+ value: "device-online",
12751
+ label: "Device online"
12752
+ },
12753
+ {
12754
+ value: "device-offline",
12755
+ label: "Device offline"
12469
12756
  },
12470
12757
  {
12471
- value: "camera-offline",
12472
- label: "Camera offline"
12758
+ value: "device-disabled",
12759
+ label: "Device switched off"
12760
+ },
12761
+ {
12762
+ value: "device-enabled",
12763
+ label: "Device switched on"
12473
12764
  },
12474
12765
  {
12475
12766
  value: "stream-online",
@@ -12494,12 +12785,24 @@ var NC_CONDITION_CATALOG = [
12494
12785
  {
12495
12786
  value: "server-update-available",
12496
12787
  label: "Server update available"
12788
+ },
12789
+ {
12790
+ value: "alarm-triggered",
12791
+ label: "Alarm triggered"
12792
+ },
12793
+ {
12794
+ value: "alarm-armed",
12795
+ label: "Alarm armed"
12796
+ },
12797
+ {
12798
+ value: "alarm-disarmed",
12799
+ label: "Alarm disarmed"
12497
12800
  }
12498
12801
  ],
12499
12802
  operator: "in",
12500
12803
  appliesTo: ["system-event"],
12501
12804
  phase: "P1",
12502
- description: "Infrastructure and update events. Optionally narrow camera/stream events by device, node events by node id, and addon updates by package name."
12805
+ description: "Infrastructure and update events. Device liveness covers EVERY device type — narrow it by device type (cameras only, say) and/or by device, node events by node id, and addon updates by package name."
12503
12806
  },
12504
12807
  {
12505
12808
  id: "devices",
@@ -13029,6 +13332,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
13029
13332
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
13030
13333
  * copy would lie the first time a rule is disabled.
13031
13334
  */
13335
+ /**
13336
+ * Why a device a mode NAMES is nonetheless not armed by it.
13337
+ *
13338
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
13339
+ * per-camera notification switch the Notification Center already owns,
13340
+ * `detection-off` is the device's own detection binding being inactive, and
13341
+ * `offline` is the device manager's liveness. A fourth reason would mean a
13342
+ * fourth authority, and inventing one here is how a panel starts disagreeing
13343
+ * with the switches the operator actually used.
13344
+ */
13345
+ var NcAlarmSkipReasonSchema = zod.z.enum([
13346
+ "muted",
13347
+ "detection-off",
13348
+ "offline"
13349
+ ]);
13350
+ var NcAlarmSkippedDeviceSchema = zod.z.object({
13351
+ deviceId: zod.z.number().int(),
13352
+ reason: NcAlarmSkipReasonSchema
13353
+ });
13032
13354
  var NcAlarmModeCoverageSchema = zod.z.object({
13033
13355
  mode: AlarmArmModeSchema,
13034
13356
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -13036,7 +13358,18 @@ var NcAlarmModeCoverageSchema = zod.z.object({
13036
13358
  /** At least one covering rule has no device scope, so the mode covers all. */
13037
13359
  allDevices: zod.z.boolean(),
13038
13360
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
13039
- deviceIds: zod.z.array(zod.z.number().int())
13361
+ deviceIds: zod.z.array(zod.z.number().int()),
13362
+ /**
13363
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
13364
+ * excludes it.
13365
+ *
13366
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
13367
+ * twelve makes it false in exactly the way nobody notices until an incident.
13368
+ * Defaulted to `[]` so a coverage answer computed before this field existed
13369
+ * still parses as "nothing known to be skipped" rather than failing the whole
13370
+ * alarm tab.
13371
+ */
13372
+ skippedDevices: zod.z.array(NcAlarmSkippedDeviceSchema).default([])
13040
13373
  });
13041
13374
  var NcAlarmConfigSchema = zod.z.object({
13042
13375
  /**
@@ -25605,7 +25938,19 @@ var RecordingManifestSchema = zod.z.object({
25605
25938
  * profiles/subtrees/locations on this node). */
25606
25939
  var RecordingDeviceUsageSchema = zod.z.object({
25607
25940
  deviceId: zod.z.number(),
25608
- usedBytes: zod.z.number()
25941
+ usedBytes: zod.z.number(),
25942
+ /**
25943
+ * Start of this camera's OLDEST indexed segment, across every profile and
25944
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25945
+ * only honest answer to "is retention actually holding?" per camera.
25946
+ *
25947
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25948
+ * predates this field omits it entirely, and a hub whose types carry the
25949
+ * field must keep validating that older provider's payload: the framework
25950
+ * (types) and the addon ship on different trains, and the addon is usually
25951
+ * the later of the two.
25952
+ */
25953
+ oldestMs: zod.z.number().nullable().optional()
25609
25954
  });
25610
25955
  /** Recording storage usage + capacity for one storage location. */
25611
25956
  var RecordingLocationUsageSchema = zod.z.object({
@@ -25633,6 +25978,57 @@ var RecordingStorageUsageSchema = zod.z.object({
25633
25978
  locations: zod.z.array(RecordingLocationUsageSchema)
25634
25979
  });
25635
25980
  /**
25981
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25982
+ *
25983
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25984
+ * is the operator asking for the EXISTING archive to be brought into line with
25985
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25986
+ * location, run FIFO behind the single-flight mover.
25987
+ *
25988
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25989
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25990
+ * (empty on the plan).
25991
+ */
25992
+ var RecordingRebalanceMoveSchema = zod.z.object({
25993
+ deviceId: zod.z.number(),
25994
+ profile: zod.z.string(),
25995
+ fromLocationId: zod.z.string(),
25996
+ toLocationId: zod.z.string(),
25997
+ bytes: zod.z.number(),
25998
+ files: zod.z.number().int()
25999
+ });
26000
+ /** Why a pile that is out of place is staying there. Every refusal is
26001
+ * reported: a rebalance that silently drops a camera reads exactly like one
26002
+ * that had nothing to do. */
26003
+ var RecordingRebalanceSkipReasonSchema = zod.z.enum([
26004
+ "unassigned",
26005
+ "target-not-writable",
26006
+ "below-threshold",
26007
+ "no-headroom"
26008
+ ]);
26009
+ var RecordingRebalanceSkipSchema = zod.z.object({
26010
+ deviceId: zod.z.number(),
26011
+ profile: zod.z.string(),
26012
+ fromLocationId: zod.z.string(),
26013
+ /** The location the plan wants; null when the camera has no assignment. */
26014
+ toLocationId: zod.z.string().nullable(),
26015
+ bytes: zod.z.number(),
26016
+ reason: RecordingRebalanceSkipReasonSchema
26017
+ });
26018
+ var RecordingRebalancePlanSchema = zod.z.object({
26019
+ moves: zod.z.array(RecordingRebalanceMoveSchema),
26020
+ skipped: zod.z.array(RecordingRebalanceSkipSchema),
26021
+ bytesToMove: zod.z.number(),
26022
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
26023
+ jobIds: zod.z.array(zod.z.string())
26024
+ });
26025
+ var RecordingRebalanceInputSchema = zod.z.object({
26026
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
26027
+ throttleMbps: zod.z.number().min(1).max(1e3).optional(),
26028
+ /** Ignore piles smaller than this (default 1 GB). */
26029
+ minMoveGb: zod.z.number().min(0).optional()
26030
+ });
26031
+ /**
25636
26032
  * Result of locating footage at a wall-clock instant for one device/profile.
25637
26033
  * `segment` carries the covering segment's window; `gap` reports the forward
25638
26034
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25876,6 +26272,36 @@ var recordingCapability = {
25876
26272
  cancelStorageMigrationMove: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
25877
26273
  kind: "mutation",
25878
26274
  auth: "admin"
26275
+ }),
26276
+ /**
26277
+ * Move footage between locations — the OPERATOR's mover, scoped to one
26278
+ * camera (and optionally to specific profiles) rather than a whole disk.
26279
+ * Queued FIFO behind the single-flight engine, so arming several is safe.
26280
+ */
26281
+ relocateFootage: require_sleep.method(RelocateFootageInputSchema, zod.z.object({ jobId: zod.z.string() }), {
26282
+ kind: "mutation",
26283
+ auth: "admin"
26284
+ }),
26285
+ /** Every relocate job this recorder knows about, newest first (in RAM: the
26286
+ * move is resumable, so a lost list costs nothing but the display). */
26287
+ listRelocateJobs: require_sleep.method(zod.z.object({}), zod.z.array(RelocateJobSchema).readonly(), {
26288
+ kind: "query",
26289
+ auth: "admin"
26290
+ }),
26291
+ /** Cancel a running or queued relocate job. A queued job never runs. */
26292
+ cancelRelocateJob: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
26293
+ kind: "mutation",
26294
+ auth: "admin"
26295
+ }),
26296
+ /** What a rebalance WOULD move, and what it would refuse. Moves nothing. */
26297
+ planStorageRebalance: require_sleep.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26298
+ kind: "query",
26299
+ auth: "admin"
26300
+ }),
26301
+ /** Arm the rebalance: enqueue one relocate job per planned move. */
26302
+ startStorageRebalance: require_sleep.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26303
+ kind: "mutation",
26304
+ auth: "admin"
25879
26305
  })
25880
26306
  }
25881
26307
  };
@@ -35823,6 +36249,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35823
36249
  addonId: null,
35824
36250
  access: "create"
35825
36251
  },
36252
+ "recording.cancelRelocateJob": {
36253
+ capName: "recording",
36254
+ capScope: "system",
36255
+ addonId: null,
36256
+ access: "create"
36257
+ },
35826
36258
  "recording.cancelStorageMigrationMove": {
35827
36259
  capName: "recording",
35828
36260
  capScope: "system",
@@ -35877,6 +36309,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35877
36309
  addonId: null,
35878
36310
  access: "view"
35879
36311
  },
36312
+ "recording.listRelocateJobs": {
36313
+ capName: "recording",
36314
+ capScope: "system",
36315
+ addonId: null,
36316
+ access: "view"
36317
+ },
35880
36318
  "recording.locateSegment": {
35881
36319
  capName: "recording",
35882
36320
  capScope: "system",
@@ -35889,6 +36327,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35889
36327
  addonId: null,
35890
36328
  access: "create"
35891
36329
  },
36330
+ "recording.planStorageRebalance": {
36331
+ capName: "recording",
36332
+ capScope: "system",
36333
+ addonId: null,
36334
+ access: "view"
36335
+ },
35892
36336
  "recording.pruneFootage": {
35893
36337
  capName: "recording",
35894
36338
  capScope: "system",
@@ -35913,6 +36357,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35913
36357
  addonId: null,
35914
36358
  access: "create"
35915
36359
  },
36360
+ "recording.relocateFootage": {
36361
+ capName: "recording",
36362
+ capScope: "system",
36363
+ addonId: null,
36364
+ access: "create"
36365
+ },
35916
36366
  "recording.renderClip": {
35917
36367
  capName: "recording",
35918
36368
  capScope: "system",
@@ -35949,6 +36399,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35949
36399
  addonId: null,
35950
36400
  access: "create"
35951
36401
  },
36402
+ "recording.startStorageRebalance": {
36403
+ capName: "recording",
36404
+ capScope: "system",
36405
+ addonId: null,
36406
+ access: "create"
36407
+ },
35952
36408
  "recordingExport.cancelExport": {
35953
36409
  capName: "recording-export",
35954
36410
  capScope: "system",
@@ -38116,7 +38572,12 @@ function createSystemProxy(api) {
38116
38572
  refreshStorageLocationsForMigration: (input) => dispatch("recording", "refreshStorageLocationsForMigration", "mutation", input),
38117
38573
  startStorageMigrationMove: (input) => dispatch("recording", "startStorageMigrationMove", "mutation", input),
38118
38574
  getStorageMigrationMoveStatus: (input) => dispatch("recording", "getStorageMigrationMoveStatus", "query", input),
38119
- cancelStorageMigrationMove: (input) => dispatch("recording", "cancelStorageMigrationMove", "mutation", input)
38575
+ cancelStorageMigrationMove: (input) => dispatch("recording", "cancelStorageMigrationMove", "mutation", input),
38576
+ relocateFootage: (input) => dispatch("recording", "relocateFootage", "mutation", input),
38577
+ listRelocateJobs: (input) => dispatch("recording", "listRelocateJobs", "query", input),
38578
+ cancelRelocateJob: (input) => dispatch("recording", "cancelRelocateJob", "mutation", input),
38579
+ planStorageRebalance: (input) => dispatch("recording", "planStorageRebalance", "query", input),
38580
+ startStorageRebalance: (input) => dispatch("recording", "startStorageRebalance", "mutation", input)
38120
38581
  },
38121
38582
  recordingExport: {
38122
38583
  getExport: (input) => dispatch("recordingExport", "getExport", "query", input),
@@ -38678,6 +39139,111 @@ var FramerateField = zod.z.number().int().min(1).max(60);
38678
39139
  var TargetsField = zod.z.array(NcRuleTargetSchema).min(1);
38679
39140
  var PriorityField = zod.z.number().int().min(1).max(5);
38680
39141
  /**
39142
+ * Floor on any dense cadence, seconds — the recording's own frame interval.
39143
+ *
39144
+ * Declared here because it bounds BOTH the rule field and the renderer's
39145
+ * derivation, and two copies of a floor are two floors that can drift.
39146
+ */
39147
+ var TIMELAPSE_DENSE_FLOOR_SEC = .1;
39148
+ /**
39149
+ * Explicit override of the DENSE sampling cadence, seconds.
39150
+ *
39151
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
39152
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
39153
+ * made that same base 3 s and rendered a person pass as two frames.)
39154
+ *
39155
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
39156
+ * `denseCadenceSec` and played at `framerate` occupies
39157
+ *
39158
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
39159
+ *
39160
+ * 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.
39161
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
39162
+ * and therefore the length of a quiet night, does not move.
39163
+ *
39164
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
39165
+ * the recording has them returns the same frames, requested twice. Must be
39166
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
39167
+ * a uniform video the operator believes is two-rate — and upsert refuses it
39168
+ * rather than letting the export cap reject the render hours after the window.
39169
+ */
39170
+ var DenseCadenceSecField = zod.z.number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
39171
+ /**
39172
+ * Minimum seconds of OUTPUT video each detection range must occupy.
39173
+ *
39174
+ * The operator-facing form of the arithmetic above: instead of solving for a
39175
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
39176
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
39177
+ * that range every ~583 ms.
39178
+ *
39179
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
39180
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
39181
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
39182
+ * ranges are sampled denser than they need. Per-range cadences require a cap
39183
+ * schema change and are the tracked follow-up.
39184
+ *
39185
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
39186
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
39187
+ * by real footage, never met by duplicating frames into motion that never
39188
+ * happened.
39189
+ */
39190
+ var MinDwellSecField = zod.z.number().min(0).max(60);
39191
+ /**
39192
+ * Caption burned into the notification's preview frame.
39193
+ *
39194
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
39195
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
39196
+ * templating dialect for one field would be a second thing to explain.
39197
+ *
39198
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
39199
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
39200
+ * the reason this is not `.min(1)`.
39201
+ */
39202
+ var PreviewTextField = zod.z.string().max(200);
39203
+ /**
39204
+ * Whether the notification's preview is a STILL or a short animation.
39205
+ *
39206
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
39207
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
39208
+ * night reads better as three seconds of motion than as one frame of it. Both
39209
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
39210
+ * simply applies it to a dozen frames sampled across the render and assembles
39211
+ * them.
39212
+ *
39213
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
39214
+ * seeks and a palette pass, and no rule that never asked for one should start
39215
+ * paying that on the deploy that shipped it.
39216
+ *
39217
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
39218
+ */
39219
+ var PreviewModeField = zod.z.enum(["image", "gif"]);
39220
+ /**
39221
+ * Which detection classes the notification reports counts for.
39222
+ *
39223
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
39224
+ * plan — no second query — aggregated per class. Absent or empty means "every
39225
+ * class the window actually contained", which is what an operator who never
39226
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
39227
+ * counts cars all night).
39228
+ *
39229
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
39230
+ * …). An unknown name simply never matches and reports nothing — it is not an
39231
+ * error, because a rule may legitimately name a class this camera's model does
39232
+ * not emit.
39233
+ *
39234
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
39235
+ * - `{{detections}}` — total over the reported classes
39236
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
39237
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
39238
+ * one per class, `count_` + the class name
39239
+ *
39240
+ * With NO custom body template the summary is appended to the derived body, and
39241
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
39242
+ * reads. With a custom template the operator owns every word — nothing is
39243
+ * appended, so `{{detectionSummary}}` is how he asks for it.
39244
+ */
39245
+ var ReportClassesField = zod.z.array(zod.z.string().min(1).max(40)).max(20);
39246
+ /**
38681
39247
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
38682
39248
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
38683
39249
  * here (see the ownership note above).
@@ -38697,13 +39263,42 @@ var TimelapseRuleInputSchema = zod.z.object({
38697
39263
  cadenceSec: CadenceSecField.default(15),
38698
39264
  /** Output frames per second of the assembled mp4 (predecessor parity). */
38699
39265
  framerate: FramerateField.default(10),
39266
+ /**
39267
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
39268
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
39269
+ * field gets.
39270
+ */
39271
+ denseCadenceSec: DenseCadenceSecField.optional(),
39272
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
39273
+ minDwellSec: MinDwellSecField.optional(),
38700
39274
  /** `notification-output` targets the finished video/thumbnail is sent to. */
38701
39275
  targets: TargetsField,
38702
39276
  template: TimelapseTemplateSchema.optional(),
39277
+ /**
39278
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
39279
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
39280
+ *
39281
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
39282
+ * the notification's title/body, and clearing it (`template: null`) must not
39283
+ * silently clear the caption too.
39284
+ */
39285
+ previewText: PreviewTextField.optional(),
39286
+ /** Still or animation — see {@link PreviewModeField}. */
39287
+ previewMode: PreviewModeField.default("image"),
39288
+ /** Classes the notification counts — see {@link ReportClassesField}. */
39289
+ reportClasses: ReportClassesField.optional(),
38703
39290
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
38704
39291
  priority: PriorityField.default(3)
38705
39292
  });
38706
39293
  /**
39294
+ * The caption a rule that never set one gets.
39295
+ *
39296
+ * Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
39297
+ * before this field existed still reads "Timelapse Videocamera ingresso" and
39298
+ * not the literal braces.
39299
+ */
39300
+ var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
39301
+ /**
38707
39302
  * Partial patch for an update — any subset of the INPUT fields, with NO
38708
39303
  * defaults (an absent key means "leave unchanged", never "reset to default").
38709
39304
  * Provenance and ownership are absent by construction: a patch can rename or
@@ -38726,8 +39321,13 @@ var TimelapseRulePatchSchema = zod.z.object({
38726
39321
  schedule: NcScheduleSchema.optional(),
38727
39322
  cadenceSec: CadenceSecField.optional(),
38728
39323
  framerate: FramerateField.optional(),
39324
+ denseCadenceSec: DenseCadenceSecField.optional(),
39325
+ minDwellSec: MinDwellSecField.optional(),
38729
39326
  targets: TargetsField.optional(),
38730
39327
  template: TimelapseTemplateSchema.nullable().optional(),
39328
+ previewText: PreviewTextField.optional(),
39329
+ previewMode: PreviewModeField.optional(),
39330
+ reportClasses: ReportClassesField.optional(),
38731
39331
  priority: PriorityField.optional()
38732
39332
  });
38733
39333
  /** A persisted timelapse rule. */
@@ -38768,6 +39368,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
38768
39368
  updatedAt: zod.z.number()
38769
39369
  });
38770
39370
  /**
39371
+ * Refuse a dense cadence that is not denser than the base.
39372
+ *
39373
+ * Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
39374
+ * alone can invalidate a `denseCadenceSec` set months earlier, so checking the
39375
+ * patch in isolation would let the bad pair through.
39376
+ *
39377
+ * Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
39378
+ * also rejects the pair, but it does so when the window has already closed and
39379
+ * the footage is being cut — the operator learns at 06:05 that last night was
39380
+ * never going to render, and a closed window does not come back. This turns
39381
+ * that into a failed edit he can see and correct.
39382
+ *
39383
+ * @throws Error naming both numbers, so the message is actionable in a toast.
39384
+ */
39385
+ function assertTimelapseCadences(pair) {
39386
+ const dense = pair.denseCadenceSec;
39387
+ if (dense === void 0) return;
39388
+ if (dense >= pair.cadenceSec) throw new Error(`denseCadenceSec (${dense}s) must be strictly smaller than cadenceSec (${pair.cadenceSec}s) — a dense cadence that is not denser renders a uniform timelapse`);
39389
+ }
39390
+ /**
38771
39391
  * The last successful generation for ONE camera of a rule, epoch-ms.
38772
39392
  *
38773
39393
  * The per-device map wins; a rule with no map falls back to the rule-wide
@@ -40736,6 +41356,7 @@ exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
40736
41356
  exports.DEFAULT_NATIVE_LEASE_SETTINGS = DEFAULT_NATIVE_LEASE_SETTINGS;
40737
41357
  exports.DEFAULT_RETENTION = DEFAULT_RETENTION;
40738
41358
  exports.DEFAULT_SCRUB_THUMBNAIL_PRESET = DEFAULT_SCRUB_THUMBNAIL_PRESET;
41359
+ exports.DEFAULT_TIMELAPSE_PREVIEW_TEXT = DEFAULT_TIMELAPSE_PREVIEW_TEXT;
40739
41360
  exports.DETAIL_CROP_PADDING_FIELD = DETAIL_CROP_PADDING_FIELD;
40740
41361
  exports.DETAIL_CROP_PADDING_KEY = DETAIL_CROP_PADDING_KEY;
40741
41362
  exports.DETAIL_CROP_SECTION_ID = DETAIL_CROP_SECTION_ID;
@@ -40979,8 +41600,15 @@ exports.NATIVE_LEASE_BUDGET_KEY = NATIVE_LEASE_BUDGET_KEY;
40979
41600
  exports.NATIVE_LEASE_SECTION_ID = NATIVE_LEASE_SECTION_ID;
40980
41601
  exports.NATIVE_LEASE_TTL_FIELD = NATIVE_LEASE_TTL_FIELD;
40981
41602
  exports.NATIVE_LEASE_TTL_KEY = NATIVE_LEASE_TTL_KEY;
41603
+ exports.NC_ALARM_SYSTEM_EVENT_KINDS = NC_ALARM_SYSTEM_EVENT_KINDS;
41604
+ exports.NC_AUDIO_DBFS_FLOOR = NC_AUDIO_DBFS_FLOOR;
41605
+ exports.NC_AUTHORABLE_SYSTEM_EVENT_KINDS = NC_AUTHORABLE_SYSTEM_EVENT_KINDS;
40982
41606
  exports.NC_BASE_CONDITION_KEYS = NC_BASE_CONDITION_KEYS;
40983
41607
  exports.NC_CONDITION_CATALOG = NC_CONDITION_CATALOG;
41608
+ exports.NC_CONFIRM_DEFAULT_MAX_IMAGE_PX = NC_CONFIRM_DEFAULT_MAX_IMAGE_PX;
41609
+ exports.NC_CONFIRM_DEFAULT_TIMEOUT_MS = NC_CONFIRM_DEFAULT_TIMEOUT_MS;
41610
+ exports.NC_CONFIRM_MAX_TIMEOUT_MS = NC_CONFIRM_MAX_TIMEOUT_MS;
41611
+ exports.NC_CONFIRM_MIN_TIMEOUT_MS = NC_CONFIRM_MIN_TIMEOUT_MS;
40984
41612
  exports.NC_HISTORY_LIMIT_DEFAULT = NC_HISTORY_LIMIT_DEFAULT;
40985
41613
  exports.NC_HISTORY_LIMIT_MAX = NC_HISTORY_LIMIT_MAX;
40986
41614
  exports.NC_MAX_PER_TRACK_IMMEDIATE = NC_MAX_PER_TRACK_IMMEDIATE;
@@ -40999,8 +41627,13 @@ exports.NcAlarmConfigSchema = NcAlarmConfigSchema;
40999
41627
  exports.NcAlarmModeCoverageSchema = NcAlarmModeCoverageSchema;
41000
41628
  exports.NcAlarmSettingsPatchSchema = NcAlarmSettingsPatchSchema;
41001
41629
  exports.NcAlarmSettingsSchema = NcAlarmSettingsSchema;
41630
+ exports.NcAlarmSkipReasonSchema = NcAlarmSkipReasonSchema;
41631
+ exports.NcAlarmSkippedDeviceSchema = NcAlarmSkippedDeviceSchema;
41632
+ exports.NcAudioConditionSchema = NcAudioConditionSchema;
41002
41633
  exports.NcConditionDescriptorSchema = NcConditionDescriptorSchema;
41003
41634
  exports.NcConditionsSchema = NcConditionsSchema;
41635
+ exports.NcConfirmExpectSchema = NcConfirmExpectSchema;
41636
+ exports.NcConfirmSchema = NcConfirmSchema;
41004
41637
  exports.NcCrossingSchema = NcCrossingSchema;
41005
41638
  exports.NcDeliverySchema = NcDeliverySchema;
41006
41639
  exports.NcDeviceStateConditionSchema = NcDeviceStateConditionSchema;
@@ -41141,6 +41774,11 @@ exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
41141
41774
  exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;
41142
41775
  exports.RecordingManifestSchema = RecordingManifestSchema;
41143
41776
  exports.RecordingRangeSchema = RecordingRangeSchema;
41777
+ exports.RecordingRebalanceInputSchema = RecordingRebalanceInputSchema;
41778
+ exports.RecordingRebalanceMoveSchema = RecordingRebalanceMoveSchema;
41779
+ exports.RecordingRebalancePlanSchema = RecordingRebalancePlanSchema;
41780
+ exports.RecordingRebalanceSkipReasonSchema = RecordingRebalanceSkipReasonSchema;
41781
+ exports.RecordingRebalanceSkipSchema = RecordingRebalanceSkipSchema;
41144
41782
  exports.RecordingRetentionSchema = RecordingRetentionSchema;
41145
41783
  exports.RecordingStatusSchema = RecordingStatusSchema;
41146
41784
  exports.RecordingStorageModeSchema = RecordingStorageModeSchema;
@@ -41270,6 +41908,7 @@ exports.SwitchStatusSchema = SwitchStatusSchema;
41270
41908
  exports.SystemMetricsSchema = SystemMetricsSchema;
41271
41909
  exports.SystemMirror = SystemMirror;
41272
41910
  exports.TAXONOMY_COLORS = TAXONOMY_COLORS;
41911
+ exports.TIMELAPSE_DENSE_FLOOR_SEC = TIMELAPSE_DENSE_FLOOR_SEC;
41273
41912
  exports.TIMEZONES = TIMEZONES;
41274
41913
  exports.TRANSCODE_DOWN_MAX_BITRATE_KBPS = TRANSCODE_DOWN_MAX_BITRATE_KBPS;
41275
41914
  exports.TRANSCODE_DOWN_MAX_HEIGHT = TRANSCODE_DOWN_MAX_HEIGHT;
@@ -41384,6 +42023,7 @@ exports.asJsonArray = require_sleep.asJsonArray;
41384
42023
  exports.asJsonObject = require_sleep.asJsonObject;
41385
42024
  exports.asNumber = require_sleep.asNumber;
41386
42025
  exports.asString = require_sleep.asString;
42026
+ exports.assertTimelapseCadences = assertTimelapseCadences;
41387
42027
  exports.audioAnalysisCapability = audioAnalysisCapability;
41388
42028
  exports.audioAnalyzerCapability = audioAnalyzerCapability;
41389
42029
  exports.audioCodecCapability = audioCodecCapability;
@@ -41531,6 +42171,7 @@ exports.isDeployableToAgent = isDeployableToAgent;
41531
42171
  exports.isDeviceConfigCap = require_sleep.isDeviceConfigCap;
41532
42172
  exports.isDeviceScopedCap = require_sleep.isDeviceScopedCap;
41533
42173
  exports.isEvent = require_sleep.isEvent;
42174
+ exports.isIsolatedBuiltin = isIsolatedBuiltin;
41534
42175
  exports.isNode = isNode;
41535
42176
  exports.isObjectInput = isObjectInput;
41536
42177
  exports.isSameAddonId = isSameAddonId;