@camstack/addon-agent-ui 1.2.15 → 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 +73 -10
  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. */
@@ -30447,6 +30509,7 @@ Object.freeze({
30447
30509
  "network-access": "ingress",
30448
30510
  "smtp-provider": "email"
30449
30511
  });
30512
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
30450
30513
  new Set(["devices", "classes"]);
30451
30514
  /**
30452
30515
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -30836,7 +30899,7 @@ var AgentUIAddon = class extends BaseAddon {
30836
30899
  capability: adminUiCapability,
30837
30900
  provider: {
30838
30901
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
30839
- getVersion: async () => ({ version: "1.2.15" })
30902
+ getVersion: async () => ({ version: "1.2.16" })
30840
30903
  }
30841
30904
  }];
30842
30905
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",