@camstack/addon-post-analysis 1.2.66 → 1.2.68

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.
@@ -7576,6 +7576,13 @@ var CameraSwitchGroupSchema = object({
7576
7576
  fetchedAt: number()
7577
7577
  });
7578
7578
  /**
7579
+ * The wrapper capability each wrapper-backed switch controls. Named constants
7580
+ * because the same strings appear in `legacy-migrations.ts`, in
7581
+ * `isCapActiveForDevice` call sites and in the fake harness — a typo in any of
7582
+ * them is a switch that silently writes a binding nobody reads.
7583
+ */
7584
+ var DETECTION_PIPELINE_CAP_NAME = "detection-pipeline";
7585
+ /**
7579
7586
  * Ops-log — the durable, append-only operations audit shared by the
7580
7587
  * recordings and events management surfaces.
7581
7588
  *
@@ -7800,7 +7807,15 @@ function deriveRecordingMode(config) {
7800
7807
  * Each completed/failed run also lands one durable ops-log row on its owning
7801
7808
  * addon surface.
7802
7809
  */
7810
+ /**
7811
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7812
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7813
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7814
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7815
+ * runs at all.
7816
+ */
7803
7817
  var RelocateJobStateSchema = _enum([
7818
+ "queued",
7804
7819
  "running",
7805
7820
  "done",
7806
7821
  "failed",
@@ -7835,6 +7850,15 @@ var RelocateFootageInputSchema = object({
7835
7850
  /** Limits relocation to the logical profile class. Omit only for the
7836
7851
  * pre-orchestration compatibility path. */
7837
7852
  footageClass: RelocateFootageClassSchema.optional(),
7853
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7854
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7855
+ * unit is a (camera, profile) pile, not a disk. */
7856
+ deviceId: number().int().optional(),
7857
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7858
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7859
+ * placement plan assigns those two independently, so a rebalance that could
7860
+ * only say "recordings" would move footage the plan never asked to move. */
7861
+ profiles: array(string()).optional(),
7838
7862
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7839
7863
  * never allowed to starve live writers. */
7840
7864
  throttleMbps: number().min(1).max(1e3).optional()
@@ -14393,6 +14417,13 @@ var MaskGridDimsSchema = object({
14393
14417
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14394
14418
  * this one field keeps the schema additive — a rule still declares exactly
14395
14419
  * one trigger.
14420
+ *
14421
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14422
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14423
+ * mirror.ts` fails the build on a member the app cannot render) and every
14424
+ * member costs a release train. A sustained-sound rule is therefore an
14425
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14426
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14396
14427
  */
14397
14428
  var NcDeliverySchema = _enum([
14398
14429
  "immediate",
@@ -14407,15 +14438,32 @@ var NcDeliverySchema = _enum([
14407
14438
  * depend on a provider's raw event name or payload shape.
14408
14439
  */
14409
14440
  var NcSystemEventKindSchema = _enum([
14410
- "camera-online",
14411
- "camera-offline",
14441
+ "device-online",
14442
+ "device-offline",
14443
+ "device-disabled",
14444
+ "device-enabled",
14412
14445
  "stream-online",
14413
14446
  "stream-offline",
14414
14447
  "node-online",
14415
14448
  "node-offline",
14416
14449
  "addon-update-available",
14417
- "server-update-available"
14450
+ "server-update-available",
14451
+ "alarm-triggered",
14452
+ "alarm-armed",
14453
+ "alarm-disarmed",
14454
+ "camera-online",
14455
+ "camera-offline",
14456
+ "camera-disabled",
14457
+ "camera-enabled"
14418
14458
  ]);
14459
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14460
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14461
+ "camera-online",
14462
+ "camera-offline",
14463
+ "camera-disabled",
14464
+ "camera-enabled"
14465
+ ]);
14466
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14419
14467
  /**
14420
14468
  * One coherent system-event condition. `kinds` is the required opt-in safety
14421
14469
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14424,6 +14472,18 @@ var NcSystemEventKindSchema = _enum([
14424
14472
  var NcSystemEventConditionSchema = object({
14425
14473
  kinds: array(NcSystemEventKindSchema).min(1),
14426
14474
  deviceIds: array(number().int()).min(1).optional(),
14475
+ /**
14476
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14477
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14478
+ * is what a liveness rule means when nobody said otherwise.
14479
+ *
14480
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14481
+ * one reason: the intake cannot know which devices this household cares
14482
+ * about, and a producer-side filter is one no operator can change. Fails
14483
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14484
+ * does not carry) matches no `deviceTypes` list.
14485
+ */
14486
+ deviceTypes: array(string().min(1)).min(1).optional(),
14427
14487
  nodeIds: array(string().min(1)).min(1).optional(),
14428
14488
  packageNames: array(string().min(1)).min(1).optional()
14429
14489
  });
@@ -14474,6 +14534,47 @@ var NcOccupancyConditionSchema = object({
14474
14534
  sustainSeconds: number().int().min(0).max(3600).default(15)
14475
14535
  });
14476
14536
  /**
14537
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14538
+ *
14539
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14540
+ * reference notifier uses, so an operator moving between them re-uses what
14541
+ * they already know): a rule matches when, over a sampling window of
14542
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14543
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14544
+ *
14545
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14546
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14547
+ * - `labels` — the classifier put at least one of these labels on it.
14548
+ *
14549
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14550
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14551
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14552
+ * is given** — a window in which every sample is trivially a hit would fire on
14553
+ * silence, so the engine refuses such a condition rather than notifying on
14554
+ * nothing (the schema cannot express "at least one of" without becoming a
14555
+ * ZodEffects the cap path would have to special-case).
14556
+ *
14557
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14558
+ * must be FULL before it can match — a window that has been open for two
14559
+ * seconds of its ten is 100% of nothing, and firing on it would make
14560
+ * `samplingSeconds` decorative.
14561
+ *
14562
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14563
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14564
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14565
+ * an operator who typed `dog` mean the same thing.
14566
+ */
14567
+ var NcAudioConditionSchema = object({
14568
+ /** Audio macro labels; absent = any sound (level-only rule). */
14569
+ labels: array(string().min(1)).min(1).optional(),
14570
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14571
+ dbThreshold: number().min(-96).max(0).optional(),
14572
+ /** Percentage of the window's samples that must be hits (1–100). */
14573
+ hitPercent: number().int().min(1).max(100).default(60),
14574
+ /** Length of the sampling window in seconds. */
14575
+ samplingSeconds: number().int().min(1).max(300).default(10)
14576
+ });
14577
+ /**
14477
14578
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14478
14579
  *
14479
14580
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14746,7 +14847,33 @@ var NcConditionsSchema = object({
14746
14847
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14747
14848
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14748
14849
  */
14749
- occupancy: NcOccupancyConditionSchema.optional()
14850
+ occupancy: NcOccupancyConditionSchema.optional(),
14851
+ /**
14852
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14853
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14854
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14855
+ * a window that is not full yet, neither filter given). See
14856
+ * {@link NcAudioCondition}.
14857
+ *
14858
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14859
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14860
+ * a detection, a track or a device event (the same fail-closed pairing
14861
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14862
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14863
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14864
+ * classified sample) stays exactly as it was for rules that already use it.
14865
+ *
14866
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14867
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14868
+ * (`camstack/src/data/notification-center.ts`, guarded by
14869
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14870
+ * condition fields it does not know when a rule is saved from the phone.
14871
+ * Publishing an editor for a condition the app cannot round-trip is how an
14872
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14873
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14874
+ * does an audio rule become authorable.
14875
+ */
14876
+ audio: NcAudioConditionSchema.optional()
14750
14877
  });
14751
14878
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14752
14879
  var NcRuleTargetSchema = object({
@@ -14860,6 +14987,73 @@ var NcThrottleSchema = object({
14860
14987
  */
14861
14988
  granularity: NcThrottleGranularitySchema.optional()
14862
14989
  });
14990
+ /**
14991
+ * How long the confirm gate may hold ONE notification, and how big the picture
14992
+ * it judges may be.
14993
+ *
14994
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14995
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14996
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14997
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14998
+ * tokens for pixels the model pools away.
14999
+ */
15000
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15001
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15002
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15003
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15004
+ var NcConfirmExpectSchema = object({
15005
+ op: _enum([
15006
+ ">=",
15007
+ ">",
15008
+ "<=",
15009
+ "<",
15010
+ "=="
15011
+ ]),
15012
+ count: number().int().min(0).max(1e3)
15013
+ });
15014
+ /**
15015
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15016
+ * to ship and says whether it agrees with the rule.
15017
+ *
15018
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15019
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15020
+ * on the operator's phone is not a verdict about this notification.
15021
+ *
15022
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15023
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15024
+ * the default and every fail-open is COUNTED, because a gate that always fails
15025
+ * open looks in the log exactly like a gate that works.
15026
+ *
15027
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15028
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15029
+ * production failures in one day), so the gate reads absent as the constant
15030
+ * above rather than trusting a parse it may never have seen.
15031
+ */
15032
+ var NcConfirmSchema = object({
15033
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15034
+ * same thing, and both mean "deliver exactly as before". */
15035
+ enabled: boolean().default(false),
15036
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15037
+ profileId: string().optional(),
15038
+ /**
15039
+ * The operator's question, in his own words. Absent = a question derived
15040
+ * from the rule (its class and its expectation).
15041
+ *
15042
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15043
+ * banners, signage and plates as instructions if you let them reach the
15044
+ * prompt — proven live — so the authoritative contract stays in the system
15045
+ * turn and only rule-authored words land here.
15046
+ */
15047
+ prompt: string().max(1e3).optional(),
15048
+ /** Fire only when the model's count satisfies this. Absent = the model's
15049
+ * own boolean verdict decides. */
15050
+ expect: NcConfirmExpectSchema.optional(),
15051
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15052
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15053
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15054
+ /** Longest edge the judged image is downscaled to before it is sent. */
15055
+ maxImagePx: number().int().min(64).max(2048).default(448)
15056
+ });
14863
15057
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14864
15058
  var NcRuleInputSchema = object({
14865
15059
  name: string().min(1).max(200),
@@ -14920,7 +15114,13 @@ var NcRuleInputSchema = object({
14920
15114
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14921
15115
  * shape as every other actuation.
14922
15116
  */
14923
- actions: NcRuleActionsSchema.optional()
15117
+ actions: NcRuleActionsSchema.optional(),
15118
+ /**
15119
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15120
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15121
+ * did, and absent is the only way to say that without a migration.
15122
+ */
15123
+ confirm: NcConfirmSchema.optional()
14924
15124
  });
14925
15125
  /**
14926
15126
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14931,7 +15131,37 @@ var NcRuleInputSchema = object({
14931
15131
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14932
15132
  * `updateRule` patch.
14933
15133
  */
14934
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15134
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15135
+ disabledTargetIds: array(string()).optional(),
15136
+ /**
15137
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15138
+ *
15139
+ * It makes the key optional to SUPPLY; the parse still materialises the
15140
+ * default when the key is absent. And `NcRuleStore.update` merges with
15141
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15142
+ * one — which made every partial edit destructive:
15143
+ *
15144
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15145
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15146
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15147
+ *
15148
+ * A rule scoped to one camera and one zone silently became a rule that
15149
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15150
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15151
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15152
+ * within a minute of a two-field patch.
15153
+ *
15154
+ * So every defaulted field is re-declared here WITHOUT its default. The
15155
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15156
+ * conditions remains a real instruction ("clear them") — and only the
15157
+ * absent key is now genuinely absent.
15158
+ */
15159
+ enabled: boolean().optional(),
15160
+ conditions: NcConditionsSchema.optional(),
15161
+ media: NcMediaPolicySchema.optional(),
15162
+ throttle: NcThrottleSchema.optional(),
15163
+ priority: number().int().min(1).max(5).optional()
15164
+ });
14935
15165
  /** A persisted rule. */
14936
15166
  var NcRuleSchema = NcRuleInputSchema.extend({
14937
15167
  id: string(),
@@ -15044,12 +15274,20 @@ var NC_CONDITION_CATALOG = [
15044
15274
  valueType: "systemEvent",
15045
15275
  options: [
15046
15276
  {
15047
- value: "camera-online",
15048
- label: "Camera online"
15277
+ value: "device-online",
15278
+ label: "Device online"
15049
15279
  },
15050
15280
  {
15051
- value: "camera-offline",
15052
- label: "Camera offline"
15281
+ value: "device-offline",
15282
+ label: "Device offline"
15283
+ },
15284
+ {
15285
+ value: "device-disabled",
15286
+ label: "Device switched off"
15287
+ },
15288
+ {
15289
+ value: "device-enabled",
15290
+ label: "Device switched on"
15053
15291
  },
15054
15292
  {
15055
15293
  value: "stream-online",
@@ -15074,12 +15312,24 @@ var NC_CONDITION_CATALOG = [
15074
15312
  {
15075
15313
  value: "server-update-available",
15076
15314
  label: "Server update available"
15315
+ },
15316
+ {
15317
+ value: "alarm-triggered",
15318
+ label: "Alarm triggered"
15319
+ },
15320
+ {
15321
+ value: "alarm-armed",
15322
+ label: "Alarm armed"
15323
+ },
15324
+ {
15325
+ value: "alarm-disarmed",
15326
+ label: "Alarm disarmed"
15077
15327
  }
15078
15328
  ],
15079
15329
  operator: "in",
15080
15330
  appliesTo: ["system-event"],
15081
15331
  phase: "P1",
15082
- description: "Infrastructure and update events. Optionally narrow camera/stream events by device, node events by node id, and addon updates by package name."
15332
+ 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."
15083
15333
  },
15084
15334
  {
15085
15335
  id: "devices",
@@ -15603,6 +15853,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15603
15853
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15604
15854
  * copy would lie the first time a rule is disabled.
15605
15855
  */
15856
+ /**
15857
+ * Why a device a mode NAMES is nonetheless not armed by it.
15858
+ *
15859
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15860
+ * per-camera notification switch the Notification Center already owns,
15861
+ * `detection-off` is the device's own detection binding being inactive, and
15862
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15863
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15864
+ * with the switches the operator actually used.
15865
+ */
15866
+ var NcAlarmSkipReasonSchema = _enum([
15867
+ "muted",
15868
+ "detection-off",
15869
+ "offline"
15870
+ ]);
15871
+ var NcAlarmSkippedDeviceSchema = object({
15872
+ deviceId: number().int(),
15873
+ reason: NcAlarmSkipReasonSchema
15874
+ });
15606
15875
  var NcAlarmModeCoverageSchema = object({
15607
15876
  mode: AlarmArmModeSchema,
15608
15877
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15610,7 +15879,18 @@ var NcAlarmModeCoverageSchema = object({
15610
15879
  /** At least one covering rule has no device scope, so the mode covers all. */
15611
15880
  allDevices: boolean(),
15612
15881
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15613
- deviceIds: array(number().int())
15882
+ deviceIds: array(number().int()),
15883
+ /**
15884
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15885
+ * excludes it.
15886
+ *
15887
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15888
+ * twelve makes it false in exactly the way nobody notices until an incident.
15889
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15890
+ * still parses as "nothing known to be skipped" rather than failing the whole
15891
+ * alarm tab.
15892
+ */
15893
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15614
15894
  });
15615
15895
  var NcAlarmConfigSchema = object({
15616
15896
  /**
@@ -25792,7 +26072,19 @@ var RecordingManifestSchema = object({
25792
26072
  * profiles/subtrees/locations on this node). */
25793
26073
  var RecordingDeviceUsageSchema = object({
25794
26074
  deviceId: number(),
25795
- usedBytes: number()
26075
+ usedBytes: number(),
26076
+ /**
26077
+ * Start of this camera's OLDEST indexed segment, across every profile and
26078
+ * location — the "Oldest footage" column in Recordings → Storage, and the
26079
+ * only honest answer to "is retention actually holding?" per camera.
26080
+ *
26081
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
26082
+ * predates this field omits it entirely, and a hub whose types carry the
26083
+ * field must keep validating that older provider's payload: the framework
26084
+ * (types) and the addon ship on different trains, and the addon is usually
26085
+ * the later of the two.
26086
+ */
26087
+ oldestMs: number().nullable().optional()
25796
26088
  });
25797
26089
  /** Recording storage usage + capacity for one storage location. */
25798
26090
  var RecordingLocationUsageSchema = object({
@@ -25820,6 +26112,57 @@ var RecordingStorageUsageSchema = object({
25820
26112
  locations: array(RecordingLocationUsageSchema)
25821
26113
  });
25822
26114
  /**
26115
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
26116
+ *
26117
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
26118
+ * is the operator asking for the EXISTING archive to be brought into line with
26119
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
26120
+ * location, run FIFO behind the single-flight mover.
26121
+ *
26122
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
26123
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
26124
+ * (empty on the plan).
26125
+ */
26126
+ var RecordingRebalanceMoveSchema = object({
26127
+ deviceId: number(),
26128
+ profile: string(),
26129
+ fromLocationId: string(),
26130
+ toLocationId: string(),
26131
+ bytes: number(),
26132
+ files: number().int()
26133
+ });
26134
+ /** Why a pile that is out of place is staying there. Every refusal is
26135
+ * reported: a rebalance that silently drops a camera reads exactly like one
26136
+ * that had nothing to do. */
26137
+ var RecordingRebalanceSkipReasonSchema = _enum([
26138
+ "unassigned",
26139
+ "target-not-writable",
26140
+ "below-threshold",
26141
+ "no-headroom"
26142
+ ]);
26143
+ var RecordingRebalanceSkipSchema = object({
26144
+ deviceId: number(),
26145
+ profile: string(),
26146
+ fromLocationId: string(),
26147
+ /** The location the plan wants; null when the camera has no assignment. */
26148
+ toLocationId: string().nullable(),
26149
+ bytes: number(),
26150
+ reason: RecordingRebalanceSkipReasonSchema
26151
+ });
26152
+ var RecordingRebalancePlanSchema = object({
26153
+ moves: array(RecordingRebalanceMoveSchema),
26154
+ skipped: array(RecordingRebalanceSkipSchema),
26155
+ bytesToMove: number(),
26156
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
26157
+ jobIds: array(string())
26158
+ });
26159
+ var RecordingRebalanceInputSchema = object({
26160
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
26161
+ throttleMbps: number().min(1).max(1e3).optional(),
26162
+ /** Ignore piles smaller than this (default 1 GB). */
26163
+ minMoveGb: number().min(0).optional()
26164
+ });
26165
+ /**
25823
26166
  * Result of locating footage at a wall-clock instant for one device/profile.
25824
26167
  * `segment` carries the covering segment's window; `gap` reports the forward
25825
26168
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25982,6 +26325,21 @@ method(object({
25982
26325
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25983
26326
  kind: "mutation",
25984
26327
  auth: "admin"
26328
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
26329
+ kind: "mutation",
26330
+ auth: "admin"
26331
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
26332
+ kind: "query",
26333
+ auth: "admin"
26334
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26335
+ kind: "mutation",
26336
+ auth: "admin"
26337
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26338
+ kind: "query",
26339
+ auth: "admin"
26340
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26341
+ kind: "mutation",
26342
+ auth: "admin"
25985
26343
  });
25986
26344
  /**
25987
26345
  * `recording-export` cap — render a footage time range into a single downloadable
@@ -26000,13 +26358,24 @@ method(object({
26000
26358
  /** Playback-speed multiplier for the render (1 = realtime). */
26001
26359
  var ExportSpeedSchema = number().min(.25).max(32);
26002
26360
  /**
26003
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26361
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
26004
26362
  *
26005
- * Relative and not absolute epoch on purpose: the renderer's frame-select
26006
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26007
- * playlist. Handing it absolute epochs would make every call site responsible
26008
- * for the same subtraction, and the one that forgot would emit a filter that
26009
- * selects nothing — silently, as a uniform timelapse.
26363
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
26364
+ * derives these bounds from things that happened at a TIME (a track's
26365
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
26366
+ * every segment present for the range, with each recording GAP removed. The
26367
+ * two agree only on a window that recorded without one interruption, and only
26368
+ * the render side knows the segments, so the translation lives there
26369
+ * (`export-dense-map.ts`, addon-pipeline).
26370
+ *
26371
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
26372
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26373
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26374
+ * the video was a uniform timelapse, and the log line reported the five ranges
26375
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26376
+ *
26377
+ * Relative and not absolute epoch, because an absolute epoch would make every
26378
+ * call site responsible for the same subtraction.
26010
26379
  */
26011
26380
  var ExportDenseRangeSchema = object({
26012
26381
  fromSec: number().nonnegative(),
@@ -32881,6 +33250,12 @@ Object.freeze({
32881
33250
  addonId: null,
32882
33251
  access: "create"
32883
33252
  },
33253
+ "recording.cancelRelocateJob": {
33254
+ capName: "recording",
33255
+ capScope: "system",
33256
+ addonId: null,
33257
+ access: "create"
33258
+ },
32884
33259
  "recording.cancelStorageMigrationMove": {
32885
33260
  capName: "recording",
32886
33261
  capScope: "system",
@@ -32935,6 +33310,12 @@ Object.freeze({
32935
33310
  addonId: null,
32936
33311
  access: "view"
32937
33312
  },
33313
+ "recording.listRelocateJobs": {
33314
+ capName: "recording",
33315
+ capScope: "system",
33316
+ addonId: null,
33317
+ access: "view"
33318
+ },
32938
33319
  "recording.locateSegment": {
32939
33320
  capName: "recording",
32940
33321
  capScope: "system",
@@ -32947,6 +33328,12 @@ Object.freeze({
32947
33328
  addonId: null,
32948
33329
  access: "create"
32949
33330
  },
33331
+ "recording.planStorageRebalance": {
33332
+ capName: "recording",
33333
+ capScope: "system",
33334
+ addonId: null,
33335
+ access: "view"
33336
+ },
32950
33337
  "recording.pruneFootage": {
32951
33338
  capName: "recording",
32952
33339
  capScope: "system",
@@ -32971,6 +33358,12 @@ Object.freeze({
32971
33358
  addonId: null,
32972
33359
  access: "create"
32973
33360
  },
33361
+ "recording.relocateFootage": {
33362
+ capName: "recording",
33363
+ capScope: "system",
33364
+ addonId: null,
33365
+ access: "create"
33366
+ },
32974
33367
  "recording.renderClip": {
32975
33368
  capName: "recording",
32976
33369
  capScope: "system",
@@ -33007,6 +33400,12 @@ Object.freeze({
33007
33400
  addonId: null,
33008
33401
  access: "create"
33009
33402
  },
33403
+ "recording.startStorageRebalance": {
33404
+ capName: "recording",
33405
+ capScope: "system",
33406
+ addonId: null,
33407
+ access: "create"
33408
+ },
33010
33409
  "recordingExport.cancelExport": {
33011
33410
  capName: "recording-export",
33012
33411
  capScope: "system",
@@ -34481,6 +34880,111 @@ var FramerateField = number().int().min(1).max(60);
34481
34880
  var TargetsField = array(NcRuleTargetSchema).min(1);
34482
34881
  var PriorityField = number().int().min(1).max(5);
34483
34882
  /**
34883
+ * Floor on any dense cadence, seconds — the recording's own frame interval.
34884
+ *
34885
+ * Declared here because it bounds BOTH the rule field and the renderer's
34886
+ * derivation, and two copies of a floor are two floors that can drift.
34887
+ */
34888
+ var TIMELAPSE_DENSE_FLOOR_SEC = .1;
34889
+ /**
34890
+ * Explicit override of the DENSE sampling cadence, seconds.
34891
+ *
34892
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34893
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34894
+ * made that same base 3 s and rendered a person pass as two frames.)
34895
+ *
34896
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34897
+ * `denseCadenceSec` and played at `framerate` occupies
34898
+ *
34899
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34900
+ *
34901
+ * 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.
34902
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34903
+ * and therefore the length of a quiet night, does not move.
34904
+ *
34905
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34906
+ * the recording has them returns the same frames, requested twice. Must be
34907
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34908
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34909
+ * rather than letting the export cap reject the render hours after the window.
34910
+ */
34911
+ var DenseCadenceSecField = number().min(TIMELAPSE_DENSE_FLOOR_SEC).max(3600);
34912
+ /**
34913
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34914
+ *
34915
+ * The operator-facing form of the arithmetic above: instead of solving for a
34916
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34917
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34918
+ * that range every ~583 ms.
34919
+ *
34920
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34921
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34922
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34923
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34924
+ * schema change and are the tracked follow-up.
34925
+ *
34926
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34927
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34928
+ * by real footage, never met by duplicating frames into motion that never
34929
+ * happened.
34930
+ */
34931
+ var MinDwellSecField = number().min(0).max(60);
34932
+ /**
34933
+ * Caption burned into the notification's preview frame.
34934
+ *
34935
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34936
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34937
+ * templating dialect for one field would be a second thing to explain.
34938
+ *
34939
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34940
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34941
+ * the reason this is not `.min(1)`.
34942
+ */
34943
+ var PreviewTextField = string().max(200);
34944
+ /**
34945
+ * Whether the notification's preview is a STILL or a short animation.
34946
+ *
34947
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34948
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34949
+ * night reads better as three seconds of motion than as one frame of it. Both
34950
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34951
+ * simply applies it to a dozen frames sampled across the render and assembles
34952
+ * them.
34953
+ *
34954
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34955
+ * seeks and a palette pass, and no rule that never asked for one should start
34956
+ * paying that on the deploy that shipped it.
34957
+ *
34958
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34959
+ */
34960
+ var PreviewModeField = _enum(["image", "gif"]);
34961
+ /**
34962
+ * Which detection classes the notification reports counts for.
34963
+ *
34964
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34965
+ * plan — no second query — aggregated per class. Absent or empty means "every
34966
+ * class the window actually contained", which is what an operator who never
34967
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34968
+ * counts cars all night).
34969
+ *
34970
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34971
+ * …). An unknown name simply never matches and reports nothing — it is not an
34972
+ * error, because a rule may legitimately name a class this camera's model does
34973
+ * not emit.
34974
+ *
34975
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34976
+ * - `{{detections}}` — total over the reported classes
34977
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34978
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34979
+ * one per class, `count_` + the class name
34980
+ *
34981
+ * With NO custom body template the summary is appended to the derived body, and
34982
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34983
+ * reads. With a custom template the operator owns every word — nothing is
34984
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34985
+ */
34986
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34987
+ /**
34484
34988
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
34485
34989
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
34486
34990
  * here (see the ownership note above).
@@ -34500,13 +35004,42 @@ var TimelapseRuleInputSchema = object({
34500
35004
  cadenceSec: CadenceSecField.default(15),
34501
35005
  /** Output frames per second of the assembled mp4 (predecessor parity). */
34502
35006
  framerate: FramerateField.default(10),
35007
+ /**
35008
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
35009
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
35010
+ * field gets.
35011
+ */
35012
+ denseCadenceSec: DenseCadenceSecField.optional(),
35013
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
35014
+ minDwellSec: MinDwellSecField.optional(),
34503
35015
  /** `notification-output` targets the finished video/thumbnail is sent to. */
34504
35016
  targets: TargetsField,
34505
35017
  template: TimelapseTemplateSchema.optional(),
35018
+ /**
35019
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
35020
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
35021
+ *
35022
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
35023
+ * the notification's title/body, and clearing it (`template: null`) must not
35024
+ * silently clear the caption too.
35025
+ */
35026
+ previewText: PreviewTextField.optional(),
35027
+ /** Still or animation — see {@link PreviewModeField}. */
35028
+ previewMode: PreviewModeField.default("image"),
35029
+ /** Classes the notification counts — see {@link ReportClassesField}. */
35030
+ reportClasses: ReportClassesField.optional(),
34506
35031
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
34507
35032
  priority: PriorityField.default(3)
34508
35033
  });
34509
35034
  /**
35035
+ * The caption a rule that never set one gets.
35036
+ *
35037
+ * Rendered through the ordinary `{{var}}` pass at delivery, so a rule created
35038
+ * before this field existed still reads "Timelapse Videocamera ingresso" and
35039
+ * not the literal braces.
35040
+ */
35041
+ var DEFAULT_TIMELAPSE_PREVIEW_TEXT = "Timelapse {{camera}}";
35042
+ /**
34510
35043
  * Partial patch for an update — any subset of the INPUT fields, with NO
34511
35044
  * defaults (an absent key means "leave unchanged", never "reset to default").
34512
35045
  * Provenance and ownership are absent by construction: a patch can rename or
@@ -34529,8 +35062,13 @@ var TimelapseRulePatchSchema = object({
34529
35062
  schedule: NcScheduleSchema.optional(),
34530
35063
  cadenceSec: CadenceSecField.optional(),
34531
35064
  framerate: FramerateField.optional(),
35065
+ denseCadenceSec: DenseCadenceSecField.optional(),
35066
+ minDwellSec: MinDwellSecField.optional(),
34532
35067
  targets: TargetsField.optional(),
34533
35068
  template: TimelapseTemplateSchema.nullable().optional(),
35069
+ previewText: PreviewTextField.optional(),
35070
+ previewMode: PreviewModeField.optional(),
35071
+ reportClasses: ReportClassesField.optional(),
34534
35072
  priority: PriorityField.optional()
34535
35073
  });
34536
35074
  /** A persisted timelapse rule. */
@@ -34571,6 +35109,26 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
34571
35109
  updatedAt: number()
34572
35110
  });
34573
35111
  /**
35112
+ * Refuse a dense cadence that is not denser than the base.
35113
+ *
35114
+ * Called at UPSERT, on the MERGED rule — a patch that lowers `cadenceSec`
35115
+ * alone can invalidate a `denseCadenceSec` set months earlier, so checking the
35116
+ * patch in isolation would let the bad pair through.
35117
+ *
35118
+ * Refusing here and not at render time is the whole point: `ExportTimelapseSchema`
35119
+ * also rejects the pair, but it does so when the window has already closed and
35120
+ * the footage is being cut — the operator learns at 06:05 that last night was
35121
+ * never going to render, and a closed window does not come back. This turns
35122
+ * that into a failed edit he can see and correct.
35123
+ *
35124
+ * @throws Error naming both numbers, so the message is actionable in a toast.
35125
+ */
35126
+ function assertTimelapseCadences(pair) {
35127
+ const dense = pair.denseCadenceSec;
35128
+ if (dense === void 0) return;
35129
+ 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`);
35130
+ }
35131
+ /**
34574
35132
  * The last successful generation for ONE camera of a rule, epoch-ms.
34575
35133
  *
34576
35134
  * The per-device map wins; a rule with no map falls back to the rule-wide
@@ -34632,25 +35190,32 @@ object({
34632
35190
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34633
35191
  object({
34634
35192
  /**
34635
- * How long a retained native frame is served before it counts as a miss.
35193
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
35194
+ * detection result.
35195
+ *
35196
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
35197
+ * a time window was never related to the event the pixels were waiting for.
35198
+ * A held frame now lives from delivery until the runner has its `FrameResult`
35199
+ * — at which moment the runner cuts the subject tiles it actually wanted and
35200
+ * releases the frame. The bound exists only so a runner that stops answering
35201
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34636
35202
  *
34637
- * Must cover the FULL late-crop horizon: detection inference + the
34638
- * cross-process inference-result hop to hub post-analysis + tracking + the
34639
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34640
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34641
- * RAM per busy camera grows linearly with no measured hit-rate gain.
35203
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
35204
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
35205
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
35206
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
35207
+ * `holdOverflow` on the metrics line is what says you need it.
34642
35208
  */
34643
- ttlMs: number().int().min(250).max(1e4),
35209
+ holdFrames: number().int().min(1).max(64),
34644
35210
  /**
34645
35211
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34646
35212
  *
34647
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34648
- * which one is actually binding before reasoning from that. At the shipped
34649
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34650
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34651
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34652
- * change that admits fewer frames buys retention WINDOW at constant RAM
34653
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
35213
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
35214
+ * is what decides how much is held, and the ceiling is the number above which
35215
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
35216
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
35217
+ * with the TTL expiring nothing, which is exactly the confusion the hold
35218
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34654
35219
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34655
35220
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34656
35221
  * to replace).
@@ -34676,22 +35241,45 @@ object({
34676
35241
  * there is the signal that some caller names frames outside the inference set
34677
35242
  * and that this must go back to `all`.
34678
35243
  */
34679
- admission: NativeLeaseAdmissionSchema
35244
+ admission: NativeLeaseAdmissionSchema,
35245
+ /**
35246
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
35247
+ * compressed native crops the worker cuts at the moment a frame's detection
35248
+ * result arrives, and keeps long after the frame itself is freed.
35249
+ *
35250
+ * This is the knob that replaced the old retention window, and it buys about
35251
+ * three orders of magnitude more of it: a tile is one subject at native
35252
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
35253
+ * the frame it was cut from. A frame on which nothing was detected costs
35254
+ * nothing at all, which is the real change — the old lease paid per FRAME and
35255
+ * was interrogated per SUBJECT.
35256
+ *
35257
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
35258
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
35259
+ * reproduce that.
35260
+ */
35261
+ tileBudgetMb: number().int().min(0).max(1024)
34680
35262
  });
34681
35263
  /**
34682
- * The values in force when the operator has set nothing — byte-for-byte the
34683
- * constants the decode worker shipped with as env-var defaults, so making these
34684
- * settings changed no behaviour on the day it landed.
35264
+ * The values in force when the operator has set nothing.
35265
+ *
35266
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
35267
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
35268
+ * in the same change that redefines it would make a regression and a retune
35269
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
35270
+ * live traffic.
34685
35271
  */
34686
35272
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34687
- ttlMs: 1200,
35273
+ holdFrames: 8,
34688
35274
  budgetMb: 1024,
34689
35275
  activityMs: 15e3,
35276
+ tileBudgetMb: 64,
34690
35277
  admission: "inferred"
34691
35278
  };
34692
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
35279
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34693
35280
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34694
35281
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
35282
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34695
35283
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34696
35284
  /** Cosine similarity between two embedding vectors */
34697
35285
  function cosineSimilarity(a, b) {
@@ -34739,4 +35327,4 @@ function vectorDimFromBase64(encoded) {
34739
35327
  return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
34740
35328
  }
34741
35329
  //#endregion
34742
- export { isDeviceScopedCap as $, customAction as A, pipelineAnalyticsCapability as B, TimelapseRuleSchema as C, audioMetricsCapability as D, alarmPanelCapability as E, faceGalleryCapability as F, vectorDimFromBase64 as G, readDeviceStateFrom as H, hfModelUrl as I, errMsg as J, videoclipsCapability as K, isScheduleActive as L, deriveRecordingMode as M, embeddingEncoderCapability as N, buildEventKindDescriptor as O, encodeVectorBase64 as P, hydrateSchema as Q, kebabToCamel as R, TimelapseRulePatchSchema as S, addonWidgetsSourceCapability as T, readTimelapseGeneratedAt as U, plateGalleryCapability as V, subKindsOf as W, DeviceType as X, BaseAddon as Y, createEvent as Z, NcTaxonomySchema as _, EVENT_PAD_MS as a, literal as at, RetrainStatusSchema as b, NC_CONDITION_CATALOG as c, record as ct, NcRuleInputSchema as d, EventCategory as dt, nodePin as et, NcRulePatchSchema as f, NcSnoozeSuppressedSchema as g, NcSnoozeSchema as h, EVENT_KIND_BY_CAP as i, boolean as it, defineCustomActions as j, cosineSimilarity as k, NC_TAXONOMY as l, string as lt, NcSnoozeInputSchema as m, DEFAULT_EVENT_COLOR as n, _enum as nt, LabelAttributionSchema as o, number as ot, NcRuleSchema as p, zoneAnalyticsCapability as q, DeclaredDevices as r, array as rt, MACRO_LABELS as s, object as st, BaseDevice as t, sleep as tt, NcConditionDescriptorSchema as u, unknown as ut, OpsLogEntrySchema as v, TrackSourceSchema as w, TimelapseRuleInputSchema as x, RECORDING_EXPORT_MAX_READ_BYTES as y, notificationRulesCapability as z };
35330
+ export { zoneAnalyticsCapability as $, addonWidgetsSourceCapability as A, encodeVectorBase64 as B, RECORDING_EXPORT_MAX_READ_BYTES as C, TimelapseRulePatchSchema as D, TimelapseRuleInputSchema as E, cosineSimilarity as F, notificationRulesCapability as G, hfModelUrl as H, customAction as I, readDeviceStateFrom as J, pipelineAnalyticsCapability as K, defineCustomActions as L, assertTimelapseCadences as M, audioMetricsCapability as N, TimelapseRuleSchema as O, buildEventKindDescriptor as P, videoclipsCapability as Q, deriveRecordingMode as R, OpsLogEntrySchema as S, TIMELAPSE_DENSE_FLOOR_SEC as T, isScheduleActive as U, faceGalleryCapability as V, kebabToCamel as W, subKindsOf as X, readTimelapseGeneratedAt as Y, vectorDimFromBase64 as Z, NcScheduleSchema as _, string as _t, DeclaredDevices as a, isDeviceScopedCap as at, NcSnoozeSuppressedSchema as b, LabelAttributionSchema as c, _enum as ct, NC_TAXONOMY as d, discriminatedUnion as dt, errMsg as et, NcConditionDescriptorSchema as f, literal as ft, NcRuleTargetSchema as g, record as gt, NcRuleSchema as h, partialRecord as ht, DETECTION_PIPELINE_CAP_NAME as i, hydrateSchema as it, alarmPanelCapability as j, TrackSourceSchema as k, MACRO_LABELS as l, array as lt, NcRulePatchSchema as m, object as mt, DEFAULT_EVENT_COLOR as n, DeviceType as nt, EVENT_KIND_BY_CAP as o, nodePin as ot, NcRuleInputSchema as p, number as pt, plateGalleryCapability as q, DEFAULT_TIMELAPSE_PREVIEW_TEXT as r, createEvent as rt, EVENT_PAD_MS as s, sleep as st, BaseDevice as t, BaseAddon as tt, NC_CONDITION_CATALOG as u, boolean as ut, NcSnoozeInputSchema as v, unknown as vt, RetrainStatusSchema as w, NcTaxonomySchema as x, NcSnoozeSchema as y, EventCategory as yt, embeddingEncoderCapability as z };