@camstack/addon-decoder-ffmpeg 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +139 -35
  2. package/dist/index.mjs +139 -35
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13098,7 +13098,23 @@ var NotificationActionSchema = object({
13098
13098
  * else — see `notification-center/action-token.ts` for what that does and
13099
13099
  * does not buy.
13100
13100
  */
13101
- destructive: boolean().optional()
13101
+ destructive: boolean().optional(),
13102
+ /**
13103
+ * How the tap should REACH the url.
13104
+ *
13105
+ * `navigate` (absent, and every button authored before this field) opens it:
13106
+ * the phone leaves the notification and shows whatever the callback returns.
13107
+ * That is right for a button whose answer the operator wants to read.
13108
+ *
13109
+ * `background` fires it as a POST and stays put. It exists for the buttons
13110
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13111
+ * an answer to the notification, and being thrown into a browser tab to
13112
+ * confirm it costs more attention than the notification did. A backend that
13113
+ * cannot do a background call renders it as an ordinary link (the adapters
13114
+ * fall back rather than dropping the button), so this is a preference, never
13115
+ * a requirement.
13116
+ */
13117
+ mode: _enum(["navigate", "background"]).optional()
13102
13118
  });
13103
13119
  /**
13104
13120
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14099,6 +14115,9 @@ var NcSystemEventConditionSchema = object({
14099
14115
  nodeIds: array(string().min(1)).min(1).optional(),
14100
14116
  packageNames: array(string().min(1)).min(1).optional()
14101
14117
  });
14118
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14119
+ * outage the operator asked for once and forgot. */
14120
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14102
14121
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14103
14122
  var NcScheduleSchema = object({
14104
14123
  windows: array(object({
@@ -14475,15 +14494,15 @@ var NcConditionsSchema = object({
14475
14494
  * (an `immediate` rule naming an `audio-*` class, one notification per
14476
14495
  * classified sample) stays exactly as it was for rules that already use it.
14477
14496
  *
14478
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14479
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14480
- * (`camstack/src/data/notification-center.ts`, guarded by
14481
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14497
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14498
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14499
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14500
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14482
14501
  * condition fields it does not know when a rule is saved from the phone.
14483
14502
  * Publishing an editor for a condition the app cannot round-trip is how an
14484
- * operator loses a rule's conditions by opening it — so the descriptor, the
14485
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14486
- * does an audio rule become authorable.
14503
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14504
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14505
+ * follows here.
14487
14506
  */
14488
14507
  audio: NcAudioConditionSchema.optional()
14489
14508
  });
@@ -14719,6 +14738,30 @@ var NcRuleInputSchema = object({
14719
14738
  */
14720
14739
  snoozeAllowGlobal: boolean().optional(),
14721
14740
  /**
14741
+ * The snooze durations THIS rule's notification offers as buttons, in
14742
+ * minutes.
14743
+ *
14744
+ * Three states, and all three are distinct — which is exactly why this is
14745
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14746
+ * addon cap path (three production failures in one day), so a schema default
14747
+ * would collapse the first two:
14748
+ *
14749
+ * | value | meaning |
14750
+ * | --- | --- |
14751
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14752
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14753
+ * | a list | these choices, de-duplicated and sorted, at most four |
14754
+ *
14755
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14756
+ * three buttons in total) and a rule that spent it all on snooze choices
14757
+ * would push its own tap-through actions off the notification.
14758
+ *
14759
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14760
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14761
+ * window from anywhere (D133).
14762
+ */
14763
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14764
+ /**
14722
14765
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14723
14766
  *
14724
14767
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14818,6 +14861,7 @@ var NcConditionDescriptorSchema = object({
14818
14861
  "device",
14819
14862
  "package",
14820
14863
  "occupancy",
14864
+ "audio",
14821
14865
  "system"
14822
14866
  ]),
14823
14867
  label: string(),
@@ -14836,6 +14880,7 @@ var NcConditionDescriptorSchema = object({
14836
14880
  "crossingSelect",
14837
14881
  "polygonDraw",
14838
14882
  "occupancy",
14883
+ "audio",
14839
14884
  "deviceState",
14840
14885
  "systemEvent"
14841
14886
  ]),
@@ -14987,7 +15032,20 @@ var NcSnoozeInputSchema = object({
14987
15032
  ruleId: string().optional(),
14988
15033
  /** Required when `scope: 'device'`. */
14989
15034
  deviceId: number().int().optional(),
14990
- durationMinutes: number().int().min(1).max(1440),
15035
+ /**
15036
+ * Narrow the window to these subject classes — "the cat, not the person".
15037
+ *
15038
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15039
+ * what every window authored before this field meant, so no persisted row
15040
+ * changes meaning and no client has to learn anything to keep working.
15041
+ *
15042
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15043
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15044
+ * not at whichever of their four rules happened to produce the notification
15045
+ * they are dismissing.
15046
+ */
15047
+ classes: array(string().min(1)).min(1).optional(),
15048
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
14991
15049
  /**
14992
15050
  * Silence this for EVERY recipient, not just the caller. Permission is
14993
15051
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15012,6 +15070,10 @@ var NcSnoozeSchema = object({
15012
15070
  scope: NcSnoozeScopeSchema,
15013
15071
  ruleId: string().optional(),
15014
15072
  deviceId: number().int().optional(),
15073
+ /** Subject classes this window covers. ABSENT = every class — see
15074
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15075
+ * no SQLite column: nothing queries a window by class. */
15076
+ classes: array(string().min(1)).min(1).optional(),
15015
15077
  startedAt: number(),
15016
15078
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15017
15079
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -23714,13 +23776,24 @@ method(object({
23714
23776
  /** Playback-speed multiplier for the render (1 = realtime). */
23715
23777
  var ExportSpeedSchema = number().min(.25).max(32);
23716
23778
  /**
23717
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23779
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23780
+ *
23781
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23782
+ * derives these bounds from things that happened at a TIME (a track's
23783
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23784
+ * every segment present for the range, with each recording GAP removed. The
23785
+ * two agree only on a window that recorded without one interruption, and only
23786
+ * the render side knows the segments, so the translation lives there
23787
+ * (`export-dense-map.ts`, addon-pipeline).
23788
+ *
23789
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23790
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23791
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23792
+ * the video was a uniform timelapse, and the log line reported the five ranges
23793
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23718
23794
  *
23719
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23720
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23721
- * playlist. Handing it absolute epochs would make every call site responsible
23722
- * for the same subtraction, and the one that forgot would emit a filter that
23723
- * selects nothing — silently, as a uniform timelapse.
23795
+ * Relative and not absolute epoch, because an absolute epoch would make every
23796
+ * call site responsible for the same subtraction.
23724
23797
  */
23725
23798
  var ExportDenseRangeSchema = object({
23726
23799
  fromSec: number().nonnegative(),
@@ -30573,6 +30646,7 @@ Object.freeze({
30573
30646
  "network-access": "ingress",
30574
30647
  "smtp-provider": "email"
30575
30648
  });
30649
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30576
30650
  new Set(["devices", "classes"]);
30577
30651
  /**
30578
30652
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -30850,25 +30924,32 @@ object({
30850
30924
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30851
30925
  object({
30852
30926
  /**
30853
- * How long a retained native frame is served before it counts as a miss.
30927
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30928
+ * detection result.
30854
30929
  *
30855
- * Must cover the FULL late-crop horizon: detection inference + the
30856
- * cross-process inference-result hop to hub post-analysis + tracking + the
30857
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30858
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30859
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30930
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30931
+ * a time window was never related to the event the pixels were waiting for.
30932
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30933
+ * at which moment the runner cuts the subject tiles it actually wanted and
30934
+ * releases the frame. The bound exists only so a runner that stops answering
30935
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30936
+ *
30937
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30938
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30939
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30940
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30941
+ * `holdOverflow` on the metrics line is what says you need it.
30860
30942
  */
30861
- ttlMs: number().int().min(250).max(1e4),
30943
+ holdFrames: number().int().min(1).max(64),
30862
30944
  /**
30863
30945
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30864
30946
  *
30865
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30866
- * which one is actually binding before reasoning from that. At the shipped
30867
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30868
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30869
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30870
- * change that admits fewer frames buys retention WINDOW at constant RAM
30871
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30947
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30948
+ * is what decides how much is held, and the ceiling is the number above which
30949
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30950
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30951
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30952
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30872
30953
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30873
30954
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30874
30955
  * to replace).
@@ -30894,22 +30975,45 @@ object({
30894
30975
  * there is the signal that some caller names frames outside the inference set
30895
30976
  * and that this must go back to `all`.
30896
30977
  */
30897
- admission: NativeLeaseAdmissionSchema
30978
+ admission: NativeLeaseAdmissionSchema,
30979
+ /**
30980
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30981
+ * compressed native crops the worker cuts at the moment a frame's detection
30982
+ * result arrives, and keeps long after the frame itself is freed.
30983
+ *
30984
+ * This is the knob that replaced the old retention window, and it buys about
30985
+ * three orders of magnitude more of it: a tile is one subject at native
30986
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30987
+ * the frame it was cut from. A frame on which nothing was detected costs
30988
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30989
+ * was interrogated per SUBJECT.
30990
+ *
30991
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30992
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30993
+ * reproduce that.
30994
+ */
30995
+ tileBudgetMb: number().int().min(0).max(1024)
30898
30996
  });
30899
30997
  /**
30900
- * The values in force when the operator has set nothing — byte-for-byte the
30901
- * constants the decode worker shipped with as env-var defaults, so making these
30902
- * settings changed no behaviour on the day it landed.
30998
+ * The values in force when the operator has set nothing.
30999
+ *
31000
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
31001
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
31002
+ * in the same change that redefines it would make a regression and a retune
31003
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31004
+ * live traffic.
30903
31005
  */
30904
31006
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30905
- ttlMs: 1200,
31007
+ holdFrames: 8,
30906
31008
  budgetMb: 1024,
30907
31009
  activityMs: 15e3,
31010
+ tileBudgetMb: 64,
30908
31011
  admission: "inferred"
30909
31012
  };
30910
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31013
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30911
31014
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30912
31015
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31016
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30913
31017
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30914
31018
  /**
30915
31019
  * Fixed-capacity ring buffer. When full, push() overwrites the oldest entry.
package/dist/index.mjs CHANGED
@@ -13094,7 +13094,23 @@ var NotificationActionSchema = object({
13094
13094
  * else — see `notification-center/action-token.ts` for what that does and
13095
13095
  * does not buy.
13096
13096
  */
13097
- destructive: boolean().optional()
13097
+ destructive: boolean().optional(),
13098
+ /**
13099
+ * How the tap should REACH the url.
13100
+ *
13101
+ * `navigate` (absent, and every button authored before this field) opens it:
13102
+ * the phone leaves the notification and shows whatever the callback returns.
13103
+ * That is right for a button whose answer the operator wants to read.
13104
+ *
13105
+ * `background` fires it as a POST and stays put. It exists for the buttons
13106
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13107
+ * an answer to the notification, and being thrown into a browser tab to
13108
+ * confirm it costs more attention than the notification did. A backend that
13109
+ * cannot do a background call renders it as an ordinary link (the adapters
13110
+ * fall back rather than dropping the button), so this is a preference, never
13111
+ * a requirement.
13112
+ */
13113
+ mode: _enum(["navigate", "background"]).optional()
13098
13114
  });
13099
13115
  /**
13100
13116
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14095,6 +14111,9 @@ var NcSystemEventConditionSchema = object({
14095
14111
  nodeIds: array(string().min(1)).min(1).optional(),
14096
14112
  packageNames: array(string().min(1)).min(1).optional()
14097
14113
  });
14114
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14115
+ * outage the operator asked for once and forgot. */
14116
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14098
14117
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14099
14118
  var NcScheduleSchema = object({
14100
14119
  windows: array(object({
@@ -14471,15 +14490,15 @@ var NcConditionsSchema = object({
14471
14490
  * (an `immediate` rule naming an `audio-*` class, one notification per
14472
14491
  * classified sample) stays exactly as it was for rules that already use it.
14473
14492
  *
14474
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14475
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14476
- * (`camstack/src/data/notification-center.ts`, guarded by
14477
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14493
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14494
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14495
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14496
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14478
14497
  * condition fields it does not know when a rule is saved from the phone.
14479
14498
  * Publishing an editor for a condition the app cannot round-trip is how an
14480
- * operator loses a rule's conditions by opening it — so the descriptor, the
14481
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14482
- * does an audio rule become authorable.
14499
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14500
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14501
+ * follows here.
14483
14502
  */
14484
14503
  audio: NcAudioConditionSchema.optional()
14485
14504
  });
@@ -14715,6 +14734,30 @@ var NcRuleInputSchema = object({
14715
14734
  */
14716
14735
  snoozeAllowGlobal: boolean().optional(),
14717
14736
  /**
14737
+ * The snooze durations THIS rule's notification offers as buttons, in
14738
+ * minutes.
14739
+ *
14740
+ * Three states, and all three are distinct — which is exactly why this is
14741
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14742
+ * addon cap path (three production failures in one day), so a schema default
14743
+ * would collapse the first two:
14744
+ *
14745
+ * | value | meaning |
14746
+ * | --- | --- |
14747
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14748
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14749
+ * | a list | these choices, de-duplicated and sorted, at most four |
14750
+ *
14751
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14752
+ * three buttons in total) and a rule that spent it all on snooze choices
14753
+ * would push its own tap-through actions off the notification.
14754
+ *
14755
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14756
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14757
+ * window from anywhere (D133).
14758
+ */
14759
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14760
+ /**
14718
14761
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14719
14762
  *
14720
14763
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14814,6 +14857,7 @@ var NcConditionDescriptorSchema = object({
14814
14857
  "device",
14815
14858
  "package",
14816
14859
  "occupancy",
14860
+ "audio",
14817
14861
  "system"
14818
14862
  ]),
14819
14863
  label: string(),
@@ -14832,6 +14876,7 @@ var NcConditionDescriptorSchema = object({
14832
14876
  "crossingSelect",
14833
14877
  "polygonDraw",
14834
14878
  "occupancy",
14879
+ "audio",
14835
14880
  "deviceState",
14836
14881
  "systemEvent"
14837
14882
  ]),
@@ -14983,7 +15028,20 @@ var NcSnoozeInputSchema = object({
14983
15028
  ruleId: string().optional(),
14984
15029
  /** Required when `scope: 'device'`. */
14985
15030
  deviceId: number().int().optional(),
14986
- durationMinutes: number().int().min(1).max(1440),
15031
+ /**
15032
+ * Narrow the window to these subject classes — "the cat, not the person".
15033
+ *
15034
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15035
+ * what every window authored before this field meant, so no persisted row
15036
+ * changes meaning and no client has to learn anything to keep working.
15037
+ *
15038
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15039
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15040
+ * not at whichever of their four rules happened to produce the notification
15041
+ * they are dismissing.
15042
+ */
15043
+ classes: array(string().min(1)).min(1).optional(),
15044
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
14987
15045
  /**
14988
15046
  * Silence this for EVERY recipient, not just the caller. Permission is
14989
15047
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15008,6 +15066,10 @@ var NcSnoozeSchema = object({
15008
15066
  scope: NcSnoozeScopeSchema,
15009
15067
  ruleId: string().optional(),
15010
15068
  deviceId: number().int().optional(),
15069
+ /** Subject classes this window covers. ABSENT = every class — see
15070
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15071
+ * no SQLite column: nothing queries a window by class. */
15072
+ classes: array(string().min(1)).min(1).optional(),
15011
15073
  startedAt: number(),
15012
15074
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15013
15075
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -23710,13 +23772,24 @@ method(object({
23710
23772
  /** Playback-speed multiplier for the render (1 = realtime). */
23711
23773
  var ExportSpeedSchema = number().min(.25).max(32);
23712
23774
  /**
23713
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23775
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23776
+ *
23777
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23778
+ * derives these bounds from things that happened at a TIME (a track's
23779
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23780
+ * every segment present for the range, with each recording GAP removed. The
23781
+ * two agree only on a window that recorded without one interruption, and only
23782
+ * the render side knows the segments, so the translation lives there
23783
+ * (`export-dense-map.ts`, addon-pipeline).
23784
+ *
23785
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23786
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23787
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23788
+ * the video was a uniform timelapse, and the log line reported the five ranges
23789
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23714
23790
  *
23715
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23716
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23717
- * playlist. Handing it absolute epochs would make every call site responsible
23718
- * for the same subtraction, and the one that forgot would emit a filter that
23719
- * selects nothing — silently, as a uniform timelapse.
23791
+ * Relative and not absolute epoch, because an absolute epoch would make every
23792
+ * call site responsible for the same subtraction.
23720
23793
  */
23721
23794
  var ExportDenseRangeSchema = object({
23722
23795
  fromSec: number().nonnegative(),
@@ -30569,6 +30642,7 @@ Object.freeze({
30569
30642
  "network-access": "ingress",
30570
30643
  "smtp-provider": "email"
30571
30644
  });
30645
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30572
30646
  new Set(["devices", "classes"]);
30573
30647
  /**
30574
30648
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -30846,25 +30920,32 @@ object({
30846
30920
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30847
30921
  object({
30848
30922
  /**
30849
- * How long a retained native frame is served before it counts as a miss.
30923
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30924
+ * detection result.
30850
30925
  *
30851
- * Must cover the FULL late-crop horizon: detection inference + the
30852
- * cross-process inference-result hop to hub post-analysis + tracking + the
30853
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30854
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30855
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30926
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30927
+ * a time window was never related to the event the pixels were waiting for.
30928
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30929
+ * at which moment the runner cuts the subject tiles it actually wanted and
30930
+ * releases the frame. The bound exists only so a runner that stops answering
30931
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30932
+ *
30933
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30934
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30935
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30936
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30937
+ * `holdOverflow` on the metrics line is what says you need it.
30856
30938
  */
30857
- ttlMs: number().int().min(250).max(1e4),
30939
+ holdFrames: number().int().min(1).max(64),
30858
30940
  /**
30859
30941
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30860
30942
  *
30861
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30862
- * which one is actually binding before reasoning from that. At the shipped
30863
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30864
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30865
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30866
- * change that admits fewer frames buys retention WINDOW at constant RAM
30867
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30943
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30944
+ * is what decides how much is held, and the ceiling is the number above which
30945
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30946
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30947
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30948
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30868
30949
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30869
30950
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30870
30951
  * to replace).
@@ -30890,22 +30971,45 @@ object({
30890
30971
  * there is the signal that some caller names frames outside the inference set
30891
30972
  * and that this must go back to `all`.
30892
30973
  */
30893
- admission: NativeLeaseAdmissionSchema
30974
+ admission: NativeLeaseAdmissionSchema,
30975
+ /**
30976
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30977
+ * compressed native crops the worker cuts at the moment a frame's detection
30978
+ * result arrives, and keeps long after the frame itself is freed.
30979
+ *
30980
+ * This is the knob that replaced the old retention window, and it buys about
30981
+ * three orders of magnitude more of it: a tile is one subject at native
30982
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30983
+ * the frame it was cut from. A frame on which nothing was detected costs
30984
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30985
+ * was interrogated per SUBJECT.
30986
+ *
30987
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30988
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30989
+ * reproduce that.
30990
+ */
30991
+ tileBudgetMb: number().int().min(0).max(1024)
30894
30992
  });
30895
30993
  /**
30896
- * The values in force when the operator has set nothing — byte-for-byte the
30897
- * constants the decode worker shipped with as env-var defaults, so making these
30898
- * settings changed no behaviour on the day it landed.
30994
+ * The values in force when the operator has set nothing.
30995
+ *
30996
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30997
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30998
+ * in the same change that redefines it would make a regression and a retune
30999
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31000
+ * live traffic.
30899
31001
  */
30900
31002
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30901
- ttlMs: 1200,
31003
+ holdFrames: 8,
30902
31004
  budgetMb: 1024,
30903
31005
  activityMs: 15e3,
31006
+ tileBudgetMb: 64,
30904
31007
  admission: "inferred"
30905
31008
  };
30906
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31009
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30907
31010
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30908
31011
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31012
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30909
31013
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30910
31014
  /**
30911
31015
  * Fixed-capacity ring buffer. When full, push() overwrites the oldest entry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-ffmpeg",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Standalone ffmpeg-subprocess decoder fallback addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",