@camstack/addon-notifiers 1.2.18 → 1.2.20

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 (3) hide show
  1. package/dist/addon.js +205 -50
  2. package/dist/addon.mjs +205 -50
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -13141,7 +13141,23 @@ var NotificationActionSchema = object({
13141
13141
  * else — see `notification-center/action-token.ts` for what that does and
13142
13142
  * does not buy.
13143
13143
  */
13144
- destructive: boolean().optional()
13144
+ destructive: boolean().optional(),
13145
+ /**
13146
+ * How the tap should REACH the url.
13147
+ *
13148
+ * `navigate` (absent, and every button authored before this field) opens it:
13149
+ * the phone leaves the notification and shows whatever the callback returns.
13150
+ * That is right for a button whose answer the operator wants to read.
13151
+ *
13152
+ * `background` fires it as a POST and stays put. It exists for the buttons
13153
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13154
+ * an answer to the notification, and being thrown into a browser tab to
13155
+ * confirm it costs more attention than the notification did. A backend that
13156
+ * cannot do a background call renders it as an ordinary link (the adapters
13157
+ * fall back rather than dropping the button), so this is a preference, never
13158
+ * a requirement.
13159
+ */
13160
+ mode: _enum(["navigate", "background"]).optional()
13145
13161
  });
13146
13162
  /**
13147
13163
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14156,6 +14172,9 @@ var NcSystemEventConditionSchema = object({
14156
14172
  nodeIds: array(string().min(1)).min(1).optional(),
14157
14173
  packageNames: array(string().min(1)).min(1).optional()
14158
14174
  });
14175
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14176
+ * outage the operator asked for once and forgot. */
14177
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14159
14178
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14160
14179
  var NcScheduleSchema = object({
14161
14180
  windows: array(object({
@@ -14532,15 +14551,15 @@ var NcConditionsSchema = object({
14532
14551
  * (an `immediate` rule naming an `audio-*` class, one notification per
14533
14552
  * classified sample) stays exactly as it was for rules that already use it.
14534
14553
  *
14535
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14536
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14537
- * (`camstack/src/data/notification-center.ts`, guarded by
14538
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14554
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14555
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14556
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14557
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14539
14558
  * condition fields it does not know when a rule is saved from the phone.
14540
14559
  * Publishing an editor for a condition the app cannot round-trip is how an
14541
- * operator loses a rule's conditions by opening it — so the descriptor, the
14542
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14543
- * does an audio rule become authorable.
14560
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14561
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14562
+ * follows here.
14544
14563
  */
14545
14564
  audio: NcAudioConditionSchema.optional()
14546
14565
  });
@@ -14776,6 +14795,30 @@ var NcRuleInputSchema = object({
14776
14795
  */
14777
14796
  snoozeAllowGlobal: boolean().optional(),
14778
14797
  /**
14798
+ * The snooze durations THIS rule's notification offers as buttons, in
14799
+ * minutes.
14800
+ *
14801
+ * Three states, and all three are distinct — which is exactly why this is
14802
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14803
+ * addon cap path (three production failures in one day), so a schema default
14804
+ * would collapse the first two:
14805
+ *
14806
+ * | value | meaning |
14807
+ * | --- | --- |
14808
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14809
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14810
+ * | a list | these choices, de-duplicated and sorted, at most four |
14811
+ *
14812
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14813
+ * three buttons in total) and a rule that spent it all on snooze choices
14814
+ * would push its own tap-through actions off the notification.
14815
+ *
14816
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14817
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14818
+ * window from anywhere (D133).
14819
+ */
14820
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14821
+ /**
14779
14822
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14780
14823
  *
14781
14824
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14875,6 +14918,7 @@ var NcConditionDescriptorSchema = object({
14875
14918
  "device",
14876
14919
  "package",
14877
14920
  "occupancy",
14921
+ "audio",
14878
14922
  "system"
14879
14923
  ]),
14880
14924
  label: string(),
@@ -14893,6 +14937,7 @@ var NcConditionDescriptorSchema = object({
14893
14937
  "crossingSelect",
14894
14938
  "polygonDraw",
14895
14939
  "occupancy",
14940
+ "audio",
14896
14941
  "deviceState",
14897
14942
  "systemEvent"
14898
14943
  ]),
@@ -15044,7 +15089,20 @@ var NcSnoozeInputSchema = object({
15044
15089
  ruleId: string().optional(),
15045
15090
  /** Required when `scope: 'device'`. */
15046
15091
  deviceId: number().int().optional(),
15047
- durationMinutes: number().int().min(1).max(1440),
15092
+ /**
15093
+ * Narrow the window to these subject classes — "the cat, not the person".
15094
+ *
15095
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15096
+ * what every window authored before this field meant, so no persisted row
15097
+ * changes meaning and no client has to learn anything to keep working.
15098
+ *
15099
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15100
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15101
+ * not at whichever of their four rules happened to produce the notification
15102
+ * they are dismissing.
15103
+ */
15104
+ classes: array(string().min(1)).min(1).optional(),
15105
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15048
15106
  /**
15049
15107
  * Silence this for EVERY recipient, not just the caller. Permission is
15050
15108
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15069,6 +15127,10 @@ var NcSnoozeSchema = object({
15069
15127
  scope: NcSnoozeScopeSchema,
15070
15128
  ruleId: string().optional(),
15071
15129
  deviceId: number().int().optional(),
15130
+ /** Subject classes this window covers. ABSENT = every class — see
15131
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15132
+ * no SQLite column: nothing queries a window by class. */
15133
+ classes: array(string().min(1)).min(1).optional(),
15072
15134
  startedAt: number(),
15073
15135
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15074
15136
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -23771,13 +23833,24 @@ method(object({
23771
23833
  /** Playback-speed multiplier for the render (1 = realtime). */
23772
23834
  var ExportSpeedSchema = number().min(.25).max(32);
23773
23835
  /**
23774
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23836
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23837
+ *
23838
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23839
+ * derives these bounds from things that happened at a TIME (a track's
23840
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23841
+ * every segment present for the range, with each recording GAP removed. The
23842
+ * two agree only on a window that recorded without one interruption, and only
23843
+ * the render side knows the segments, so the translation lives there
23844
+ * (`export-dense-map.ts`, addon-pipeline).
23775
23845
  *
23776
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23777
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23778
- * playlist. Handing it absolute epochs would make every call site responsible
23779
- * for the same subtraction, and the one that forgot would emit a filter that
23780
- * selects nothing silently, as a uniform timelapse.
23846
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23847
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23848
+ * gap accumulated before it up to 6,607 s, well past EOF. Nothing matched,
23849
+ * the video was a uniform timelapse, and the log line reported the five ranges
23850
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23851
+ *
23852
+ * Relative and not absolute epoch, because an absolute epoch would make every
23853
+ * call site responsible for the same subtraction.
23781
23854
  */
23782
23855
  var ExportDenseRangeSchema = object({
23783
23856
  fromSec: number().nonnegative(),
@@ -30630,6 +30703,7 @@ Object.freeze({
30630
30703
  "network-access": "ingress",
30631
30704
  "smtp-provider": "email"
30632
30705
  });
30706
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30633
30707
  new Set(["devices", "classes"]);
30634
30708
  /** Strip a small, safe subset of Markdown down to plain text. */
30635
30709
  function markdownToText(md) {
@@ -31114,25 +31188,32 @@ object({
31114
31188
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
31115
31189
  object({
31116
31190
  /**
31117
- * How long a retained native frame is served before it counts as a miss.
31191
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
31192
+ * detection result.
31193
+ *
31194
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
31195
+ * a time window was never related to the event the pixels were waiting for.
31196
+ * A held frame now lives from delivery until the runner has its `FrameResult`
31197
+ * — at which moment the runner cuts the subject tiles it actually wanted and
31198
+ * releases the frame. The bound exists only so a runner that stops answering
31199
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
31118
31200
  *
31119
- * Must cover the FULL late-crop horizon: detection inference + the
31120
- * cross-process inference-result hop to hub post-analysis + tracking + the
31121
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
31122
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
31123
- * RAM per busy camera grows linearly with no measured hit-rate gain.
31201
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
31202
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
31203
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
31204
+ * Raising it does not buy hit rate it buys tolerance for a slow runner, and
31205
+ * `holdOverflow` on the metrics line is what says you need it.
31124
31206
  */
31125
- ttlMs: number().int().min(250).max(1e4),
31207
+ holdFrames: number().int().min(1).max(64),
31126
31208
  /**
31127
31209
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
31128
31210
  *
31129
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
31130
- * which one is actually binding before reasoning from that. At the shipped
31131
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
31132
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
31133
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
31134
- * change that admits fewer frames buys retention WINDOW at constant RAM
31135
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
31211
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
31212
+ * is what decides how much is held, and the ceiling is the number above which
31213
+ * something is wrong. Before that it was the effective cap at 1024 MB with
31214
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
31215
+ * with the TTL expiring nothing, which is exactly the confusion the hold
31216
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
31136
31217
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
31137
31218
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
31138
31219
  * to replace).
@@ -31158,22 +31239,45 @@ object({
31158
31239
  * there is the signal that some caller names frames outside the inference set
31159
31240
  * and that this must go back to `all`.
31160
31241
  */
31161
- admission: NativeLeaseAdmissionSchema
31242
+ admission: NativeLeaseAdmissionSchema,
31243
+ /**
31244
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
31245
+ * compressed native crops the worker cuts at the moment a frame's detection
31246
+ * result arrives, and keeps long after the frame itself is freed.
31247
+ *
31248
+ * This is the knob that replaced the old retention window, and it buys about
31249
+ * three orders of magnitude more of it: a tile is one subject at native
31250
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
31251
+ * the frame it was cut from. A frame on which nothing was detected costs
31252
+ * nothing at all, which is the real change — the old lease paid per FRAME and
31253
+ * was interrogated per SUBJECT.
31254
+ *
31255
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
31256
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
31257
+ * reproduce that.
31258
+ */
31259
+ tileBudgetMb: number().int().min(0).max(1024)
31162
31260
  });
31163
31261
  /**
31164
- * The values in force when the operator has set nothing — byte-for-byte the
31165
- * constants the decode worker shipped with as env-var defaults, so making these
31166
- * settings changed no behaviour on the day it landed.
31262
+ * The values in force when the operator has set nothing.
31263
+ *
31264
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
31265
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
31266
+ * in the same change that redefines it would make a regression and a retune
31267
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31268
+ * live traffic.
31167
31269
  */
31168
31270
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
31169
- ttlMs: 1200,
31271
+ holdFrames: 8,
31170
31272
  budgetMb: 1024,
31171
31273
  activityMs: 15e3,
31274
+ tileBudgetMb: 64,
31172
31275
  admission: "inferred"
31173
31276
  };
31174
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31277
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
31175
31278
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
31176
31279
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31280
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
31177
31281
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
31178
31282
  var NOTIFIER_ICONS = {
31179
31283
  telegram: {
@@ -32180,11 +32284,24 @@ function nativePriority$1(prepared) {
32180
32284
  }
32181
32285
  function viewActions(prepared) {
32182
32286
  const out = [];
32183
- for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) if (action.url !== void 0 && action.url.length > 0) out.push({
32184
- action: "view",
32185
- label: action.label,
32186
- url: action.url
32187
- });
32287
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) {
32288
+ if (action.url === void 0 || action.url.length === 0) continue;
32289
+ if (action.mode === "background") {
32290
+ out.push({
32291
+ action: "http",
32292
+ label: action.label,
32293
+ url: action.url,
32294
+ method: "POST",
32295
+ clear: true
32296
+ });
32297
+ continue;
32298
+ }
32299
+ out.push({
32300
+ action: "view",
32301
+ label: action.label,
32302
+ url: action.url
32303
+ });
32304
+ }
32188
32305
  return out;
32189
32306
  }
32190
32307
  /** The single attachment (caps.max = 1), if any. */
@@ -32239,7 +32356,7 @@ function buildUploadRequest(config, prepared, attachment) {
32239
32356
  if (tags.length > 0) headers["x-tags"] = tags.join(",");
32240
32357
  if (prepared.clickUrl !== null) headers["x-click"] = prepared.clickUrl;
32241
32358
  if (attachment.name !== void 0) headers["x-filename"] = attachment.name;
32242
- if (actions.length > 0) headers["x-actions"] = actions.map((a) => `view, ${a.label}, ${a.url}`).join("; ");
32359
+ if (actions.length > 0) headers["x-actions"] = actions.map((a) => a.action === "http" ? `http, ${a.label}, ${a.url}, method=POST, clear=true` : `view, ${a.label}, ${a.url}`).join("; ");
32243
32360
  return {
32244
32361
  url: `${serverUrl}/${topic}`,
32245
32362
  method: "PUT",
@@ -33498,17 +33615,46 @@ function userIdsFrom(config) {
33498
33615
  if (typeof raw === "string") return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
33499
33616
  return [];
33500
33617
  }
33618
+ /**
33619
+ * How a `BACKGROUND_CALL` names its request: `METHOD::url`.
33620
+ *
33621
+ * The whole reason the type exists here: a "silence this for 30 minutes"
33622
+ * button that opens a browser tab has already cost more attention than the
33623
+ * notification it was dismissing. `BACKGROUND_CALL` fires the callback and
33624
+ * leaves the phone where it is.
33625
+ */
33626
+ var BACKGROUND_CALL_PREFIX = "POST::";
33501
33627
  function actionsFor(prepared) {
33502
33628
  const out = [];
33503
- for (const action of prepared.actions.slice(0, MAX_ACTIONS)) if (action.url !== void 0 && action.url.length > 0) out.push({
33504
- type: "NAVIGATE",
33505
- title: action.label,
33506
- value: action.url
33507
- });
33508
- else out.push({
33509
- type: "OPEN_NOTIFICATION",
33510
- title: action.label
33511
- });
33629
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS)) {
33630
+ const decoration = {
33631
+ ...action.destructive !== void 0 ? { destructive: action.destructive } : {},
33632
+ ...action.icon !== void 0 ? { icon: action.icon } : {}
33633
+ };
33634
+ if (action.url === void 0 || action.url.length === 0) {
33635
+ out.push({
33636
+ type: "OPEN_NOTIFICATION",
33637
+ title: action.label,
33638
+ ...decoration
33639
+ });
33640
+ continue;
33641
+ }
33642
+ if (action.mode === "background") {
33643
+ out.push({
33644
+ type: "BACKGROUND_CALL",
33645
+ title: action.label,
33646
+ value: `${BACKGROUND_CALL_PREFIX}${action.url}`,
33647
+ ...decoration
33648
+ });
33649
+ continue;
33650
+ }
33651
+ out.push({
33652
+ type: "NAVIGATE",
33653
+ title: action.label,
33654
+ value: action.url,
33655
+ ...decoration
33656
+ });
33657
+ }
33512
33658
  return out;
33513
33659
  }
33514
33660
  function attachmentsFor(prepared) {
@@ -33674,6 +33820,15 @@ var zentikAdapter = {
33674
33820
  ],
33675
33821
  format: ["text"],
33676
33822
  clickUrl: true,
33823
+ /**
33824
+ * `NotificationActionDto.icon` is a documented field, so the engine hands
33825
+ * the icon over instead of stripping it centrally. What Zentik's client
33826
+ * DRAWS for a given name is not documented — so the intent name travels
33827
+ * verbatim, exactly as the webhook kind forwards it, and a name the app
33828
+ * does not know renders as no icon rather than as a wrong one. This is a
33829
+ * pass-through claim, not a rendering claim.
33830
+ */
33831
+ actionIcons: true,
33677
33832
  sound: true,
33678
33833
  ttl: true,
33679
33834
  bodyMaxLen: BODY_MAX_LEN
package/dist/addon.mjs CHANGED
@@ -13114,7 +13114,23 @@ var NotificationActionSchema = object({
13114
13114
  * else — see `notification-center/action-token.ts` for what that does and
13115
13115
  * does not buy.
13116
13116
  */
13117
- destructive: boolean().optional()
13117
+ destructive: boolean().optional(),
13118
+ /**
13119
+ * How the tap should REACH the url.
13120
+ *
13121
+ * `navigate` (absent, and every button authored before this field) opens it:
13122
+ * the phone leaves the notification and shows whatever the callback returns.
13123
+ * That is right for a button whose answer the operator wants to read.
13124
+ *
13125
+ * `background` fires it as a POST and stays put. It exists for the buttons
13126
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13127
+ * an answer to the notification, and being thrown into a browser tab to
13128
+ * confirm it costs more attention than the notification did. A backend that
13129
+ * cannot do a background call renders it as an ordinary link (the adapters
13130
+ * fall back rather than dropping the button), so this is a preference, never
13131
+ * a requirement.
13132
+ */
13133
+ mode: _enum(["navigate", "background"]).optional()
13118
13134
  });
13119
13135
  /**
13120
13136
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14129,6 +14145,9 @@ var NcSystemEventConditionSchema = object({
14129
14145
  nodeIds: array(string().min(1)).min(1).optional(),
14130
14146
  packageNames: array(string().min(1)).min(1).optional()
14131
14147
  });
14148
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14149
+ * outage the operator asked for once and forgot. */
14150
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14132
14151
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14133
14152
  var NcScheduleSchema = object({
14134
14153
  windows: array(object({
@@ -14505,15 +14524,15 @@ var NcConditionsSchema = object({
14505
14524
  * (an `immediate` rule naming an `audio-*` class, one notification per
14506
14525
  * classified sample) stays exactly as it was for rules that already use it.
14507
14526
  *
14508
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14509
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14510
- * (`camstack/src/data/notification-center.ts`, guarded by
14511
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14527
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14528
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14529
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14530
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14512
14531
  * condition fields it does not know when a rule is saved from the phone.
14513
14532
  * Publishing an editor for a condition the app cannot round-trip is how an
14514
- * operator loses a rule's conditions by opening it — so the descriptor, the
14515
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14516
- * does an audio rule become authorable.
14533
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14534
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14535
+ * follows here.
14517
14536
  */
14518
14537
  audio: NcAudioConditionSchema.optional()
14519
14538
  });
@@ -14749,6 +14768,30 @@ var NcRuleInputSchema = object({
14749
14768
  */
14750
14769
  snoozeAllowGlobal: boolean().optional(),
14751
14770
  /**
14771
+ * The snooze durations THIS rule's notification offers as buttons, in
14772
+ * minutes.
14773
+ *
14774
+ * Three states, and all three are distinct — which is exactly why this is
14775
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14776
+ * addon cap path (three production failures in one day), so a schema default
14777
+ * would collapse the first two:
14778
+ *
14779
+ * | value | meaning |
14780
+ * | --- | --- |
14781
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14782
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14783
+ * | a list | these choices, de-duplicated and sorted, at most four |
14784
+ *
14785
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14786
+ * three buttons in total) and a rule that spent it all on snooze choices
14787
+ * would push its own tap-through actions off the notification.
14788
+ *
14789
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14790
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14791
+ * window from anywhere (D133).
14792
+ */
14793
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14794
+ /**
14752
14795
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14753
14796
  *
14754
14797
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14848,6 +14891,7 @@ var NcConditionDescriptorSchema = object({
14848
14891
  "device",
14849
14892
  "package",
14850
14893
  "occupancy",
14894
+ "audio",
14851
14895
  "system"
14852
14896
  ]),
14853
14897
  label: string(),
@@ -14866,6 +14910,7 @@ var NcConditionDescriptorSchema = object({
14866
14910
  "crossingSelect",
14867
14911
  "polygonDraw",
14868
14912
  "occupancy",
14913
+ "audio",
14869
14914
  "deviceState",
14870
14915
  "systemEvent"
14871
14916
  ]),
@@ -15017,7 +15062,20 @@ var NcSnoozeInputSchema = object({
15017
15062
  ruleId: string().optional(),
15018
15063
  /** Required when `scope: 'device'`. */
15019
15064
  deviceId: number().int().optional(),
15020
- durationMinutes: number().int().min(1).max(1440),
15065
+ /**
15066
+ * Narrow the window to these subject classes — "the cat, not the person".
15067
+ *
15068
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15069
+ * what every window authored before this field meant, so no persisted row
15070
+ * changes meaning and no client has to learn anything to keep working.
15071
+ *
15072
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15073
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15074
+ * not at whichever of their four rules happened to produce the notification
15075
+ * they are dismissing.
15076
+ */
15077
+ classes: array(string().min(1)).min(1).optional(),
15078
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15021
15079
  /**
15022
15080
  * Silence this for EVERY recipient, not just the caller. Permission is
15023
15081
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15042,6 +15100,10 @@ var NcSnoozeSchema = object({
15042
15100
  scope: NcSnoozeScopeSchema,
15043
15101
  ruleId: string().optional(),
15044
15102
  deviceId: number().int().optional(),
15103
+ /** Subject classes this window covers. ABSENT = every class — see
15104
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15105
+ * no SQLite column: nothing queries a window by class. */
15106
+ classes: array(string().min(1)).min(1).optional(),
15045
15107
  startedAt: number(),
15046
15108
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15047
15109
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -23744,13 +23806,24 @@ method(object({
23744
23806
  /** Playback-speed multiplier for the render (1 = realtime). */
23745
23807
  var ExportSpeedSchema = number().min(.25).max(32);
23746
23808
  /**
23747
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23809
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23810
+ *
23811
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
23812
+ * derives these bounds from things that happened at a TIME (a track's
23813
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23814
+ * every segment present for the range, with each recording GAP removed. The
23815
+ * two agree only on a window that recorded without one interruption, and only
23816
+ * the render side knows the segments, so the translation lives there
23817
+ * (`export-dense-map.ts`, addon-pipeline).
23748
23818
  *
23749
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23750
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23751
- * playlist. Handing it absolute epochs would make every call site responsible
23752
- * for the same subtraction, and the one that forgot would emit a filter that
23753
- * selects nothing silently, as a uniform timelapse.
23819
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23820
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23821
+ * gap accumulated before it up to 6,607 s, well past EOF. Nothing matched,
23822
+ * the video was a uniform timelapse, and the log line reported the five ranges
23823
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23824
+ *
23825
+ * Relative and not absolute epoch, because an absolute epoch would make every
23826
+ * call site responsible for the same subtraction.
23754
23827
  */
23755
23828
  var ExportDenseRangeSchema = object({
23756
23829
  fromSec: number().nonnegative(),
@@ -30603,6 +30676,7 @@ Object.freeze({
30603
30676
  "network-access": "ingress",
30604
30677
  "smtp-provider": "email"
30605
30678
  });
30679
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30606
30680
  new Set(["devices", "classes"]);
30607
30681
  /** Strip a small, safe subset of Markdown down to plain text. */
30608
30682
  function markdownToText(md) {
@@ -31087,25 +31161,32 @@ object({
31087
31161
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
31088
31162
  object({
31089
31163
  /**
31090
- * How long a retained native frame is served before it counts as a miss.
31164
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
31165
+ * detection result.
31166
+ *
31167
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
31168
+ * a time window was never related to the event the pixels were waiting for.
31169
+ * A held frame now lives from delivery until the runner has its `FrameResult`
31170
+ * — at which moment the runner cuts the subject tiles it actually wanted and
31171
+ * releases the frame. The bound exists only so a runner that stops answering
31172
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
31091
31173
  *
31092
- * Must cover the FULL late-crop horizon: detection inference + the
31093
- * cross-process inference-result hop to hub post-analysis + tracking + the
31094
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
31095
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
31096
- * RAM per busy camera grows linearly with no measured hit-rate gain.
31174
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
31175
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
31176
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
31177
+ * Raising it does not buy hit rate it buys tolerance for a slow runner, and
31178
+ * `holdOverflow` on the metrics line is what says you need it.
31097
31179
  */
31098
- ttlMs: number().int().min(250).max(1e4),
31180
+ holdFrames: number().int().min(1).max(64),
31099
31181
  /**
31100
31182
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
31101
31183
  *
31102
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
31103
- * which one is actually binding before reasoning from that. At the shipped
31104
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
31105
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
31106
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
31107
- * change that admits fewer frames buys retention WINDOW at constant RAM
31108
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
31184
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
31185
+ * is what decides how much is held, and the ceiling is the number above which
31186
+ * something is wrong. Before that it was the effective cap at 1024 MB with
31187
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
31188
+ * with the TTL expiring nothing, which is exactly the confusion the hold
31189
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
31109
31190
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
31110
31191
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
31111
31192
  * to replace).
@@ -31131,22 +31212,45 @@ object({
31131
31212
  * there is the signal that some caller names frames outside the inference set
31132
31213
  * and that this must go back to `all`.
31133
31214
  */
31134
- admission: NativeLeaseAdmissionSchema
31215
+ admission: NativeLeaseAdmissionSchema,
31216
+ /**
31217
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
31218
+ * compressed native crops the worker cuts at the moment a frame's detection
31219
+ * result arrives, and keeps long after the frame itself is freed.
31220
+ *
31221
+ * This is the knob that replaced the old retention window, and it buys about
31222
+ * three orders of magnitude more of it: a tile is one subject at native
31223
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
31224
+ * the frame it was cut from. A frame on which nothing was detected costs
31225
+ * nothing at all, which is the real change — the old lease paid per FRAME and
31226
+ * was interrogated per SUBJECT.
31227
+ *
31228
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
31229
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
31230
+ * reproduce that.
31231
+ */
31232
+ tileBudgetMb: number().int().min(0).max(1024)
31135
31233
  });
31136
31234
  /**
31137
- * The values in force when the operator has set nothing — byte-for-byte the
31138
- * constants the decode worker shipped with as env-var defaults, so making these
31139
- * settings changed no behaviour on the day it landed.
31235
+ * The values in force when the operator has set nothing.
31236
+ *
31237
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
31238
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
31239
+ * in the same change that redefines it would make a regression and a retune
31240
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
31241
+ * live traffic.
31140
31242
  */
31141
31243
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
31142
- ttlMs: 1200,
31244
+ holdFrames: 8,
31143
31245
  budgetMb: 1024,
31144
31246
  activityMs: 15e3,
31247
+ tileBudgetMb: 64,
31145
31248
  admission: "inferred"
31146
31249
  };
31147
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
31250
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
31148
31251
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
31149
31252
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
31253
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
31150
31254
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
31151
31255
  var NOTIFIER_ICONS = {
31152
31256
  telegram: {
@@ -32153,11 +32257,24 @@ function nativePriority$1(prepared) {
32153
32257
  }
32154
32258
  function viewActions(prepared) {
32155
32259
  const out = [];
32156
- for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) if (action.url !== void 0 && action.url.length > 0) out.push({
32157
- action: "view",
32158
- label: action.label,
32159
- url: action.url
32160
- });
32260
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS$1)) {
32261
+ if (action.url === void 0 || action.url.length === 0) continue;
32262
+ if (action.mode === "background") {
32263
+ out.push({
32264
+ action: "http",
32265
+ label: action.label,
32266
+ url: action.url,
32267
+ method: "POST",
32268
+ clear: true
32269
+ });
32270
+ continue;
32271
+ }
32272
+ out.push({
32273
+ action: "view",
32274
+ label: action.label,
32275
+ url: action.url
32276
+ });
32277
+ }
32161
32278
  return out;
32162
32279
  }
32163
32280
  /** The single attachment (caps.max = 1), if any. */
@@ -32212,7 +32329,7 @@ function buildUploadRequest(config, prepared, attachment) {
32212
32329
  if (tags.length > 0) headers["x-tags"] = tags.join(",");
32213
32330
  if (prepared.clickUrl !== null) headers["x-click"] = prepared.clickUrl;
32214
32331
  if (attachment.name !== void 0) headers["x-filename"] = attachment.name;
32215
- if (actions.length > 0) headers["x-actions"] = actions.map((a) => `view, ${a.label}, ${a.url}`).join("; ");
32332
+ if (actions.length > 0) headers["x-actions"] = actions.map((a) => a.action === "http" ? `http, ${a.label}, ${a.url}, method=POST, clear=true` : `view, ${a.label}, ${a.url}`).join("; ");
32216
32333
  return {
32217
32334
  url: `${serverUrl}/${topic}`,
32218
32335
  method: "PUT",
@@ -33471,17 +33588,46 @@ function userIdsFrom(config) {
33471
33588
  if (typeof raw === "string") return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
33472
33589
  return [];
33473
33590
  }
33591
+ /**
33592
+ * How a `BACKGROUND_CALL` names its request: `METHOD::url`.
33593
+ *
33594
+ * The whole reason the type exists here: a "silence this for 30 minutes"
33595
+ * button that opens a browser tab has already cost more attention than the
33596
+ * notification it was dismissing. `BACKGROUND_CALL` fires the callback and
33597
+ * leaves the phone where it is.
33598
+ */
33599
+ var BACKGROUND_CALL_PREFIX = "POST::";
33474
33600
  function actionsFor(prepared) {
33475
33601
  const out = [];
33476
- for (const action of prepared.actions.slice(0, MAX_ACTIONS)) if (action.url !== void 0 && action.url.length > 0) out.push({
33477
- type: "NAVIGATE",
33478
- title: action.label,
33479
- value: action.url
33480
- });
33481
- else out.push({
33482
- type: "OPEN_NOTIFICATION",
33483
- title: action.label
33484
- });
33602
+ for (const action of prepared.actions.slice(0, MAX_ACTIONS)) {
33603
+ const decoration = {
33604
+ ...action.destructive !== void 0 ? { destructive: action.destructive } : {},
33605
+ ...action.icon !== void 0 ? { icon: action.icon } : {}
33606
+ };
33607
+ if (action.url === void 0 || action.url.length === 0) {
33608
+ out.push({
33609
+ type: "OPEN_NOTIFICATION",
33610
+ title: action.label,
33611
+ ...decoration
33612
+ });
33613
+ continue;
33614
+ }
33615
+ if (action.mode === "background") {
33616
+ out.push({
33617
+ type: "BACKGROUND_CALL",
33618
+ title: action.label,
33619
+ value: `${BACKGROUND_CALL_PREFIX}${action.url}`,
33620
+ ...decoration
33621
+ });
33622
+ continue;
33623
+ }
33624
+ out.push({
33625
+ type: "NAVIGATE",
33626
+ title: action.label,
33627
+ value: action.url,
33628
+ ...decoration
33629
+ });
33630
+ }
33485
33631
  return out;
33486
33632
  }
33487
33633
  function attachmentsFor(prepared) {
@@ -33647,6 +33793,15 @@ var zentikAdapter = {
33647
33793
  ],
33648
33794
  format: ["text"],
33649
33795
  clickUrl: true,
33796
+ /**
33797
+ * `NotificationActionDto.icon` is a documented field, so the engine hands
33798
+ * the icon over instead of stripping it centrally. What Zentik's client
33799
+ * DRAWS for a given name is not documented — so the intent name travels
33800
+ * verbatim, exactly as the webhook kind forwards it, and a name the app
33801
+ * does not know renders as no icon rather than as a wrong one. This is a
33802
+ * pass-through claim, not a rendering claim.
33803
+ */
33804
+ actionIcons: true,
33650
33805
  sound: true,
33651
33806
  ttl: true,
33652
33807
  bodyMaxLen: BODY_MAX_LEN
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.18",
3
+ "version": "1.2.20",
4
4
  "description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
5
5
  "keywords": [
6
6
  "camstack",