@camstack/addon-agent-ui 1.2.14 → 1.2.16

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 (2) hide show
  1. package/dist/addon.js +140 -36
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -12961,7 +12961,23 @@ var NotificationActionSchema = object({
12961
12961
  * else — see `notification-center/action-token.ts` for what that does and
12962
12962
  * does not buy.
12963
12963
  */
12964
- destructive: boolean().optional()
12964
+ destructive: boolean().optional(),
12965
+ /**
12966
+ * How the tap should REACH the url.
12967
+ *
12968
+ * `navigate` (absent, and every button authored before this field) opens it:
12969
+ * the phone leaves the notification and shows whatever the callback returns.
12970
+ * That is right for a button whose answer the operator wants to read.
12971
+ *
12972
+ * `background` fires it as a POST and stays put. It exists for the buttons
12973
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
12974
+ * an answer to the notification, and being thrown into a browser tab to
12975
+ * confirm it costs more attention than the notification did. A backend that
12976
+ * cannot do a background call renders it as an ordinary link (the adapters
12977
+ * fall back rather than dropping the button), so this is a preference, never
12978
+ * a requirement.
12979
+ */
12980
+ mode: _enum(["navigate", "background"]).optional()
12965
12981
  });
12966
12982
  /**
12967
12983
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13962,6 +13978,9 @@ var NcSystemEventConditionSchema = object({
13962
13978
  nodeIds: array(string().min(1)).min(1).optional(),
13963
13979
  packageNames: array(string().min(1)).min(1).optional()
13964
13980
  });
13981
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
13982
+ * outage the operator asked for once and forgot. */
13983
+ var NC_SNOOZE_MAX_MINUTES = 1440;
13965
13984
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
13966
13985
  var NcScheduleSchema = object({
13967
13986
  windows: array(object({
@@ -14338,15 +14357,15 @@ var NcConditionsSchema = object({
14338
14357
  * (an `immediate` rule naming an `audio-*` class, one notification per
14339
14358
  * classified sample) stays exactly as it was for rules that already use it.
14340
14359
  *
14341
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14342
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14343
- * (`camstack/src/data/notification-center.ts`, guarded by
14344
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14360
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14361
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14362
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14363
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14345
14364
  * condition fields it does not know when a rule is saved from the phone.
14346
14365
  * Publishing an editor for a condition the app cannot round-trip is how an
14347
- * operator loses a rule's conditions by opening it — so the descriptor, the
14348
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14349
- * does an audio rule become authorable.
14366
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14367
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14368
+ * follows here.
14350
14369
  */
14351
14370
  audio: NcAudioConditionSchema.optional()
14352
14371
  });
@@ -14582,6 +14601,30 @@ var NcRuleInputSchema = object({
14582
14601
  */
14583
14602
  snoozeAllowGlobal: boolean().optional(),
14584
14603
  /**
14604
+ * The snooze durations THIS rule's notification offers as buttons, in
14605
+ * minutes.
14606
+ *
14607
+ * Three states, and all three are distinct — which is exactly why this is
14608
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14609
+ * addon cap path (three production failures in one day), so a schema default
14610
+ * would collapse the first two:
14611
+ *
14612
+ * | value | meaning |
14613
+ * | --- | --- |
14614
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14615
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14616
+ * | a list | these choices, de-duplicated and sorted, at most four |
14617
+ *
14618
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14619
+ * three buttons in total) and a rule that spent it all on snooze choices
14620
+ * would push its own tap-through actions off the notification.
14621
+ *
14622
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14623
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14624
+ * window from anywhere (D133).
14625
+ */
14626
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14627
+ /**
14585
14628
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14586
14629
  *
14587
14630
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14681,6 +14724,7 @@ var NcConditionDescriptorSchema = object({
14681
14724
  "device",
14682
14725
  "package",
14683
14726
  "occupancy",
14727
+ "audio",
14684
14728
  "system"
14685
14729
  ]),
14686
14730
  label: string(),
@@ -14699,6 +14743,7 @@ var NcConditionDescriptorSchema = object({
14699
14743
  "crossingSelect",
14700
14744
  "polygonDraw",
14701
14745
  "occupancy",
14746
+ "audio",
14702
14747
  "deviceState",
14703
14748
  "systemEvent"
14704
14749
  ]),
@@ -14850,7 +14895,20 @@ var NcSnoozeInputSchema = object({
14850
14895
  ruleId: string().optional(),
14851
14896
  /** Required when `scope: 'device'`. */
14852
14897
  deviceId: number().int().optional(),
14853
- durationMinutes: number().int().min(1).max(1440),
14898
+ /**
14899
+ * Narrow the window to these subject classes — "the cat, not the person".
14900
+ *
14901
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
14902
+ * what every window authored before this field meant, so no persisted row
14903
+ * changes meaning and no client has to learn anything to keep working.
14904
+ *
14905
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
14906
+ * cross rules (D133): the operator points at a camera and a kind of thing,
14907
+ * not at whichever of their four rules happened to produce the notification
14908
+ * they are dismissing.
14909
+ */
14910
+ classes: array(string().min(1)).min(1).optional(),
14911
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
14854
14912
  /**
14855
14913
  * Silence this for EVERY recipient, not just the caller. Permission is
14856
14914
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -14875,6 +14933,10 @@ var NcSnoozeSchema = object({
14875
14933
  scope: NcSnoozeScopeSchema,
14876
14934
  ruleId: string().optional(),
14877
14935
  deviceId: number().int().optional(),
14936
+ /** Subject classes this window covers. ABSENT = every class — see
14937
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
14938
+ * no SQLite column: nothing queries a window by class. */
14939
+ classes: array(string().min(1)).min(1).optional(),
14878
14940
  startedAt: number(),
14879
14941
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
14880
14942
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -23577,13 +23639,24 @@ method(object({
23577
23639
  /** Playback-speed multiplier for the render (1 = realtime). */
23578
23640
  var ExportSpeedSchema = number().min(.25).max(32);
23579
23641
  /**
23580
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23642
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23643
+ *
23644
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23645
+ * derives these bounds from things that happened at a TIME (a track's
23646
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23647
+ * every segment present for the range, with each recording GAP removed. The
23648
+ * two agree only on a window that recorded without one interruption, and only
23649
+ * the render side knows the segments, so the translation lives there
23650
+ * (`export-dense-map.ts`, addon-pipeline).
23651
+ *
23652
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23653
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23654
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23655
+ * the video was a uniform timelapse, and the log line reported the five ranges
23656
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23581
23657
  *
23582
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23583
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23584
- * playlist. Handing it absolute epochs would make every call site responsible
23585
- * for the same subtraction, and the one that forgot would emit a filter that
23586
- * selects nothing — silently, as a uniform timelapse.
23658
+ * Relative and not absolute epoch, because an absolute epoch would make every
23659
+ * call site responsible for the same subtraction.
23587
23660
  */
23588
23661
  var ExportDenseRangeSchema = object({
23589
23662
  fromSec: number().nonnegative(),
@@ -30436,6 +30509,7 @@ Object.freeze({
30436
30509
  "network-access": "ingress",
30437
30510
  "smtp-provider": "email"
30438
30511
  });
30512
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30439
30513
  new Set(["devices", "classes"]);
30440
30514
  /**
30441
30515
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -30713,25 +30787,32 @@ object({
30713
30787
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30714
30788
  object({
30715
30789
  /**
30716
- * How long a retained native frame is served before it counts as a miss.
30790
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30791
+ * detection result.
30717
30792
  *
30718
- * Must cover the FULL late-crop horizon: detection inference + the
30719
- * cross-process inference-result hop to hub post-analysis + tracking + the
30720
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30721
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30722
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30793
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30794
+ * a time window was never related to the event the pixels were waiting for.
30795
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30796
+ * at which moment the runner cuts the subject tiles it actually wanted and
30797
+ * releases the frame. The bound exists only so a runner that stops answering
30798
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30799
+ *
30800
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30801
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30802
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30803
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30804
+ * `holdOverflow` on the metrics line is what says you need it.
30723
30805
  */
30724
- ttlMs: number().int().min(250).max(1e4),
30806
+ holdFrames: number().int().min(1).max(64),
30725
30807
  /**
30726
30808
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30727
30809
  *
30728
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30729
- * which one is actually binding before reasoning from that. At the shipped
30730
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30731
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30732
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30733
- * change that admits fewer frames buys retention WINDOW at constant RAM
30734
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30810
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30811
+ * is what decides how much is held, and the ceiling is the number above which
30812
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30813
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30814
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30815
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30735
30816
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30736
30817
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30737
30818
  * to replace).
@@ -30757,22 +30838,45 @@ object({
30757
30838
  * there is the signal that some caller names frames outside the inference set
30758
30839
  * and that this must go back to `all`.
30759
30840
  */
30760
- admission: NativeLeaseAdmissionSchema
30841
+ admission: NativeLeaseAdmissionSchema,
30842
+ /**
30843
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30844
+ * compressed native crops the worker cuts at the moment a frame's detection
30845
+ * result arrives, and keeps long after the frame itself is freed.
30846
+ *
30847
+ * This is the knob that replaced the old retention window, and it buys about
30848
+ * three orders of magnitude more of it: a tile is one subject at native
30849
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30850
+ * the frame it was cut from. A frame on which nothing was detected costs
30851
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30852
+ * was interrogated per SUBJECT.
30853
+ *
30854
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30855
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30856
+ * reproduce that.
30857
+ */
30858
+ tileBudgetMb: number().int().min(0).max(1024)
30761
30859
  });
30762
30860
  /**
30763
- * The values in force when the operator has set nothing — byte-for-byte the
30764
- * constants the decode worker shipped with as env-var defaults, so making these
30765
- * settings changed no behaviour on the day it landed.
30861
+ * The values in force when the operator has set nothing.
30862
+ *
30863
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30864
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30865
+ * in the same change that redefines it would make a regression and a retune
30866
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
30867
+ * live traffic.
30766
30868
  */
30767
30869
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30768
- ttlMs: 1200,
30870
+ holdFrames: 8,
30769
30871
  budgetMb: 1024,
30770
30872
  activityMs: 15e3,
30873
+ tileBudgetMb: 64,
30771
30874
  admission: "inferred"
30772
30875
  };
30773
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
30876
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30774
30877
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30775
30878
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
30879
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30776
30880
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30777
30881
  //#endregion
30778
30882
  //#region src/addon.ts
@@ -30795,7 +30899,7 @@ var AgentUIAddon = class extends BaseAddon {
30795
30899
  capability: adminUiCapability,
30796
30900
  provider: {
30797
30901
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
30798
- getVersion: async () => ({ version: "1.2.14" })
30902
+ getVersion: async () => ({ version: "1.2.16" })
30799
30903
  }
30800
30904
  }];
30801
30905
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.14",
3
+ "version": "1.2.16",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",