@camstack/addon-post-analysis 1.2.274 → 1.2.276

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.
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
5359
5359
  var ZodFirstPartyTypeKind;
5360
5360
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5361
5361
  //#endregion
5362
- //#region ../types/dist/sleep-PEo0-Fz9.mjs
5362
+ //#region ../types/dist/sleep-pM_J7YnY.mjs
5363
5363
  /**
5364
5364
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5365
5365
  * window to float samples (D455).
@@ -17401,6 +17401,7 @@ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
17401
17401
  sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
17402
17402
  sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
17403
17403
  sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
17404
+ sub("cover", "control", "control", "#0ea5e9", "door", "Cover");
17404
17405
  sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
17405
17406
  sub("siren", "control", "control", "#dc2626", "siren", "Siren");
17406
17407
  sub("button", "control", "control", "#10b981", "button", "Button");
@@ -17726,6 +17727,10 @@ var NcSystemEventKindSchema = _enum([
17726
17727
  "alarm-disarmed",
17727
17728
  "alarm-arming",
17728
17729
  "alarm-arm-refused",
17730
+ "alarm-pending",
17731
+ "alarm-rearmed",
17732
+ "alarm-sensor-bypass",
17733
+ "alarm-check-failed",
17729
17734
  "addon-updated",
17730
17735
  "server-updated",
17731
17736
  "export-completed",
@@ -17757,9 +17762,13 @@ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.h
17757
17762
  */
17758
17763
  var NC_ALARM_SYSTEM_EVENT_KINDS = [
17759
17764
  "alarm-arm-refused",
17765
+ "alarm-check-failed",
17760
17766
  "alarm-arming",
17761
17767
  "alarm-armed",
17768
+ "alarm-pending",
17762
17769
  "alarm-triggered",
17770
+ "alarm-rearmed",
17771
+ "alarm-sensor-bypass",
17763
17772
  "alarm-disarmed"
17764
17773
  ];
