@camstack/addon-provider-tuya 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
@@ -25986,13 +25986,24 @@ method(object({
25986
25986
  /** Playback-speed multiplier for the render (1 = realtime). */
25987
25987
  var ExportSpeedSchema = number().min(.25).max(32);
25988
25988
  /**
25989
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25989
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25990
25990
  *
25991
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25992
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25993
- * playlist. Handing it absolute epochs would make every call site responsible
25994
- * for the same subtraction, and the one that forgot would emit a filter that
25995
- * selects nothing silently, as a uniform timelapse.
25991
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25992
+ * derives these bounds from things that happened at a TIME (a track's
25993
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25994
+ * every segment present for the range, with each recording GAP removed. The
25995
+ * two agree only on a window that recorded without one interruption, and only
25996
+ * the render side knows the segments, so the translation lives there
25997
+ * (`export-dense-map.ts`, addon-pipeline).
25998
+ *
25999
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
26000
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26001
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26002
+ * the video was a uniform timelapse, and the log line reported the five ranges
26003
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26004
+ *
26005
+ * Relative and not absolute epoch, because an absolute epoch would make every
26006
+ * call site responsible for the same subtraction.
25996
26007
  */
25997
26008
  var ExportDenseRangeSchema = object({
25998
26009
  fromSec: number().nonnegative(),
@@ -34606,25 +34617,32 @@ object({
34606
34617
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34607
34618
  object({
34608
34619
  /**
34609
- * How long a retained native frame is served before it counts as a miss.
34620
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34621
+ * detection result.
34610
34622
  *
34611
- * Must cover the FULL late-crop horizon: detection inference + the
34612
- * cross-process inference-result hop to hub post-analysis + tracking + the
34613
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34614
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34615
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34623
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34624
+ * a time window was never related to the event the pixels were waiting for.
34625
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34626
+ * at which moment the runner cuts the subject tiles it actually wanted and
34627
+ * releases the frame. The bound exists only so a runner that stops answering
34628
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34629
+ *
34630
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34631
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34632
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34633
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34634
+ * `holdOverflow` on the metrics line is what says you need it.
34616
34635
  */
34617
- ttlMs: number().int().min(250).max(1e4),
34636
+ holdFrames: number().int().min(1).max(64),
34618
34637
  /**
34619
34638
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34620
34639
  *
34621
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34622
- * which one is actually binding before reasoning from that. At the shipped
34623
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34624
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34625
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34626
- * change that admits fewer frames buys retention WINDOW at constant RAM
34627
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34640
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34641
+ * is what decides how much is held, and the ceiling is the number above which
34642
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34643
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34644
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34645
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34628
34646
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34629
34647
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34630
34648
  * to replace).
@@ -34650,22 +34668,45 @@ object({
34650
34668
  * there is the signal that some caller names frames outside the inference set
34651
34669
  * and that this must go back to `all`.
34652
34670
  */
34653
- admission: NativeLeaseAdmissionSchema
34671
+ admission: NativeLeaseAdmissionSchema,
34672
+ /**
34673
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34674
+ * compressed native crops the worker cuts at the moment a frame's detection
34675
+ * result arrives, and keeps long after the frame itself is freed.
34676
+ *
34677
+ * This is the knob that replaced the old retention window, and it buys about
34678
+ * three orders of magnitude more of it: a tile is one subject at native
34679
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34680
+ * the frame it was cut from. A frame on which nothing was detected costs
34681
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34682
+ * was interrogated per SUBJECT.
34683
+ *
34684
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34685
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34686
+ * reproduce that.
34687
+ */
34688
+ tileBudgetMb: number().int().min(0).max(1024)
34654
34689
  });
34655
34690
  /**
34656
- * The values in force when the operator has set nothing — byte-for-byte the
34657
- * constants the decode worker shipped with as env-var defaults, so making these
34658
- * settings changed no behaviour on the day it landed.
34691
+ * The values in force when the operator has set nothing.
34692
+ *
34693
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34694
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34695
+ * in the same change that redefines it would make a regression and a retune
34696
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34697
+ * live traffic.
34659
34698
  */
34660
34699
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34661
- ttlMs: 1200,
34700
+ holdFrames: 8,
34662
34701
  budgetMb: 1024,
34663
34702
  activityMs: 15e3,
34703
+ tileBudgetMb: 64,
34664
34704
  admission: "inferred"
34665
34705
  };
34666
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34706
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34667
34707
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34668
34708
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34709
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34669
34710
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34670
34711
  //#endregion
34671
34712
  //#region src/config.ts
package/dist/addon.mjs CHANGED
@@ -25985,13 +25985,24 @@ method(object({
25985
25985
  /** Playback-speed multiplier for the render (1 = realtime). */
25986
25986
  var ExportSpeedSchema = number().min(.25).max(32);
25987
25987
  /**
25988
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25988
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25989
25989
  *
25990
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25991
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25992
- * playlist. Handing it absolute epochs would make every call site responsible
25993
- * for the same subtraction, and the one that forgot would emit a filter that
25994
- * selects nothing silently, as a uniform timelapse.
25990
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25991
+ * derives these bounds from things that happened at a TIME (a track's
25992
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25993
+ * every segment present for the range, with each recording GAP removed. The
25994
+ * two agree only on a window that recorded without one interruption, and only
25995
+ * the render side knows the segments, so the translation lives there
25996
+ * (`export-dense-map.ts`, addon-pipeline).
25997
+ *
25998
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25999
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26000
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26001
+ * the video was a uniform timelapse, and the log line reported the five ranges
26002
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26003
+ *
26004
+ * Relative and not absolute epoch, because an absolute epoch would make every
26005
+ * call site responsible for the same subtraction.
25995
26006
  */
25996
26007
  var ExportDenseRangeSchema = object({
25997
26008
  fromSec: number().nonnegative(),
@@ -34605,25 +34616,32 @@ object({
34605
34616
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34606
34617
  object({
34607
34618
  /**
34608
- * How long a retained native frame is served before it counts as a miss.
34619
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34620
+ * detection result.
34609
34621
  *
34610
- * Must cover the FULL late-crop horizon: detection inference + the
34611
- * cross-process inference-result hop to hub post-analysis + tracking + the
34612
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34613
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34614
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34622
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34623
+ * a time window was never related to the event the pixels were waiting for.
34624
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34625
+ * at which moment the runner cuts the subject tiles it actually wanted and
34626
+ * releases the frame. The bound exists only so a runner that stops answering
34627
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34628
+ *
34629
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34630
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34631
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34632
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34633
+ * `holdOverflow` on the metrics line is what says you need it.
34615
34634
  */
34616
- ttlMs: number().int().min(250).max(1e4),
34635
+ holdFrames: number().int().min(1).max(64),
34617
34636
  /**
34618
34637
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34619
34638
  *
34620
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34621
- * which one is actually binding before reasoning from that. At the shipped
34622
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34623
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34624
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34625
- * change that admits fewer frames buys retention WINDOW at constant RAM
34626
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34639
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34640
+ * is what decides how much is held, and the ceiling is the number above which
34641
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34642
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34643
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34644
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34627
34645
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34628
34646
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34629
34647
  * to replace).
@@ -34649,22 +34667,45 @@ object({
34649
34667
  * there is the signal that some caller names frames outside the inference set
34650
34668
  * and that this must go back to `all`.
34651
34669
  */
34652
- admission: NativeLeaseAdmissionSchema
34670
+ admission: NativeLeaseAdmissionSchema,
34671
+ /**
34672
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34673
+ * compressed native crops the worker cuts at the moment a frame's detection
34674
+ * result arrives, and keeps long after the frame itself is freed.
34675
+ *
34676
+ * This is the knob that replaced the old retention window, and it buys about
34677
+ * three orders of magnitude more of it: a tile is one subject at native
34678
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34679
+ * the frame it was cut from. A frame on which nothing was detected costs
34680
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34681
+ * was interrogated per SUBJECT.
34682
+ *
34683
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34684
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34685
+ * reproduce that.
34686
+ */
34687
+ tileBudgetMb: number().int().min(0).max(1024)
34653
34688
  });
34654
34689
  /**
34655
- * The values in force when the operator has set nothing — byte-for-byte the
34656
- * constants the decode worker shipped with as env-var defaults, so making these
34657
- * settings changed no behaviour on the day it landed.
34690
+ * The values in force when the operator has set nothing.
34691
+ *
34692
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34693
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34694
+ * in the same change that redefines it would make a regression and a retune
34695
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34696
+ * live traffic.
34658
34697
  */
34659
34698
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34660
- ttlMs: 1200,
34699
+ holdFrames: 8,
34661
34700
  budgetMb: 1024,
34662
34701
  activityMs: 15e3,
34702
+ tileBudgetMb: 64,
34663
34703
  admission: "inferred"
34664
34704
  };
34665
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34705
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34666
34706
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34667
34707
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34708
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34668
34709
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34669
34710
  //#endregion
34670
34711
  //#region src/config.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",