@camstack/addon-export-alexa 1.2.18 → 1.2.19

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.
@@ -23884,13 +23884,24 @@ method(object({
23884
23884
  /** Playback-speed multiplier for the render (1 = realtime). */
23885
23885
  var ExportSpeedSchema = number().min(.25).max(32);
23886
23886
  /**
23887
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23887
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23888
23888
  *
23889
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23890
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23891
- * playlist. Handing it absolute epochs would make every call site responsible
23892
- * for the same subtraction, and the one that forgot would emit a filter that
23893
- * selects nothing — silently, as a uniform timelapse.
23889
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23890
+ * derives these bounds from things that happened at a TIME (a track's
23891
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23892
+ * every segment present for the range, with each recording GAP removed. The
23893
+ * two agree only on a window that recorded without one interruption, and only
23894
+ * the render side knows the segments, so the translation lives there
23895
+ * (`export-dense-map.ts`, addon-pipeline).
23896
+ *
23897
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23898
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23899
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23900
+ * the video was a uniform timelapse, and the log line reported the five ranges
23901
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23902
+ *
23903
+ * Relative and not absolute epoch, because an absolute epoch would make every
23904
+ * call site responsible for the same subtraction.
23894
23905
  */
23895
23906
  var ExportDenseRangeSchema = object({
23896
23907
  fromSec: number().nonnegative(),
@@ -31020,25 +31031,32 @@ object({
31020
31031
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
31021
31032
  object({
31022
31033
  /**
31023
- * How long a retained native frame is served before it counts as a miss.
31034
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
31035
+ * detection result.
31024
31036
  *
31025
- * Must cover the FULL late-crop horizon: detection inference + the
31026
- * cross-process inference-result hop to hub post-analysis + tracking + the
31027
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
31028
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
31029
- * RAM per busy camera grows linearly with no measured hit-rate gain.
31037
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
31038
+ * a time window was never related to the event the pixels were waiting for.
31039
+ * A held frame now lives from delivery until the runner has its `FrameResult`
31040
+ * — at which moment the runner cuts the subject tiles it actually wanted and
31041
+ * releases the frame. The bound exists only so a runner that stops answering
31042
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
31043
+ *
31044
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
31045
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
31046
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
31047
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
31048
+ * `holdOverflow` on the metrics line is what says you need it.
31030
31049
  */
31031
- ttlMs: number().int().min(250).max(1e4),
31050
+ holdFrames: number().int().min(1).max(64),
31032
31051
  /**
31033
31052
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
31034
31053
  *
31035
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
31036
- * which one is actually binding before reasoning from that. At the shipped
31037
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
31038
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
31039
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
31040
- * change that admits fewer frames buys retention WINDOW at constant RAM
31041
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
31054
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
31055
+ * is what decides how much is held, and the ceiling is the number above which
31056
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
31057
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
31058
+ * with the TTL expiring nothing, which is exactly the confusion the hold
31059
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
31042
31060
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
31043
31061
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
31044
31062
  * to replace).
@@ -31064,22 +31082,45 @@ object({
31064
31082
  * there is the signal that some caller names frames outside the inference set
31065
31083
  * and that this must go back to `all`.
31066
31084
  */
31067
- admission: NativeLeaseAdmissionSchema
31085
+ admission: NativeLeaseAdmissionSchema,
31086
+ /**
31087
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
31088
+ * compressed native crops the worker cuts at the moment a frame's detection
31089
+ * result arrives, and keeps long after the frame itself is freed.
31090
+ *
31091
+ * This is the knob that replaced the old retention window, and it buys about
31092
+ * three orders of magnitude more of it: a tile is one subject at native
31093
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
31094
+ * the frame it was cut from. A frame on which nothing was detected costs
31095
+ * nothing at all, which is the real change — the old lease paid per FRAME and
31096
+ * was interrogated per SUBJECT.
31097
+ *
31098
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
31099
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
31100
+ * reproduce that.
31101
+ */
31102
+ tileBudgetMb: number().int().min(0).max(1024)
31068
31103
  });
31069
31104
  /**
31070
- * The values in force when the operator has set nothing — byte-for-byte the
31071
- * constants the decode worker shipped with as env-var defaults, so making these
31072
- * settings changed no behaviour on the day it landed.
31105
+ * The values in force when the operator has set nothing.
31106
+ *
31107
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
31108
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
31109
+ * in the same change that redefines it would make a regression and a retune
31110
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31111
+ * live traffic.
31073
31112
  */
31074
31113
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
31075
- ttlMs: 1200,
31114
+ holdFrames: 8,
31076
31115
  budgetMb: 1024,
31077
31116
  activityMs: 15e3,
31117
+ tileBudgetMb: 64,
31078
31118
  admission: "inferred"
31079
31119
  };
31080
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31120
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
31081
31121
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
31082
31122
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31123
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
31083
31124
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
31084
31125
  //#endregion
31085
31126
  //#region src/custom-actions.ts
@@ -23857,13 +23857,24 @@ method(object({
23857
23857
  /** Playback-speed multiplier for the render (1 = realtime). */
23858
23858
  var ExportSpeedSchema = number().min(.25).max(32);
23859
23859
  /**
23860
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23860
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23861
23861
  *
23862
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23863
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23864
- * playlist. Handing it absolute epochs would make every call site responsible
23865
- * for the same subtraction, and the one that forgot would emit a filter that
23866
- * selects nothing — silently, as a uniform timelapse.
23862
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23863
+ * derives these bounds from things that happened at a TIME (a track's
23864
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23865
+ * every segment present for the range, with each recording GAP removed. The
23866
+ * two agree only on a window that recorded without one interruption, and only
23867
+ * the render side knows the segments, so the translation lives there
23868
+ * (`export-dense-map.ts`, addon-pipeline).
23869
+ *
23870
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23871
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23872
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23873
+ * the video was a uniform timelapse, and the log line reported the five ranges
23874
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23875
+ *
23876
+ * Relative and not absolute epoch, because an absolute epoch would make every
23877
+ * call site responsible for the same subtraction.
23867
23878
  */
23868
23879
  var ExportDenseRangeSchema = object({
23869
23880
  fromSec: number().nonnegative(),
@@ -30993,25 +31004,32 @@ object({
30993
31004
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30994
31005
  object({
30995
31006
  /**
30996
- * How long a retained native frame is served before it counts as a miss.
31007
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
31008
+ * detection result.
30997
31009
  *
30998
- * Must cover the FULL late-crop horizon: detection inference + the
30999
- * cross-process inference-result hop to hub post-analysis + tracking + the
31000
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
31001
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
31002
- * RAM per busy camera grows linearly with no measured hit-rate gain.
31010
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
31011
+ * a time window was never related to the event the pixels were waiting for.
31012
+ * A held frame now lives from delivery until the runner has its `FrameResult`
31013
+ * — at which moment the runner cuts the subject tiles it actually wanted and
31014
+ * releases the frame. The bound exists only so a runner that stops answering
31015
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
31016
+ *
31017
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
31018
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
31019
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
31020
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
31021
+ * `holdOverflow` on the metrics line is what says you need it.
31003
31022
  */
31004
- ttlMs: number().int().min(250).max(1e4),
31023
+ holdFrames: number().int().min(1).max(64),
31005
31024
  /**
31006
31025
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
31007
31026
  *
31008
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
31009
- * which one is actually binding before reasoning from that. At the shipped
31010
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
31011
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
31012
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
31013
- * change that admits fewer frames buys retention WINDOW at constant RAM
31014
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
31027
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
31028
+ * is what decides how much is held, and the ceiling is the number above which
31029
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
31030
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
31031
+ * with the TTL expiring nothing, which is exactly the confusion the hold
31032
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
31015
31033
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
31016
31034
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
31017
31035
  * to replace).
@@ -31037,22 +31055,45 @@ object({
31037
31055
  * there is the signal that some caller names frames outside the inference set
31038
31056
  * and that this must go back to `all`.
31039
31057
  */
31040
- admission: NativeLeaseAdmissionSchema
31058
+ admission: NativeLeaseAdmissionSchema,
31059
+ /**
31060
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
31061
+ * compressed native crops the worker cuts at the moment a frame's detection
31062
+ * result arrives, and keeps long after the frame itself is freed.
31063
+ *
31064
+ * This is the knob that replaced the old retention window, and it buys about
31065
+ * three orders of magnitude more of it: a tile is one subject at native
31066
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
31067
+ * the frame it was cut from. A frame on which nothing was detected costs
31068
+ * nothing at all, which is the real change — the old lease paid per FRAME and
31069
+ * was interrogated per SUBJECT.
31070
+ *
31071
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
31072
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
31073
+ * reproduce that.
31074
+ */
31075
+ tileBudgetMb: number().int().min(0).max(1024)
31041
31076
  });
31042
31077
  /**
31043
- * The values in force when the operator has set nothing — byte-for-byte the
31044
- * constants the decode worker shipped with as env-var defaults, so making these
31045
- * settings changed no behaviour on the day it landed.
31078
+ * The values in force when the operator has set nothing.
31079
+ *
31080
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
31081
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
31082
+ * in the same change that redefines it would make a regression and a retune
31083
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31084
+ * live traffic.
31046
31085
  */
31047
31086
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
31048
- ttlMs: 1200,
31087
+ holdFrames: 8,
31049
31088
  budgetMb: 1024,
31050
31089
  activityMs: 15e3,
31090
+ tileBudgetMb: 64,
31051
31091
  admission: "inferred"
31052
31092
  };
31053
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31093
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
31054
31094
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
31055
31095
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31096
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
31056
31097
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
31057
31098
  //#endregion
31058
31099
  //#region src/custom-actions.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.18",
3
+ "version": "1.2.19",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",