17765
17774
  /**
@@ -18357,6 +18366,19 @@ var NcMediaFrameSchema = _enum([
18357
18366
  "full",
18358
18367
  "boxed"
18359
18368
  ]);
18369
+ /**
18370
+ * How a SENSOR notification shows the cameras that link the sensor.
18371
+ *
18372
+ * `mosaic` — one image composed of every linked camera's photograph, taken at
18373
+ * the trigger. `each` — one image per camera where the target takes several
18374
+ * attachments; a target that takes one keeps the first camera's (the degrade
18375
+ * engine drops the rest by order). Either way ONE notification per event.
18376
+ * Absent = `mosaic`, applied by the Notification Center and deliberately NOT
18377
+ * a Zod default (see NcRulePatchSchema: a default materialises on every
18378
+ * partial patch). Meaningless for a rule whose subject is not a sensor, and a
18379
+ * sensor linked to one camera ships that camera's plain snapshot either way.
18380
+ */
18381
+ var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
18360
18382
  var NcMediaPolicySchema = object({
18361
18383
  attach: _enum([
18362
18384
  "best",
@@ -18402,7 +18424,9 @@ var NcMediaPolicySchema = object({
18402
18424
  * A profile that is not assigned falls back to the cheapest, and the render
18403
18425
  * reports which one actually ran.
18404
18426
  */
18405
- profile: CamProfileSchema.optional()
18427
+ profile: CamProfileSchema.optional(),
18428
+ /** See {@link NcLinkedCameraModeSchema}. */
18429
+ linkedCameras: NcLinkedCameraModeSchema.optional()
18406
18430
  });
18407
18431
  /**
18408
18432
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -18522,7 +18546,7 @@ var NcRuleInputSchema = object({
18522
18546
  cooldownSec: 60,
18523
18547
  scope: "rule-device"
18524
18548
  }),
18525
- /** `{{var}}` templating over camera/class/label/zones/confidence/time. */
18549
+ /** `{{var}}` title/body. The variables are declared in `NC_TEMPLATE_VARS` (@camstack/types) and depend on the rule kind — see `templateVarsFor`. */
18526
18550
  template: object({
18527
18551
  title: string().max(500).optional(),
18528
18552
  body: string().max(2e3).optional()
@@ -18702,6 +18726,22 @@ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
18702
18726
  throttle: NcThrottleSchema.optional(),
18703
18727
  priority: number().int().min(1).max(5).optional()
18704
18728
  });
18729
+ var NcRuleClearableKeySchema = _enum([
18730
+ "template",
18731
+ "schedule",
18732
+ "targetUsers",
18733
+ "snoozeOptions",
18734
+ "snoozeAllowGlobal",
18735
+ "waitForEnhancement",
18736
+ "actions",
18737
+ "confirm",
18738
+ "groupIdleSec"
18739
+ ]);
18740
+ var NcRuleUpdateInputSchema = object({
18741
+ ruleId: string(),
18742
+ patch: NcRulePatchSchema,
18743
+ clear: array(NcRuleClearableKeySchema).optional()
18744
+ });
18705
18745
  /** A persisted rule. */
18706
18746
  var NcRuleSchema = NcRuleInputSchema.extend({
18707
18747
  id: string(),
@@ -18733,6 +18773,85 @@ var NcTestResultSchema = object({
18733
18773
  className: string().optional(),
18734
18774
  label: string().optional()
18735
18775
  });
18776
+ /** The five rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts`
18777
+ * is the same union; the template-vars spec pins the two together. */
18778
+ var NcRuleKindSchema = _enum([
18779
+ "detection",
18780
+ "sensor",
18781
+ "occupancy",
18782
+ "sound",
18783
+ "system"
18784
+ ]);
18785
+ /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
18786
+ var NcTemplateFamilySchema = _enum([
18787
+ "rule",
18788
+ "timelapse",
18789
+ "summary"
18790
+ ]);
18791
+ /** Which text field of that producer. `previewText` is the timelapse frame
18792
+ * caption, `captionText` the digest mosaic caption — both see fewer vars. */
18793
+ var NcTemplateFieldSchema = _enum([
18794
+ "title",
18795
+ "body",
18796
+ "previewText",
18797
+ "captionText"
18798
+ ]);
18799
+ var NcTemplateVarGroupSchema = _enum([
18800
+ "subject",
18801
+ "place",
18802
+ "time",
18803
+ "rule",
18804
+ "occupancy",
18805
+ "sound",
18806
+ "sensor",
18807
+ "system",
18808
+ "digest",
18809
+ "ai"
18810
+ ]);
18811
+ /**
18812
+ * ONE `{{var}}` a notification template may name.
18813
+ *
18814
+ * `families` / `fields` / `kinds` / `deliveries` / `systemEventKinds` say WHERE
18815
+ * it has a value; absent = no restriction on that axis. `systemEventKinds` is
18816
+ * read only for a `system` rule. `dynamic` declares a FAMILY of names
18817
+ * (`count_<class>`): the descriptor's `name` is the example member.
18818
+ */
18819
+ var NcTemplateVarDescriptorSchema = object({
18820
+ name: string().regex(/^\w+$/),
18821
+ label: string(),
18822
+ description: string().optional(),
18823
+ example: string(),
18824
+ group: NcTemplateVarGroupSchema,
18825
+ families: array(NcTemplateFamilySchema).min(1),
18826
+ fields: array(NcTemplateFieldSchema).optional(),
18827
+ kinds: array(NcRuleKindSchema).optional(),
18828
+ deliveries: array(NcDeliverySchema).optional(),
18829
+ systemEventKinds: array(NcSystemEventKindSchema).optional(),
18830
+ dynamic: object({
18831
+ prefix: literal("count_"),
18832
+ from: literal("classes")
18833
+ }).optional()
18834
+ });
18835
+ /** Input to `previewTemplate` — the editor's own context, plus the draft text. */
18836
+ var NcTemplatePreviewInputSchema = object({
18837
+ context: object({
18838
+ family: NcTemplateFamilySchema,
18839
+ field: NcTemplateFieldSchema,
18840
+ kind: NcRuleKindSchema.optional(),
18841
+ delivery: NcDeliverySchema.optional(),
18842
+ systemEventKinds: array(NcSystemEventKindSchema).optional()
18843
+ }),
18844
+ template: object({
18845
+ title: string().max(500).optional(),
18846
+ body: string().max(2e3).optional()
18847
+ })
18848
+ });
18849
+ var NcTemplatePreviewSchema = object({
18850
+ title: string().nullable(),
18851
+ body: string().nullable(),
18852
+ /** Names the template uses that this context never fills — they render empty. */
18853
+ unknown: array(string())
18854
+ });
18736
18855
  var NcConditionDescriptorSchema = object({
18737
18856
  /** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
18738
18857
  id: string(),
@@ -18896,6 +19015,14 @@ var NC_CONDITION_CATALOG = [
18896
19015
  value: "backup-completed",
18897
19016
  label: "Backup completed"
18898
19017
  },
19018
+ {
19019
+ value: "alarm-arm-refused",
19020
+ label: "Alarm arm refused"
19021
+ },
19022
+ {
19023
+ value: "alarm-check-failed",
19024
+ label: "Alarm check failed (armed anyway)"
19025
+ },
18899
19026
  {
18900
19027
  value: "alarm-arming",
18901
19028
  label: "Alarm arming (exit delay)"
@@ -18904,10 +19031,22 @@ var NC_CONDITION_CATALOG = [
18904
19031
  value: "alarm-armed",
18905
19032
  label: "Alarm armed"
18906
19033
  },
19034
+ {
19035
+ value: "alarm-pending",
19036
+ label: "Alarm entry delay started"
19037
+ },
18907
19038
  {
18908
19039
  value: "alarm-triggered",
18909
19040
  label: "Alarm triggered"
18910
19041
  },
19042
+ {
19043
+ value: "alarm-rearmed",
19044
+ label: "Alarm re-armed after siren"
19045
+ },
19046
+ {
19047
+ value: "alarm-sensor-bypass",
19048
+ label: "Alarm sensor bypass"
19049
+ },
18911
19050
  {
18912
19051
  value: "alarm-disarmed",
18913
19052
  label: "Alarm disarmed"
@@ -19458,8 +19597,17 @@ var NcSnoozeSuppressedSchema = object({
19458
19597
  lastAt: number()
19459
19598
  });
19460
19599
  /**
19461
- * The three durations the panel's state machine runs on, plus who hears about
19462
- * an arm.
19600
+ * The per-mode lists, at most one per mode. Two lists for one mode have no
19601
+ * meaning a reader could agree on (union? the last one?), so they are refused
19602
+ * at the boundary rather than interpreted.
19603
+ */
19604
+ var NcAlarmNonBlockingListSchema = array(object({
19605
+ mode: AlarmArmModeSchema,
19606
+ deviceIds: array(number().int()).max(200)
19607
+ })).max(8).refine((lists) => new Set(lists.map((l) => l.mode)).size === lists.length, { message: "nonBlocking: at most one list per arm mode" });
19608
+ /**
19609
+ * The three durations the panel's state machine runs on, who hears about its
19610
+ * transitions, and which openings each mode tolerates.
19463
19611
  *
19464
19612
  * They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
19465
19613
  * `alarm-panel` is `deviceNative` and its other provider mirrors somebody
@@ -19478,21 +19626,39 @@ var NcAlarmSettingsSchema = object({
19478
19626
  * existed, and therefore what an untouched install keeps doing.
19479
19627
  */
19480
19628
  triggeredDurationSec: number().int().min(0).max(3600),
19481
- /** Send a notification when a mode takes effect. */
19482
- announceArm: boolean(),
19483
19629
  /**
19484
- * Where that notification goes. Target ids from `notification-output`.
19630
+ * Deprecated by D630 — every transition is announced. Parsed, never read;
19631
+ * remove after one release. Optional so an older admin's patch (which still
19632
+ * sends it) parses rather than failing the whole save.
19633
+ */
19634
+ announceArm: boolean().optional(),
19635
+ /**
19636
+ * Target ids from `notification-output`: every alarm transition goes here.
19485
19637
  *
19486
- * Explicit rather than "everyone": an arm announcement is a household
19638
+ * Explicit rather than "everyone": an alarm announcement is a household
19487
19639
  * message, and broadcasting it to every configured endpoint (including a
19488
19640
  * webhook wired to something else) is not a default anybody would choose.
19489
- * Empty with `announceArm: true` sends nothing, and the server logs that —
19490
- * silence must be attributable.
19641
+ * Empty sends nothing, and the server logs that — silence must be
19642
+ * attributable.
19643
+ */
19644
+ announceTargets: array(string().min(1)).max(16),
19645
+ /**
19646
+ * Per arm mode, the covered devices whose being OPEN does not refuse the
19647
+ * arm (a window left ajar for the cat under `home`, say). At most one entry
19648
+ * per mode is meaningful. Defaulted to `[]` so a blob stored before D630
19649
+ * parses as "every opening blocks" — the behaviour it was written under.
19491
19650
  */
19492
- announceTargets: array(string().min(1)).max(16)
19651
+ nonBlocking: NcAlarmNonBlockingListSchema.default([])
19493
19652
  });
19494
- /** Every field optional — a tab edits one control at a time. */
19495
- var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
19653
+ /**
19654
+ * Every field optional — a tab edits one control at a time.
19655
+ *
19656
+ * `nonBlocking` is re-declared WITHOUT its default: `.partial()` does not
19657
+ * remove an inner `.default()`, so a patch that never named the field would
19658
+ * parse to `nonBlocking: []` and wipe every mode's list on an unrelated edit
19659
+ * (the same trap {@link NcRulePatchSchema} documents).
19660
+ */
19661
+ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({ nonBlocking: NcAlarmNonBlockingListSchema }).partial();
19496
19662
  /**
19497
19663
  * What one arm mode actually arms, DERIVED from the enabled rules gated on it.
19498
19664
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
@@ -19537,6 +19703,36 @@ var NcAlarmModeCoverageSchema = object({
19537
19703
  */
19538
19704
  skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
19539
19705
  });
19706
+ /** One covered device that reads open, and whether that refuses the arm. */
19707
+ var NcAlarmOpeningSchema = object({
19708
+ deviceId: number().int(),
19709
+ name: string(),
19710
+ /** The device's state word as read (`open`, `unlocked`, …). */
19711
+ state: string(),
19712
+ /** False when the mode's non-blocking list names this device. */
19713
+ blocking: boolean()
19714
+ });
19715
+ /** A device the panel is currently ignoring, and which side of it it is on. */
19716
+ var NcAlarmExclusionViewSchema = object({
19717
+ deviceId: number().int(),
19718
+ name: string(),
19719
+ phase: _enum(["open", "closed"])
19720
+ });
19721
+ /** One mode's openings: devices read open, plus those whose state is unknown. */
19722
+ var NcAlarmModeOpeningsSchema = object({
19723
+ mode: AlarmArmModeSchema,
19724
+ devices: array(NcAlarmOpeningSchema),
19725
+ /** Covered devices whose state could not be read (D49): neither open nor closed. */
19726
+ unknown: array(number().int())
19727
+ });
19728
+ var NcAlarmLiveSchema = object({
19729
+ state: AlarmStateSchema,
19730
+ /** The mode being armed into (exit delay) or held; null when disarmed. */
19731
+ targetMode: AlarmArmModeSchema.nullable(),
19732
+ availableModes: array(AlarmArmModeSchema),
19733
+ openings: array(NcAlarmModeOpeningsSchema),
19734
+ exclusions: array(NcAlarmExclusionViewSchema)
19735
+ });
19540
19736
  var NcAlarmConfigSchema = object({
19541
19737
  /**
19542
19738
  * The panel's device id, or null when this install has no panel (the ensure
@@ -19546,7 +19742,13 @@ var NcAlarmConfigSchema = object({
19546
19742
  */
19547
19743
  deviceId: number().int().nullable(),
19548
19744
  settings: NcAlarmSettingsSchema,
19549
- coverage: array(NcAlarmModeCoverageSchema)
19745
+ coverage: array(NcAlarmModeCoverageSchema),
19746
+ /**
19747
+ * The panel as it is NOW — state, what each mode would find open, what is
19748
+ * excluded. Optional: a panel-less hub answers without it, and a client
19749
+ * must not read its absence as "nothing is open".
19750
+ */
19751
+ live: NcAlarmLiveSchema.optional()
19550
19752
  });
19551
19753
  /**
19552
19754
  * ONE rule's demand on ONE camera's clip ring.
@@ -19602,10 +19804,7 @@ var notificationRulesCapability = {
19602
19804
  auth: "admin",
19603
19805
  caller: "required"
19604
19806
  }),
19605
- updateRule: method(object({
19606
- ruleId: string(),
19607
- patch: NcRulePatchSchema
19608
- }), object({ rule: NcRuleSchema }), {
19807
+ updateRule: method(NcRuleUpdateInputSchema, object({ rule: NcRuleSchema }), {
19609
19808
  kind: "mutation",
19610
19809
  auth: "admin",
19611
19810
  caller: "required"
@@ -19693,6 +19892,18 @@ var notificationRulesCapability = {
19693
19892
  catalog: array(NcConditionDescriptorSchema),
19694
19893
  taxonomy: NcTaxonomySchema.optional()
19695
19894
  })),
19895
+ /** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
19896
+ getTemplateCatalog: method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })),
19897
+ /**
19898
+ * Render a template with example values, through the hub's text catalog.
19899
+ * Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
19900
+ * a batched GET URL risks length limits — so access stays `view`, the same
19901
+ * as `getTemplateCatalog`.
19902
+ */
19903
+ previewTemplate: method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
19904
+ kind: "mutation",
19905
+ access: "view"
19906
+ }),
19696
19907
  /**
19697
19908
  * Queryable delivery history — a read-only view over the durable outbox
19698
19909
  * (fired rule, subject summary, target, status, timestamps, error on a
@@ -19747,7 +19958,10 @@ var notificationRulesCapability = {
19747
19958
  caller: "required"
19748
19959
  }),
19749
19960
  /**
19750
- * The alarm panel's durations, plus what each mode ACTUALLY arms.
19961
+ * The alarm panel's settings, what each mode ACTUALLY arms, and — when a
19962
+ * panel exists — its `live` state: current state and target mode, what
19963
+ * each mode would find open (blocking or not, and what is unknown), and
19964
+ * the devices currently excluded.
19751
19965
  *
19752
19966
  * Coverage is returned by the same call as the settings on purpose: they
19753
19967
  * are read together or not at all. An editor that showed the delays
@@ -19757,7 +19971,9 @@ var notificationRulesCapability = {
19757
19971
  */
19758
19972
  getAlarmConfig: method(object({}), NcAlarmConfigSchema, { auth: "admin" }),
19759
19973
  /**
19760
- * Patch the durations. Returns the WHOLE config, coverage included, so a
19974
+ * Patch the settings (durations, recipients, per-mode non-blocking lists;
19975
+ * `announceArm` is accepted and ignored — D630). Returns the WHOLE config,
19976
+ * coverage and `live` included, so a
19761
19977
  * client never has to guess what the server settled on — the panel clamps
19762
19978
  * and normalises, and a form that re-rendered from its own input would
19763
19979
  * show a value the alarm is not using.
@@ -24907,6 +25123,7 @@ var CAP_TO_KIND = {
24907
25123
  "enum-sensor": "enum-sensor",
24908
25124
  "event-emitter": "device-event",
24909
25125
  "lock-control": "lock",
25126
+ cover: "cover",
24910
25127
  switch: "switch",
24911
25128
  button: "button",
24912
25129
  doorbell: "doorbell"
@@ -29176,15 +29393,37 @@ var controlCapability = {
29176
29393
  */
29177
29394
  durability: "session"
29178
29395
  };
29396
+ /**
29397
+ * Window covering / blinds / garage door / valve cap. Models HA
29398
+ * `cover.*` entities — anything that moves between an open and a
29399
+ * closed state with optional intermediate positioning and tilt.
29400
+ *
29401
+ * State follows HA's canonical lifecycle: `open` / `opening` /
29402
+ * `closing` / `closed` / `stopped`. `position` (0 closed, 100 open)
29403
+ * and `tiltPosition` are nullable — some shutters only support
29404
+ * full open/close, some Venetian blinds add tilt but no slat
29405
+ * positioning, garage doors are usually positionless. Providers
29406
+ * populate only what the hardware reports.
29407
+ *
29408
+ * The cap intentionally does NOT split tilt into a sibling cap:
29409
+ * physical hardware that has tilt always has the main position
29410
+ * surface too, so the coupling stays inside one slice + one method
29411
+ * group rather than spreading across two registrations.
29412
+ *
29413
+ * Sub-surface gating paired with `DeviceFeature` flags:
29414
+ * - `CoverPositionable` — intermediate `position` slider
29415
+ * - `CoverTilt` — slat-tilt slider
29416
+ */
29417
+ var CoverStateSchema = _enum([
29418
+ "open",
29419
+ "opening",
29420
+ "closing",
29421
+ "closed",
29422
+ "stopped"
29423
+ ]);
29179
29424
  var CoverStatusSchema = object({
29180
29425
  /** Lifecycle state of the cover. */
29181
- state: _enum([
29182
- "open",
29183
- "opening",
29184
- "closing",
29185
- "closed",
29186
- "stopped"
29187
- ]),
29426
+ state: CoverStateSchema,
29188
29427
  /** 0 = fully closed, 100 = fully open. Null when the device has
29189
29428
  * no intermediate position surface. */
29190
29429
  position: number().min(0).max(100).nullable(),
@@ -31249,16 +31488,37 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
31249
31488
  kind: "mutation",
31250
31489
  auth: "admin"
31251
31490
  });
31491
+ /**
31492
+ * Smart-lock cap. Models HA `lock.*` entities — anything with a
31493
+ * locked / unlocked binary state plus the four transient lifecycle
31494
+ * states (`locking` / `unlocking`) and the `jammed` failure state
31495
+ * that low-end deadbolts surface when the motor can't reach the
31496
+ * target position.
31497
+ *
31498
+ * Some HA locks require a PIN code on every lock/unlock operation
31499
+ * (workplace keypad locks, hospitality). The optional `code` field
31500
+ * on the methods passes it through to the upstream service — the
31501
+ * code is NEVER persisted in the runtime slice or any event payload.
31502
+ * Locks that REQUIRE a code set `DeviceFeature.LockPinRequired` so
31503
+ * the UI gates a code-entry field without a slice fetch.
31504
+ *
31505
+ * Locks that support a latch-release ("open door") action advertise
31506
+ * `DeviceFeature.LockOpen`. The `open` method triggers the latch
31507
+ * without a full lock/unlock cycle. Only available when the lock
31508
+ * reports `LockEntityFeature.OPEN` (bit value 1) in HA
31509
+ * `supported_features`.
31510
+ */
31511
+ var LockStateSchema = _enum([
31512
+ "locked",
31513
+ "unlocked",
31514
+ "locking",
31515
+ "unlocking",
31516
+ "jammed"
31517
+ ]);
31252
31518
  var LockControlStatusSchema = object({
31253
31519
  /** Lifecycle state of the lock. `jammed` means the motor reported
31254
31520
  * failure to reach the target — operator intervention required. */
31255
- state: _enum([
31256
- "locked",
31257
- "unlocked",
31258
- "locking",
31259
- "unlocking",
31260
- "jammed"
31261
- ]),
31521
+ state: LockStateSchema,
31262
31522
  /** Ms epoch when the slice was last updated. */
31263
31523
  lastChangedAt: number()
31264
31524
  });
@@ -38190,9 +38450,8 @@ var DEVICE_STATE_READERS = [
38190
38450
  field: "state"
38191
38451
  },
38192
38452
  {
38193
- cap: "lock",
38194
- field: "locked",
38195
- booleanWords: ["locked", "unlocked"]
38453
+ cap: "lock-control",
38454
+ field: "state"
38196
38455
  },
38197
38456
  {
38198
38457
  cap: "contact",
@@ -44282,6 +44541,12 @@ Object.freeze({
44282
44541
  addonId: null,
44283
44542
  access: "view"
44284
44543
  },
44544
+ "notificationRules.getTemplateCatalog": {
44545
+ capName: "notification-rules",
44546
+ capScope: "system",
44547
+ addonId: null,
44548
+ access: "view"
44549
+ },
44285
44550
  "notificationRules.listDeviceMutes": {
44286
44551
  capName: "notification-rules",
44287
44552
  capScope: "system",
@@ -44300,6 +44565,12 @@ Object.freeze({
44300
44565
  addonId: null,
44301
44566
  access: "view"
44302
44567
  },
44568
+ "notificationRules.previewTemplate": {
44569
+ capName: "notification-rules",
44570
+ capScope: "system",
44571
+ addonId: null,
44572
+ access: "view"
44573
+ },
44303
44574
  "notificationRules.resolveArtifactUrl": {
44304
44575
  capName: "notification-rules",
44305
44576
  capScope: "system",
@@ -49947,6 +50218,766 @@ function isScheduleActive(schedule, atMs) {
49947
50218
  }
49948
50219
  return schedule.invert === true ? !inside : inside;
49949
50220
  }
50221
+ var RULE_BODY_ONLY = ["body"];
50222
+ var RULE_TEXT = ["title", "body"];
50223
+ var BATTERY = ["device-battery-low", "device-battery-normal"];
50224
+ var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
50225
+ var UPDATES = [
50226
+ "addon-update-available",
50227
+ "server-update-available",
50228
+ "wrapper-update-available"
50229
+ ];
50230
+ var PACKAGE_UPDATES = ["addon-update-available", "server-update-available"];
50231
+ var ALARM = [
50232
+ "alarm-triggered",
50233
+ "alarm-armed",
50234
+ "alarm-disarmed",
50235
+ "alarm-arming",
50236
+ "alarm-arm-refused",
50237
+ "alarm-pending",
50238
+ "alarm-rearmed",
50239
+ "alarm-sensor-bypass",
50240
+ "alarm-check-failed"
50241
+ ];
50242
+ var COMBINED_ALARM = ["alarm-triggered"];
50243
+ var DEVICE_EVENTS = [
50244
+ "device-online",
50245
+ "device-offline",
50246
+ "device-disabled",
50247
+ "device-enabled",
50248
+ ...BATTERY,
50249
+ ...CONSUMABLE,
50250
+ "stream-online",
50251
+ "stream-offline",
50252
+ "detection-blind",
50253
+ ...ALARM
50254
+ ];
50255
+ var NC_TEMPLATE_VARS = [
50256
+ {
50257
+ name: "camera",
50258
+ label: "Camera",
50259
+ example: "Ingresso",
50260
+ group: "subject",
50261
+ families: ["rule", "timelapse"],
50262
+ systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
50263
+ },
50264
+ {
50265
+ name: "class",
50266
+ label: "Detected class",
50267
+ description: "The counted class on an occupancy row (e.g. \"person\"); the detected class elsewhere.",
50268
+ example: "person",
50269
+ group: "subject",
50270
+ families: ["rule"],
50271
+ fields: [...RULE_TEXT],
50272
+ kinds: [
50273
+ "detection",
50274
+ "sensor",
50275
+ "sound",
50276
+ "occupancy",
50277
+ "system"
50278
+ ],
50279
+ systemEventKinds: [...COMBINED_ALARM]
50280
+ },
50281
+ {
50282
+ name: "label",
50283
+ label: "Name or plate",
50284
+ description: "Recognised person or read plate; empty otherwise.",
50285
+ example: "Mario",
50286
+ group: "subject",
50287
+ families: ["rule"],
50288
+ fields: [...RULE_TEXT],
50289
+ kinds: ["detection", "system"],
50290
+ systemEventKinds: [...COMBINED_ALARM]
50291
+ },
50292
+ {
50293
+ name: "subject",
50294
+ label: "Subject sentence",
50295
+ description: "Composed in the notification language, e.g. \"person (Mario)\".",
50296
+ example: "persona (Mario)",
50297
+ group: "subject",
50298
+ families: ["rule"],
50299
+ fields: [...RULE_TEXT],
50300
+ kinds: [
50301
+ "detection",
50302
+ "sensor",
50303
+ "sound",
50304
+ "occupancy"
50305
+ ]
50306
+ },
50307
+ {
50308
+ name: "confidence",
50309
+ label: "Confidence",
50310
+ example: "87%",
50311
+ group: "subject",
50312
+ families: ["rule"],
50313
+ fields: [...RULE_TEXT],
50314
+ kinds: ["detection", "system"],
50315
+ systemEventKinds: [...COMBINED_ALARM]
50316
+ },
50317
+ {
50318
+ name: "count",
50319
+ label: "Count",
50320
+ description: "Occupancy count, subjects in a grouped notification, or the event count of a system notice.",
50321
+ example: "3",
50322
+ group: "subject",
50323
+ families: ["rule"],
50324
+ fields: [...RULE_TEXT],
50325
+ kinds: [
50326
+ "detection",
50327
+ "occupancy",
50328
+ "system"
50329
+ ],
50330
+ systemEventKinds: [
50331
+ "addon-crash-loop",
50332
+ ...PACKAGE_UPDATES,
50333
+ "addon-updated"
50334
+ ]
50335
+ },
50336
+ {
50337
+ name: "detectionSummary",
50338
+ label: "Detection summary",
50339
+ description: "Class composition, e.g. \"2 persons and 1 car\".",
50340
+ example: "2 persone e 1 auto",
50341
+ group: "subject",
50342
+ families: [
50343
+ "rule",
50344
+ "timelapse",
50345
+ "summary"
50346
+ ],
50347
+ fields: [...RULE_TEXT],
50348
+ kinds: ["detection"]
50349
+ },
50350
+ {
50351
+ name: "zones",
50352
+ label: "Zones",
50353
+ example: "Cancello, Vialetto",
50354
+ group: "place",
50355
+ families: ["rule"],
50356
+ fields: [...RULE_TEXT],
50357
+ kinds: ["detection", "system"],
50358
+ systemEventKinds: [...COMBINED_ALARM]
50359
+ },
50360
+ {
50361
+ name: "zone",
50362
+ label: "Zone",
50363
+ example: "Cancello",
50364
+ group: "place",
50365
+ families: ["rule"],
50366
+ fields: [...RULE_TEXT],
50367
+ kinds: [
50368
+ "detection",
50369
+ "occupancy",
50370
+ "system"
50371
+ ],
50372
+ systemEventKinds: [...COMBINED_ALARM]
50373
+ },
50374
+ {
50375
+ name: "inZones",
50376
+ label: "\"in <zones>\" fragment",
50377
+ description: "Leading space included; empty when no zone.",
50378
+ example: " in Cancello",
50379
+ group: "place",
50380
+ families: ["rule"],
50381
+ fields: [...RULE_TEXT],
50382
+ kinds: ["detection", "system"],
50383
+ systemEventKinds: [...COMBINED_ALARM]
50384
+ },
50385
+ {
50386
+ name: "scope",
50387
+ label: "Occupancy scope",
50388
+ example: "Cancello",
50389
+ group: "place",
50390
+ families: ["rule"],
50391
+ fields: [...RULE_TEXT],
50392
+ kinds: ["occupancy"]
50393
+ },
50394
+ {
50395
+ name: "time",
50396
+ label: "Time",
50397
+ description: "Hours and minutes, in the notification language.",
50398
+ example: "20:05",
50399
+ group: "time",
50400
+ families: [
50401
+ "rule",
50402
+ "timelapse",
50403
+ "summary"
50404
+ ],
50405
+ fields: [...RULE_TEXT]
50406
+ },
50407
+ {
50408
+ name: "rule",
50409
+ label: "Rule name",
50410
+ example: "Ingresso notte",
50411
+ group: "rule",
50412
+ families: [
50413
+ "rule",
50414
+ "timelapse",
50415
+ "summary"
50416
+ ]
50417
+ },
50418
+ {
50419
+ name: "from",
50420
+ label: "Window start",
50421
+ example: "07:00",
50422
+ group: "time",
50423
+ families: ["timelapse", "summary"]
50424
+ },
50425
+ {
50426
+ name: "to",
50427
+ label: "Window end",
50428
+ example: "08:00",
50429
+ group: "time",
50430
+ families: ["timelapse", "summary"]
50431
+ },
50432
+ {
50433
+ name: "capacity",
50434
+ label: "Capacity",
50435
+ example: "2",
50436
+ group: "occupancy",
50437
+ families: ["rule"],
50438
+ fields: [...RULE_TEXT],
50439
+ kinds: ["occupancy"]
50440
+ },
50441
+ {
50442
+ name: "op",
50443
+ label: "Occupied / free",
50444
+ example: "occupata",
50445
+ group: "occupancy",
50446
+ families: ["rule"],
50447
+ fields: [...RULE_TEXT],
50448
+ kinds: ["occupancy"]
50449
+ },
50450
+ {
50451
+ name: "sounds",
50452
+ label: "Sounds heard",
50453
+ example: "abbaio, clacson",
50454
+ group: "sound",
50455
+ families: ["rule"],
50456
+ fields: [...RULE_TEXT],
50457
+ kinds: ["sound"]
50458
+ },
50459
+ {
50460
+ name: "hitPercent",
50461
+ label: "Share of the window",
50462
+ description: "Level mode only: percentage of samples above the threshold.",
50463
+ example: "42",
50464
+ group: "sound",
50465
+ families: ["rule"],
50466
+ fields: [...RULE_TEXT],
50467
+ kinds: ["sound"]
50468
+ },
50469
+ {
50470
+ name: "db",
50471
+ label: "Peak level (dBFS)",
50472
+ example: "-18",
50473
+ group: "sound",
50474
+ families: ["rule"],
50475
+ fields: [...RULE_TEXT],
50476
+ kinds: ["sound"]
50477
+ },
50478
+ {
50479
+ name: "eventType",
50480
+ label: "Event type",
50481
+ description: "Raw device event token, e.g. \"press\" or \"open\"; empty when the device sends none.",
50482
+ example: "press",
50483
+ group: "sensor",
50484
+ families: ["rule"],
50485
+ fields: [...RULE_TEXT],
50486
+ kinds: ["sensor"]
50487
+ },
50488
+ {
50489
+ name: "ai",
50490
+ label: "AI sentence",
50491
+ description: "Where the AI description goes; appended on its own line when absent.",
50492
+ example: "Una persona lascia un pacco.",
50493
+ group: "ai",
50494
+ families: ["rule", "summary"],
50495
+ fields: [...RULE_BODY_ONLY],
50496
+ kinds: ["detection", "occupancy"]
50497
+ },
50498
+ {
50499
+ name: "eventKind",
50500
+ label: "Event kind",
50501
+ example: "device-offline",
50502
+ group: "system",
50503
+ families: ["rule"],
50504
+ fields: [...RULE_TEXT],
50505
+ kinds: ["system"]
50506
+ },
50507
+ {
50508
+ name: "deviceName",
50509
+ label: "Device",
50510
+ example: "Ingresso",
50511
+ group: "system",
50512
+ families: ["rule"],
50513
+ fields: [...RULE_TEXT],
50514
+ kinds: ["system"],
50515
+ systemEventKinds: [...DEVICE_EVENTS]
50516
+ },
50517
+ {
50518
+ name: "deviceId",
50519
+ label: "Device id",
50520
+ example: "617",
50521
+ group: "system",
50522
+ families: ["rule"],
50523
+ fields: [...RULE_TEXT],
50524
+ kinds: ["system"],
50525
+ systemEventKinds: [...DEVICE_EVENTS, "export-completed"]
50526
+ },
50527
+ {
50528
+ name: "percentage",
50529
+ label: "Percentage",
50530
+ example: "15",
50531
+ group: "system",
50532
+ families: ["rule"],
50533
+ fields: [...RULE_TEXT],
50534
+ kinds: ["system"],
50535
+ systemEventKinds: [...BATTERY, ...CONSUMABLE]
50536
+ },
50537
+ {
50538
+ name: "item",
50539
+ label: "Consumable",
50540
+ example: "Filtro",
50541
+ group: "system",
50542
+ families: ["rule"],
50543
+ fields: [...RULE_TEXT],
50544
+ kinds: ["system"],
50545
+ systemEventKinds: [...CONSUMABLE]
50546
+ },
50547
+ {
50548
+ name: "profile",
50549
+ label: "Stream profile",
50550
+ example: "high",
50551
+ group: "system",
50552
+ families: ["rule"],
50553
+ fields: [...RULE_TEXT],
50554
+ kinds: ["system"],
50555
+ systemEventKinds: ["stream-online", "stream-offline"]
50556
+ },
50557
+ {
50558
+ name: "node",
50559
+ label: "Node",
50560
+ example: "hub",
50561
+ group: "system",
50562
+ families: ["rule"],
50563
+ fields: [...RULE_TEXT],
50564
+ kinds: ["system"],
50565
+ systemEventKinds: [
50566
+ "node-online",
50567
+ "node-offline",
50568
+ "node-inference-unavailable",
50569
+ "addon-crash-loop",
50570
+ ...UPDATES,
50571
+ "addon-updated",
50572
+ "server-updated"
50573
+ ]
50574
+ },
50575
+ {
50576
+ name: "nodeId",
50577
+ label: "Node id",
50578
+ example: "hub",
50579
+ group: "system",
50580
+ families: ["rule"],
50581
+ fields: [...RULE_TEXT],
50582
+ kinds: ["system"],
50583
+ systemEventKinds: [
50584
+ "node-online",
50585
+ "node-offline",
50586
+ "node-inference-unavailable",
50587
+ "addon-crash-loop",
50588
+ ...UPDATES,
50589
+ "server-updated"
50590
+ ]
50591
+ },
50592
+ {
50593
+ name: "devices",
50594
+ label: "Devices",
50595
+ description: "node-inference-unavailable: the affected cameras, comma-joined. Alarm arm / refusal: HOW MANY devices are armed (or open).",
50596
+ example: "Ingresso, Garage",
50597
+ group: "system",
50598
+ families: ["rule"],
50599
+ fields: [...RULE_TEXT],
50600
+ kinds: ["system"],
50601
+ systemEventKinds: [
50602
+ "node-inference-unavailable",
50603
+ "alarm-armed",
50604
+ "alarm-arm-refused"
50605
+ ]
50606
+ },
50607
+ {
50608
+ name: "addons",
50609
+ label: "Addons",
50610
+ example: "stream-broker",
50611
+ group: "system",
50612
+ families: ["rule"],
50613
+ fields: [...RULE_TEXT],
50614
+ kinds: ["system"],
50615
+ systemEventKinds: ["addon-crash-loop"]
50616
+ },
50617
+ {
50618
+ name: "minutes",
50619
+ label: "Minutes",
50620
+ example: "12",
50621
+ group: "system",
50622
+ families: ["rule"],
50623
+ fields: [...RULE_TEXT],
50624
+ kinds: ["system"],
50625
+ systemEventKinds: ["detection-blind"]
50626
+ },
50627
+ {
50628
+ name: "package",
50629
+ label: "Package",
50630
+ example: "@camstack/addon-recorder",
50631
+ group: "system",
50632
+ families: ["rule"],
50633
+ fields: [...RULE_TEXT],
50634
+ kinds: ["system"],
50635
+ systemEventKinds: [
50636
+ ...UPDATES,
50637
+ "addon-updated",
50638
+ "server-updated"
50639
+ ]
50640
+ },
50641
+ {
50642
+ name: "packageName",
50643
+ label: "Package",
50644
+ example: "@camstack/addon-recorder",
50645
+ group: "system",
50646
+ families: ["rule"],
50647
+ fields: [...RULE_TEXT],
50648
+ kinds: ["system"],
50649
+ systemEventKinds: [...PACKAGE_UPDATES, "server-updated"]
50650
+ },
50651
+ {
50652
+ name: "nodes",
50653
+ label: "Nodes",
50654
+ description: "Comma-joined node ids, when an update spans more than one — the single-node case names it through {{nodeId}} instead. `incomingFromUpdateAvailable` (event-intake.ts) fills `nodes` from ONE shared textParams object for both addon- and server-update-available, exactly like packageName/currentVersion/latestVersion/count — only the shipped TEXT (system.server-update-available.body.onNodes) reads it today, but the var is real on both kinds.",
50655
+ example: "hub, little-unraid",
50656
+ group: "system",
50657
+ families: ["rule"],
50658
+ fields: [...RULE_TEXT],
50659
+ kinds: ["system"],
50660
+ systemEventKinds: [...PACKAGE_UPDATES]
50661
+ },
50662
+ {
50663
+ name: "currentVersion",
50664
+ label: "Current version",
50665
+ example: "1.2.377",
50666
+ group: "system",
50667
+ families: ["rule"],
50668
+ fields: [...RULE_TEXT],
50669
+ kinds: ["system"],
50670
+ systemEventKinds: [...UPDATES]
50671
+ },
50672
+ {
50673
+ name: "latestVersion",
50674
+ label: "Latest version",
50675
+ example: "1.2.378",
50676
+ group: "system",
50677
+ families: ["rule"],
50678
+ fields: [...RULE_TEXT],
50679
+ kinds: ["system"],
50680
+ systemEventKinds: [...UPDATES]
50681
+ },
50682
+ {
50683
+ name: "list",
50684
+ label: "Updated packages",
50685
+ description: "One line per package. `incomingFromUpdateAvailable` fills it for addon-/server-update-available too (the SAME shared textParams object as `nodes`) — `system.addon-update-available.body` reads it; `incomingFromAddonUpdates` fills it again, independently, for the completed `addon-updated` event.",
50686
+ example: "recorder, notifiers",
50687
+ group: "system",
50688
+ families: ["rule"],
50689
+ fields: [...RULE_TEXT],
50690
+ kinds: ["system"],
50691
+ systemEventKinds: [...PACKAGE_UPDATES, "addon-updated"]
50692
+ },
50693
+ {
50694
+ name: "fromVersion",
50695
+ label: "From version",
50696
+ example: "1.2.377",
50697
+ group: "system",
50698
+ families: ["rule"],
50699
+ fields: [...RULE_TEXT],
50700
+ kinds: ["system"],
50701
+ systemEventKinds: ["server-updated"]
50702
+ },
50703
+ {
50704
+ name: "toVersion",
50705
+ label: "To version",
50706
+ example: "1.2.378",
50707
+ group: "system",
50708
+ families: ["rule"],
50709
+ fields: [...RULE_TEXT],
50710
+ kinds: ["system"],
50711
+ systemEventKinds: ["server-updated"]
50712
+ },
50713
+ {
50714
+ name: "destinationsOk",
50715
+ label: "Destinations ok",
50716
+ example: "2",
50717
+ group: "system",
50718
+ families: ["rule"],
50719
+ fields: [...RULE_TEXT],
50720
+ kinds: ["system"],
50721
+ systemEventKinds: ["backup-completed"]
50722
+ },
50723
+ {
50724
+ name: "destinationsTotal",
50725
+ label: "Destinations",
50726
+ example: "2",
50727
+ group: "system",
50728
+ families: ["rule"],
50729
+ fields: [...RULE_TEXT],
50730
+ kinds: ["system"],
50731
+ systemEventKinds: ["backup-completed"]
50732
+ },
50733
+ {
50734
+ name: "destinationsFailed",
50735
+ label: "Destinations failed",
50736
+ example: "0",
50737
+ group: "system",
50738
+ families: ["rule"],
50739
+ fields: [...RULE_TEXT],
50740
+ kinds: ["system"],
50741
+ systemEventKinds: ["backup-completed"]
50742
+ },
50743
+ {
50744
+ name: "sizeMB",
50745
+ label: "Size (MB)",
50746
+ example: "412",
50747
+ group: "system",
50748
+ families: ["rule"],
50749
+ fields: [...RULE_TEXT],
50750
+ kinds: ["system"],
50751
+ systemEventKinds: ["backup-completed"]
50752
+ },
50753
+ {
50754
+ name: "backupId",
50755
+ label: "Backup id",
50756
+ example: "bk-20260924",
50757
+ group: "system",
50758
+ families: ["rule"],
50759
+ fields: [...RULE_TEXT],
50760
+ kinds: ["system"],
50761
+ systemEventKinds: ["backup-completed"]
50762
+ },
50763
+ {
50764
+ name: "title",
50765
+ label: "Export title",
50766
+ example: "Ingresso 08:00",
50767
+ group: "system",
50768
+ families: ["rule"],
50769
+ fields: [...RULE_TEXT],
50770
+ kinds: ["system"],
50771
+ systemEventKinds: ["export-completed"]
50772
+ },
50773
+ {
50774
+ name: "exportId",
50775
+ label: "Export id",
50776
+ example: "exp-20260924",
50777
+ group: "system",
50778
+ families: ["rule"],
50779
+ fields: [...RULE_TEXT],
50780
+ kinds: ["system"],
50781
+ systemEventKinds: ["export-completed"]
50782
+ },
50783
+ {
50784
+ name: "bytes",
50785
+ label: "Export size (bytes)",
50786
+ example: "10485760",
50787
+ group: "system",
50788
+ families: ["rule"],
50789
+ fields: [...RULE_TEXT],
50790
+ kinds: ["system"],
50791
+ systemEventKinds: ["export-completed"]
50792
+ },
50793
+ {
50794
+ name: "mode",
50795
+ label: "Alarm mode",
50796
+ example: "away",
50797
+ group: "system",
50798
+ families: ["rule"],
50799
+ fields: [...RULE_TEXT],
50800
+ kinds: ["system"],
50801
+ systemEventKinds: [
50802
+ "alarm-armed",
50803
+ "alarm-arming",
50804
+ "alarm-arm-refused",
50805
+ "alarm-pending",
50806
+ "alarm-rearmed",
50807
+ "alarm-check-failed"
50808
+ ]
50809
+ },
50810
+ {
50811
+ name: "seconds",
50812
+ label: "Seconds",
50813
+ description: "Arming: the exit delay left. Pending: the entry delay left to disarm.",
50814
+ example: "30",
50815
+ group: "system",
50816
+ families: ["rule"],
50817
+ fields: [...RULE_TEXT],
50818
+ kinds: ["system"],
50819
+ systemEventKinds: ["alarm-arming", "alarm-pending"]
50820
+ },
50821
+ {
50822
+ name: "rules",
50823
+ label: "Covering rules",
50824
+ description: "How many enabled rules the armed mode gates.",
50825
+ example: "2",
50826
+ group: "system",
50827
+ families: ["rule"],
50828
+ fields: [...RULE_TEXT],
50829
+ kinds: ["system"],
50830
+ systemEventKinds: ["alarm-armed"]
50831
+ },
50832
+ {
50833
+ name: "names",
50834
+ label: "Device names",
50835
+ description: "Armed: the devices armed. Arming: the devices this mode cannot arm. Refusal: the open sensors.",
50836
+ example: "Ingresso, Garage",
50837
+ group: "system",
50838
+ families: ["rule"],
50839
+ fields: [...RULE_TEXT],
50840
+ kinds: ["system"],
50841
+ systemEventKinds: [
50842
+ "alarm-armed",
50843
+ "alarm-arming",
50844
+ "alarm-arm-refused"
50845
+ ]
50846
+ },
50847
+ {
50848
+ name: "skippedNames",
50849
+ label: "Skipped devices",
50850
+ description: "Devices the mode names but cannot arm (muted, detection off, offline).",
50851
+ example: "Garage",
50852
+ group: "system",
50853
+ families: ["rule"],
50854
+ fields: [...RULE_TEXT],
50855
+ kinds: ["system"],
50856
+ systemEventKinds: ["alarm-armed"]
50857
+ },
50858
+ {
50859
+ name: "bypassedNames",
50860
+ label: "Bypassed sensors",
50861
+ description: "Sensors the operator armed around because they were open.",
50862
+ example: "Finestra veranda",
50863
+ group: "system",
50864
+ families: ["rule"],
50865
+ fields: [...RULE_TEXT],
50866
+ kinds: ["system"],
50867
+ systemEventKinds: ["alarm-armed", "alarm-arming"]
50868
+ },
50869
+ {
50870
+ name: "coverage",
50871
+ label: "Coverage %",
50872
+ example: "96",
50873
+ group: "digest",
50874
+ families: ["timelapse"],
50875
+ fields: [...RULE_TEXT]
50876
+ },
50877
+ {
50878
+ name: "events",
50879
+ label: "Events",
50880
+ example: "4",
50881
+ group: "digest",
50882
+ families: ["timelapse", "summary"],
50883
+ fields: [...RULE_TEXT]
50884
+ },
50885
+ {
50886
+ name: "detections",
50887
+ label: "Detections",
50888
+ example: "7",
50889
+ group: "digest",
50890
+ families: ["timelapse", "summary"],
50891
+ fields: [...RULE_TEXT]
50892
+ },
50893
+ {
50894
+ name: "count_person",
50895
+ label: "Count of one class",
50896
+ description: "count_<class>, e.g. count_person, count_car.",
50897
+ example: "3",
50898
+ group: "digest",
50899
+ families: ["timelapse", "summary"],
50900
+ fields: [...RULE_TEXT],
50901
+ dynamic: {
50902
+ prefix: "count_",
50903
+ from: "classes"
50904
+ }
50905
+ },
50906
+ {
50907
+ name: "cameras",
50908
+ label: "Cameras",
50909
+ example: "3",
50910
+ group: "digest",
50911
+ families: ["summary"],
50912
+ fields: [...RULE_TEXT]
50913
+ },
50914
+ {
50915
+ name: "matched",
50916
+ label: "Matched events",
50917
+ example: "12",
50918
+ group: "digest",
50919
+ families: ["summary"],
50920
+ fields: [...RULE_TEXT]
50921
+ },
50922
+ {
50923
+ name: "shown",
50924
+ label: "Events shown",
50925
+ example: "9",
50926
+ group: "digest",
50927
+ families: ["summary"],
50928
+ fields: [...RULE_TEXT]
50929
+ },
50930
+ {
50931
+ name: "total",
50932
+ label: "Events total",
50933
+ example: "12",
50934
+ group: "digest",
50935
+ families: ["summary"],
50936
+ fields: [...RULE_TEXT]
50937
+ }
50938
+ ];
50939
+ /** The caption fields see a fixed, smaller vocabulary (`timelapsePreviewText`,
50940
+ * `summaryCaptionText`). Declared here rather than as `fields` on every
50941
+ * descriptor so the whole rule stays in one line of code. */
50942
+ var CAPTION_VARS = {
50943
+ previewText: [
50944
+ "camera",
50945
+ "rule",
50946
+ "from",
50947
+ "to"
50948
+ ],
50949
+ captionText: [
50950
+ "rule",
50951
+ "from",
50952
+ "to"
50953
+ ]
50954
+ };
50955
+ function onAxis(declared, asked) {
50956
+ return declared === void 0 || asked === void 0 || declared.includes(asked);
50957
+ }
50958
+ function onSystemAxis(d, ctx) {
50959
+ if (ctx.kind !== "system" || d.systemEventKinds === void 0) return true;
50960
+ const asked = ctx.systemEventKinds ?? [];
50961
+ return asked.length === 0 || asked.some((k) => d.systemEventKinds?.includes(k) === true);
50962
+ }
50963
+ /**
50964
+ * The variables that have a value in `ctx`, in catalog order. Pure.
50965
+ *
50966
+ * `ctx` is trusted, typed input — untrusted input (a served/RPC boundary) is
50967
+ * validated once against {@link NcTemplateVarContextSchema} at the cap/bridge
50968
+ * boundary, not re-parsed on every call here (Task 4).
50969
+ */
50970
+ function templateVarsFor(ctx) {
50971
+ if (ctx.field === "previewText" || ctx.field === "captionText") {
50972
+ const allowed = CAPTION_VARS[ctx.field];
50973
+ return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && allowed.includes(d.name) && d.dynamic === void 0);
50974
+ }
50975
+ return NC_TEMPLATE_VARS.filter((d) => d.families.includes(ctx.family) && onAxis(d.fields, ctx.field) && onAxis(d.kinds, ctx.kind) && onAxis(d.deliveries, ctx.delivery) && onSystemAxis(d, ctx));
50976
+ }
50977
+ /** True when `name` is supplied in `ctx`, dynamic families (`count_<class>`) included. */
50978
+ function isKnownTemplateVar(name, ctx) {
50979
+ return templateVarsFor(ctx).some((d) => d.dynamic !== void 0 ? name.startsWith(d.dynamic.prefix) && name.length > d.dynamic.prefix.length : d.name === name);
50980
+ }
49950
50981
  /**
49951
50982
  * Does `filter` say anything about `kind`?
49952
50983
  *
@@ -50965,4 +51996,4 @@ function vectorDimFromBase64(encoded) {
50965
51996
  return Math.floor(Buffer.from(encoded, "base64").byteLength / 4);
50966
51997
  }
50967
51998
  //#endregion
50968
- export { TimelapseRuleSchema as $, discriminatedUnion as $t, NcRuleInputSchema as A, readTimelapseGeneratedAt as At, OpsLogEntrySchema as B, BaseAddon as Bt, MediaFileKindEnum as C, notificationRulesCapability as Ct, NC_SNOOZE_MAX_MINUTES as D, pipelineAnalyticsCapability as Dt, NC_DEFAULT_SNOOZE_MINUTES as E, pickClusterStepModels as Et, NcSnoozeInputSchema as F, subKindsOf as Ft, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as G, defineCustomActions as Gt, RECORDING_EXPORT_MAX_READ_BYTES as H, DeviceType as Ht, NcSnoozeSchema as I, systemEventFilterApplies as It, SCENE_DIVERGED as J, nodePin as Jt, SCENE_DEFAULT_ANCHOR_THRESHOLD as K, hydrateSchema as Kt, NcSnoozeSuppressedSchema as L, vectorDimFromBase64 as Lt, NcRuleSchema as M, resolvePoolMemoryPolicy as Mt, NcRuleTargetSchema as N, sceneMonitorCapability as Nt, NC_TAXONOMY as O, plateGalleryCapability as Ot, NcScheduleSchema as P, storageOccupancyCapability as Pt, TimelapseRulePatchSchema as Q, boolean as Qt, NcSystemEventKindSchema as R, zoneAnalyticsCapability as Rt, MOTION_CLOSE_AFTER_MS as S, mayWriteToLocation as St, NC_CONDITION_CATALOG as T, parseProcStatus as Tt, RECORDING_SOURCE_CAMSTACK_ADDON as U, createEvent as Ut, PoolMemoryWatchdog as V, CamProfileSchema as Vt, RetrainStatusSchema as W, customAction as Wt, TIMELAPSE_DENSE_FLOOR_SEC as X, _enum as Xt, SceneMonitorSchema as Y, sleep as Yt, TimelapseRuleInputSchema as Z, array as Zt, FailureCounters as _, isEventOwnerType as _t, CLUSTER_MODEL_SCOPED_STEPS as a, string as an, audioModeOf as at, MAX_BIRTH_DECISION_RECORDS as b, isSourceCap as bt, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as c, deriveRecordingMode as ct, DETECTION_PIPELINE_CAP_NAME as d, evaluateSensorEdge as dt, literal as en, TrackSourceSchema as et, DeclaredDevices as f, evictionPolicyOfLocation as ft, FULL_IMAGE_BBOX as g, isDetectionMacroClass as gt, FIRST_LEVEL_MACRO_CLASSES as h, hfModelUrl as ht, BirthDecisionRecordSchema as i, record as in, audioMetricsCapability as it, NcRulePatchSchema as j, resolveLocationMode as jt, NcConditionDescriptorSchema as k, readDeviceStateFrom as kt, DEFAULT_TIMELAPSE_PREVIEW_TEXT as l, embeddingEncoderCapability as lt, EVENT_OWNER_TYPES as m, failureContributionCapability as mt, ArchivedDebugNoteSchema as n, object as nn, alarmPanelCapability as nt, COCO_TO_MACRO as o, unknown as on, buildEventKindDescriptor as ot, EVENT_KIND_BY_CAP as p, faceGalleryCapability as pt, SCENE_DEFAULT_UNCOVERED_POLICY as q, isDeviceScopedCap as qt, BaseDevice as r, partialRecord as rn, assertTimelapseCadences as rt, DEFAULT_EVENT_COLOR as s, EventCategory as sn, cosineSimilarity as st, AUDIO_MACRO_LABELS as t, number as tn, addonWidgetsSourceCapability as tt, DETECTION_MACRO_CLASSES as u, encodeVectorBase64 as ut, LabelAttributionSchema as v, isMediaOwnerType as vt, NC_ALARM_SYSTEM_EVENT_KINDS as w, occupancyScope as wt, MAX_BIRTH_LATENCY_PROXY_MS as x, kebabToCamel as xt, MAX_ARCHIVED_DEBUG_NOTES as y, isScheduleActive as yt, NcTaxonomySchema as z, errMsg as zt };
51999
+ export { RECORDING_SOURCE_CAMSTACK_ADDON as $, CamProfileSchema as $t, NC_SNOOZE_MAX_MINUTES as A, isScheduleActive as At, NcRuleUpdateInputSchema as B, readDeviceStateFrom as Bt, MAX_BIRTH_DECISION_RECORDS as C, faceGalleryCapability as Ct, NC_ALARM_SYSTEM_EVENT_KINDS as D, isEventOwnerType as Dt, MediaFileKindEnum as E, isDetectionMacroClass as Et, NcConditionDescriptorSchema as F, occupancyScope as Ft, NcSystemEventKindSchema as G, storageOccupancyCapability as Gt, NcSnoozeInputSchema as H, resolveLocationMode as Ht, NcRuleInputSchema as I, parseProcStatus as It, NcTemplatePreviewSchema as J, templateVarsFor as Jt, NcTaxonomySchema as K, subKindsOf as Kt, NcRulePatchSchema as L, pickClusterStepModels as Lt, NC_TEMPLATE_VARS as M, kebabToCamel as Mt, NcAlarmConfigSchema as N, mayWriteToLocation as Nt, NC_CONDITION_CATALOG as O, isKnownTemplateVar as Ot, NcAlarmSettingsPatchSchema as P, notificationRulesCapability as Pt, RECORDING_EXPORT_MAX_READ_BYTES as Q, BaseAddon as Qt, NcRuleSchema as R, pipelineAnalyticsCapability as Rt, MAX_ARCHIVED_DEBUG_NOTES as S, evictionPolicyOfLocation as St, MOTION_CLOSE_AFTER_MS as T, hfModelUrl as Tt, NcSnoozeSchema as U, resolvePoolMemoryPolicy as Ut, NcScheduleSchema as V, readTimelapseGeneratedAt as Vt, NcSnoozeSuppressedSchema as W, sceneMonitorCapability as Wt, OpsLogEntrySchema as X, zoneAnalyticsCapability as Xt, NcTemplateVarDescriptorSchema as Y, vectorDimFromBase64 as Yt, PoolMemoryWatchdog as Z, errMsg as Zt, FIRST_LEVEL_MACRO_CLASSES as _, string as _n, cosineSimilarity as _t, BirthDecisionRecordSchema as a, isDeviceScopedCap as an, SceneMonitorSchema as at, LabelAttributionSchema as b, encodeVectorBase64 as bt, CoverStateSchema as c, _enum as cn, TimelapseRulePatchSchema as ct, DEFAULT_TIMELAPSE_PREVIEW_TEXT as d, discriminatedUnion as dn, addonWidgetsSourceCapability as dt, DeviceType as en, RetrainStatusSchema as et, DETECTION_MACRO_CLASSES as f, literal as fn, alarmPanelCapability as ft, EVENT_OWNER_TYPES as g, record as gn, buildEventKindDescriptor as gt, EVENT_KIND_BY_CAP as h, partialRecord as hn, audioModeOf as ht, BaseDevice as i, hydrateSchema as in, SCENE_DIVERGED as it, NC_TAXONOMY as j, isSourceCap as jt, NC_DEFAULT_SNOOZE_MINUTES as k, isMediaOwnerType as kt, DEFAULT_EVENT_COLOR as l, array as ln, TimelapseRuleSchema as lt, DeclaredDevices as m, object as mn, audioMetricsCapability as mt, AlarmArmModeSchema as n, customAction as nn, SCENE_DEFAULT_ANCHOR_THRESHOLD as nt, CLUSTER_MODEL_SCOPED_STEPS as o, nodePin as on, TIMELAPSE_DENSE_FLOOR_SEC as ot, DETECTION_PIPELINE_CAP_NAME as p, number as pn, assertTimelapseCadences as pt, NcTemplatePreviewInputSchema as q, systemEventFilterApplies as qt, ArchivedDebugNoteSchema as r, defineCustomActions as rn, SCENE_DEFAULT_UNCOVERED_POLICY as rt, COCO_TO_MACRO as s, sleep as sn, TimelapseRuleInputSchema as st, AUDIO_MACRO_LABELS as t, createEvent as tn, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as tt, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as u, boolean as un, TrackSourceSchema as ut, FULL_IMAGE_BBOX as v, unknown as vn, deriveRecordingMode as vt, MAX_BIRTH_LATENCY_PROXY_MS as w, failureContributionCapability as wt, LockStateSchema as x, evaluateSensorEdge as xt, FailureCounters as y, EventCategory as yn, embeddingEncoderCapability as yt, NcRuleTargetSchema as z, plateGalleryCapability as zt };