@camstack/addon-terminal 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -25309,13 +25309,24 @@ method(object({
25309
25309
  /** Playback-speed multiplier for the render (1 = realtime). */
25310
25310
  var ExportSpeedSchema = number().min(.25).max(32);
25311
25311
  /**
25312
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25312
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25313
25313
  *
25314
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25315
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25316
- * playlist. Handing it absolute epochs would make every call site responsible
25317
- * for the same subtraction, and the one that forgot would emit a filter that
25318
- * selects nothing silently, as a uniform timelapse.
25314
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25315
+ * derives these bounds from things that happened at a TIME (a track's
25316
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25317
+ * every segment present for the range, with each recording GAP removed. The
25318
+ * two agree only on a window that recorded without one interruption, and only
25319
+ * the render side knows the segments, so the translation lives there
25320
+ * (`export-dense-map.ts`, addon-pipeline).
25321
+ *
25322
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25323
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25324
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25325
+ * the video was a uniform timelapse, and the log line reported the five ranges
25326
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25327
+ *
25328
+ * Relative and not absolute epoch, because an absolute epoch would make every
25329
+ * call site responsible for the same subtraction.
25319
25330
  */
25320
25331
  var ExportDenseRangeSchema = object({
25321
25332
  fromSec: number().nonnegative(),
@@ -33941,25 +33952,32 @@ object({
33941
33952
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33942
33953
  object({
33943
33954
  /**
33944
- * How long a retained native frame is served before it counts as a miss.
33955
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33956
+ * detection result.
33945
33957
  *
33946
- * Must cover the FULL late-crop horizon: detection inference + the
33947
- * cross-process inference-result hop to hub post-analysis + tracking + the
33948
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33949
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33950
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33958
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33959
+ * a time window was never related to the event the pixels were waiting for.
33960
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33961
+ * at which moment the runner cuts the subject tiles it actually wanted and
33962
+ * releases the frame. The bound exists only so a runner that stops answering
33963
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33964
+ *
33965
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33966
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33967
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33968
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33969
+ * `holdOverflow` on the metrics line is what says you need it.
33951
33970
  */
33952
- ttlMs: number().int().min(250).max(1e4),
33971
+ holdFrames: number().int().min(1).max(64),
33953
33972
  /**
33954
33973
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33955
33974
  *
33956
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33957
- * which one is actually binding before reasoning from that. At the shipped
33958
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33959
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33960
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33961
- * change that admits fewer frames buys retention WINDOW at constant RAM
33962
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33975
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33976
+ * is what decides how much is held, and the ceiling is the number above which
33977
+ * something is wrong. Before that it was the effective cap at 1024 MB with
33978
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33979
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33980
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33963
33981
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33964
33982
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33965
33983
  * to replace).
@@ -33985,22 +34003,45 @@ object({
33985
34003
  * there is the signal that some caller names frames outside the inference set
33986
34004
  * and that this must go back to `all`.
33987
34005
  */
33988
- admission: NativeLeaseAdmissionSchema
34006
+ admission: NativeLeaseAdmissionSchema,
34007
+ /**
34008
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34009
+ * compressed native crops the worker cuts at the moment a frame's detection
34010
+ * result arrives, and keeps long after the frame itself is freed.
34011
+ *
34012
+ * This is the knob that replaced the old retention window, and it buys about
34013
+ * three orders of magnitude more of it: a tile is one subject at native
34014
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34015
+ * the frame it was cut from. A frame on which nothing was detected costs
34016
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34017
+ * was interrogated per SUBJECT.
34018
+ *
34019
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34020
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34021
+ * reproduce that.
34022
+ */
34023
+ tileBudgetMb: number().int().min(0).max(1024)
33989
34024
  });
33990
34025
  /**
33991
- * The values in force when the operator has set nothing — byte-for-byte the
33992
- * constants the decode worker shipped with as env-var defaults, so making these
33993
- * settings changed no behaviour on the day it landed.
34026
+ * The values in force when the operator has set nothing.
34027
+ *
34028
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34029
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34030
+ * in the same change that redefines it would make a regression and a retune
34031
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34032
+ * live traffic.
33994
34033
  */
33995
34034
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33996
- ttlMs: 1200,
34035
+ holdFrames: 8,
33997
34036
  budgetMb: 1024,
33998
34037
  activityMs: 15e3,
34038
+ tileBudgetMb: 64,
33999
34039
  admission: "inferred"
34000
34040
  };
34001
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34041
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34002
34042
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34003
34043
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34044
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34004
34045
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34005
34046
  //#endregion
34006
34047
  //#region src/curses-shim.ts
package/dist/addon.mjs CHANGED
@@ -25286,13 +25286,24 @@ method(object({
25286
25286
  /** Playback-speed multiplier for the render (1 = realtime). */
25287
25287
  var ExportSpeedSchema = number().min(.25).max(32);
25288
25288
  /**
25289
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25289
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25290
25290
  *
25291
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25292
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25293
- * playlist. Handing it absolute epochs would make every call site responsible
25294
- * for the same subtraction, and the one that forgot would emit a filter that
25295
- * selects nothing silently, as a uniform timelapse.
25291
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25292
+ * derives these bounds from things that happened at a TIME (a track's
25293
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25294
+ * every segment present for the range, with each recording GAP removed. The
25295
+ * two agree only on a window that recorded without one interruption, and only
25296
+ * the render side knows the segments, so the translation lives there
25297
+ * (`export-dense-map.ts`, addon-pipeline).
25298
+ *
25299
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25300
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25301
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25302
+ * the video was a uniform timelapse, and the log line reported the five ranges
25303
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25304
+ *
25305
+ * Relative and not absolute epoch, because an absolute epoch would make every
25306
+ * call site responsible for the same subtraction.
25296
25307
  */
25297
25308
  var ExportDenseRangeSchema = object({
25298
25309
  fromSec: number().nonnegative(),
@@ -33918,25 +33929,32 @@ object({
33918
33929
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33919
33930
  object({
33920
33931
  /**
33921
- * How long a retained native frame is served before it counts as a miss.
33932
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
33933
+ * detection result.
33922
33934
  *
33923
- * Must cover the FULL late-crop horizon: detection inference + the
33924
- * cross-process inference-result hop to hub post-analysis + tracking + the
33925
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33926
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33927
- * RAM per busy camera grows linearly with no measured hit-rate gain.
33935
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
33936
+ * a time window was never related to the event the pixels were waiting for.
33937
+ * A held frame now lives from delivery until the runner has its `FrameResult`
33938
+ * at which moment the runner cuts the subject tiles it actually wanted and
33939
+ * releases the frame. The bound exists only so a runner that stops answering
33940
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
33941
+ *
33942
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
33943
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
33944
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
33945
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
33946
+ * `holdOverflow` on the metrics line is what says you need it.
33928
33947
  */
33929
- ttlMs: number().int().min(250).max(1e4),
33948
+ holdFrames: number().int().min(1).max(64),
33930
33949
  /**
33931
33950
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33932
33951
  *
33933
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33934
- * which one is actually binding before reasoning from that. At the shipped
33935
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33936
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33937
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33938
- * change that admits fewer frames buys retention WINDOW at constant RAM
33939
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
33952
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
33953
+ * is what decides how much is held, and the ceiling is the number above which
33954
+ * something is wrong. Before that it was the effective cap at 1024 MB with
33955
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
33956
+ * with the TTL expiring nothing, which is exactly the confusion the hold
33957
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33940
33958
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33941
33959
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33942
33960
  * to replace).
@@ -33962,22 +33980,45 @@ object({
33962
33980
  * there is the signal that some caller names frames outside the inference set
33963
33981
  * and that this must go back to `all`.
33964
33982
  */
33965
- admission: NativeLeaseAdmissionSchema
33983
+ admission: NativeLeaseAdmissionSchema,
33984
+ /**
33985
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
33986
+ * compressed native crops the worker cuts at the moment a frame's detection
33987
+ * result arrives, and keeps long after the frame itself is freed.
33988
+ *
33989
+ * This is the knob that replaced the old retention window, and it buys about
33990
+ * three orders of magnitude more of it: a tile is one subject at native
33991
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
33992
+ * the frame it was cut from. A frame on which nothing was detected costs
33993
+ * nothing at all, which is the real change — the old lease paid per FRAME and
33994
+ * was interrogated per SUBJECT.
33995
+ *
33996
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
33997
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
33998
+ * reproduce that.
33999
+ */
34000
+ tileBudgetMb: number().int().min(0).max(1024)
33966
34001
  });
33967
34002
  /**
33968
- * The values in force when the operator has set nothing — byte-for-byte the
33969
- * constants the decode worker shipped with as env-var defaults, so making these
33970
- * settings changed no behaviour on the day it landed.
34003
+ * The values in force when the operator has set nothing.
34004
+ *
34005
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34006
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34007
+ * in the same change that redefines it would make a regression and a retune
34008
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34009
+ * live traffic.
33971
34010
  */
33972
34011
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33973
- ttlMs: 1200,
34012
+ holdFrames: 8,
33974
34013
  budgetMb: 1024,
33975
34014
  activityMs: 15e3,
34015
+ tileBudgetMb: 64,
33976
34016
  admission: "inferred"
33977
34017
  };
33978
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34018
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33979
34019
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33980
34020
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34021
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33981
34022
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33982
34023
  //#endregion
33983
34024
  //#region src/curses-shim.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-terminal",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",