@camstack/addon-provider-petkit 0.2.14 → 0.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.
package/dist/addon.js CHANGED
@@ -26268,13 +26268,24 @@ method(object({
26268
26268
  /** Playback-speed multiplier for the render (1 = realtime). */
26269
26269
  var ExportSpeedSchema = number().min(.25).max(32);
26270
26270
  /**
26271
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26271
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
26272
26272
  *
26273
- * Relative and not absolute epoch on purpose: the renderer's frame-select
26274
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26275
- * playlist. Handing it absolute epochs would make every call site responsible
26276
- * for the same subtraction, and the one that forgot would emit a filter that
26277
- * selects nothing silently, as a uniform timelapse.
26273
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
26274
+ * derives these bounds from things that happened at a TIME (a track's
26275
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
26276
+ * every segment present for the range, with each recording GAP removed. The
26277
+ * two agree only on a window that recorded without one interruption, and only
26278
+ * the render side knows the segments, so the translation lives there
26279
+ * (`export-dense-map.ts`, addon-pipeline).
26280
+ *
26281
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
26282
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26283
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26284
+ * the video was a uniform timelapse, and the log line reported the five ranges
26285
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26286
+ *
26287
+ * Relative and not absolute epoch, because an absolute epoch would make every
26288
+ * call site responsible for the same subtraction.
26278
26289
  */
26279
26290
  var ExportDenseRangeSchema = object({
26280
26291
  fromSec: number().nonnegative(),
@@ -34888,25 +34899,32 @@ object({
34888
34899
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34889
34900
  object({
34890
34901
  /**
34891
- * How long a retained native frame is served before it counts as a miss.
34902
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34903
+ * detection result.
34892
34904
  *
34893
- * Must cover the FULL late-crop horizon: detection inference + the
34894
- * cross-process inference-result hop to hub post-analysis + tracking + the
34895
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34896
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34897
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34905
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34906
+ * a time window was never related to the event the pixels were waiting for.
34907
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34908
+ * at which moment the runner cuts the subject tiles it actually wanted and
34909
+ * releases the frame. The bound exists only so a runner that stops answering
34910
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34911
+ *
34912
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34913
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34914
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34915
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34916
+ * `holdOverflow` on the metrics line is what says you need it.
34898
34917
  */
34899
- ttlMs: number().int().min(250).max(1e4),
34918
+ holdFrames: number().int().min(1).max(64),
34900
34919
  /**
34901
34920
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34902
34921
  *
34903
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34904
- * which one is actually binding before reasoning from that. At the shipped
34905
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34906
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34907
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34908
- * change that admits fewer frames buys retention WINDOW at constant RAM
34909
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34922
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34923
+ * is what decides how much is held, and the ceiling is the number above which
34924
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34925
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34926
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34927
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34910
34928
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34911
34929
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34912
34930
  * to replace).
@@ -34932,22 +34950,45 @@ object({
34932
34950
  * there is the signal that some caller names frames outside the inference set
34933
34951
  * and that this must go back to `all`.
34934
34952
  */
34935
- admission: NativeLeaseAdmissionSchema
34953
+ admission: NativeLeaseAdmissionSchema,
34954
+ /**
34955
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34956
+ * compressed native crops the worker cuts at the moment a frame's detection
34957
+ * result arrives, and keeps long after the frame itself is freed.
34958
+ *
34959
+ * This is the knob that replaced the old retention window, and it buys about
34960
+ * three orders of magnitude more of it: a tile is one subject at native
34961
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34962
+ * the frame it was cut from. A frame on which nothing was detected costs
34963
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34964
+ * was interrogated per SUBJECT.
34965
+ *
34966
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34967
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34968
+ * reproduce that.
34969
+ */
34970
+ tileBudgetMb: number().int().min(0).max(1024)
34936
34971
  });
34937
34972
  /**
34938
- * The values in force when the operator has set nothing — byte-for-byte the
34939
- * constants the decode worker shipped with as env-var defaults, so making these
34940
- * settings changed no behaviour on the day it landed.
34973
+ * The values in force when the operator has set nothing.
34974
+ *
34975
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34976
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34977
+ * in the same change that redefines it would make a regression and a retune
34978
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34979
+ * live traffic.
34941
34980
  */
34942
34981
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34943
- ttlMs: 1200,
34982
+ holdFrames: 8,
34944
34983
  budgetMb: 1024,
34945
34984
  activityMs: 15e3,
34985
+ tileBudgetMb: 64,
34946
34986
  admission: "inferred"
34947
34987
  };
34948
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34988
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34949
34989
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34950
34990
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34991
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34951
34992
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34952
34993
  //#endregion
34953
34994
  //#region src/config.ts
package/dist/addon.mjs CHANGED
@@ -26267,13 +26267,24 @@ method(object({
26267
26267
  /** Playback-speed multiplier for the render (1 = realtime). */
26268
26268
  var ExportSpeedSchema = number().min(.25).max(32);
26269
26269
  /**
26270
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26270
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
26271
26271
  *
26272
- * Relative and not absolute epoch on purpose: the renderer's frame-select
26273
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26274
- * playlist. Handing it absolute epochs would make every call site responsible
26275
- * for the same subtraction, and the one that forgot would emit a filter that
26276
- * selects nothing silently, as a uniform timelapse.
26272
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
26273
+ * derives these bounds from things that happened at a TIME (a track's
26274
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
26275
+ * every segment present for the range, with each recording GAP removed. The
26276
+ * two agree only on a window that recorded without one interruption, and only
26277
+ * the render side knows the segments, so the translation lives there
26278
+ * (`export-dense-map.ts`, addon-pipeline).
26279
+ *
26280
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
26281
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26282
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26283
+ * the video was a uniform timelapse, and the log line reported the five ranges
26284
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26285
+ *
26286
+ * Relative and not absolute epoch, because an absolute epoch would make every
26287
+ * call site responsible for the same subtraction.
26277
26288
  */
26278
26289
  var ExportDenseRangeSchema = object({
26279
26290
  fromSec: number().nonnegative(),
@@ -34887,25 +34898,32 @@ object({
34887
34898
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34888
34899
  object({
34889
34900
  /**
34890
- * How long a retained native frame is served before it counts as a miss.
34901
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34902
+ * detection result.
34891
34903
  *
34892
- * Must cover the FULL late-crop horizon: detection inference + the
34893
- * cross-process inference-result hop to hub post-analysis + tracking + the
34894
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34895
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34896
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34904
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34905
+ * a time window was never related to the event the pixels were waiting for.
34906
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34907
+ * at which moment the runner cuts the subject tiles it actually wanted and
34908
+ * releases the frame. The bound exists only so a runner that stops answering
34909
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34910
+ *
34911
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34912
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34913
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34914
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34915
+ * `holdOverflow` on the metrics line is what says you need it.
34897
34916
  */
34898
- ttlMs: number().int().min(250).max(1e4),
34917
+ holdFrames: number().int().min(1).max(64),
34899
34918
  /**
34900
34919
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34901
34920
  *
34902
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34903
- * which one is actually binding before reasoning from that. At the shipped
34904
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34905
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34906
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34907
- * change that admits fewer frames buys retention WINDOW at constant RAM
34908
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34921
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34922
+ * is what decides how much is held, and the ceiling is the number above which
34923
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34924
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34925
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34926
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34909
34927
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34910
34928
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34911
34929
  * to replace).
@@ -34931,22 +34949,45 @@ object({
34931
34949
  * there is the signal that some caller names frames outside the inference set
34932
34950
  * and that this must go back to `all`.
34933
34951
  */
34934
- admission: NativeLeaseAdmissionSchema
34952
+ admission: NativeLeaseAdmissionSchema,
34953
+ /**
34954
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34955
+ * compressed native crops the worker cuts at the moment a frame's detection
34956
+ * result arrives, and keeps long after the frame itself is freed.
34957
+ *
34958
+ * This is the knob that replaced the old retention window, and it buys about
34959
+ * three orders of magnitude more of it: a tile is one subject at native
34960
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34961
+ * the frame it was cut from. A frame on which nothing was detected costs
34962
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34963
+ * was interrogated per SUBJECT.
34964
+ *
34965
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34966
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34967
+ * reproduce that.
34968
+ */
34969
+ tileBudgetMb: number().int().min(0).max(1024)
34935
34970
  });
34936
34971
  /**
34937
- * The values in force when the operator has set nothing — byte-for-byte the
34938
- * constants the decode worker shipped with as env-var defaults, so making these
34939
- * settings changed no behaviour on the day it landed.
34972
+ * The values in force when the operator has set nothing.
34973
+ *
34974
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34975
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34976
+ * in the same change that redefines it would make a regression and a retune
34977
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34978
+ * live traffic.
34940
34979
  */
34941
34980
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34942
- ttlMs: 1200,
34981
+ holdFrames: 8,
34943
34982
  budgetMb: 1024,
34944
34983
  activityMs: 15e3,
34984
+ tileBudgetMb: 64,
34945
34985
  admission: "inferred"
34946
34986
  };
34947
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34987
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34948
34988
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34949
34989
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34990
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34950
34991
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34951
34992
  //#endregion
34952
34993
  //#region src/config.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",