@camstack/addon-post-analysis 1.2.621 → 1.2.623

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 (15) hide show
  1. package/THIRD_PARTY_MODELS.md +2 -2
  2. package/dist/{clip-model-registry-BBzoIoKO.mjs → clip-model-registry-C58fyELd.mjs} +412 -66
  3. package/dist/{clip-model-registry-CcgzpELQ.js → clip-model-registry-KKT83z9U.js} +429 -65
  4. package/dist/embedding-encoder/index.js +1 -1
  5. package/dist/embedding-encoder/index.mjs +1 -1
  6. package/dist/pipeline-analytics/_stub.js +2 -2
  7. package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CkNZAMox.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-_ahOxwNA.mjs} +3 -3
  8. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-V5-s2hmZ.mjs +26 -0
  9. package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CssYIiFD.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-B1HZu0i3.mjs} +1 -1
  10. package/dist/pipeline-analytics/{hostInit-wlnNaaYX.mjs → hostInit-CdRVx4vF.mjs} +3 -3
  11. package/dist/pipeline-analytics/index.js +888 -155
  12. package/dist/pipeline-analytics/index.mjs +888 -155
  13. package/dist/pipeline-analytics/remoteEntry.js +1 -1
  14. package/package.json +1 -1
  15. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BSMSev-b.mjs +0 -26
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  }) : target, mod));
31
31
  //#endregion
32
32
  let node_crypto = require("node:crypto");
33
- //#region ../types/dist/event-category-DOl51-Ij.mjs
33
+ //#region ../types/dist/event-category-BfJwUd2S.mjs
34
34
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
35
35
  EventCategory["SystemBoot"] = "system.boot";
36
36
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -347,6 +347,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
347
347
  */
348
348
  EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
349
349
  /**
350
+ * A camera's motion source has fired constantly with no subject for an hour
351
+ * (motion duty or session count over the bar, zero detections) — it is not
352
+ * blind, its motion zones or sensitivity want tuning (D907). Paired with
353
+ * {@link PipelineMotionCalm}.
354
+ */
355
+ EventCategory["PipelineMotionNoisy"] = "pipeline.motion-noisy";
356
+ /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
357
+ EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
358
+ /**
350
359
  * Per-camera pipeline config was mutated by the orchestrator
351
360
  * (3-level settings change via `setAgentAddonDefaults` /
352
361
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -718,6 +727,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
718
727
  EventCategory["BackupRestored"] = "backup.restored";
719
728
  EventCategory["NotificationDispatched"] = "notification.dispatched";
720
729
  EventCategory["NotificationFailed"] = "notification.failed";
730
+ /**
731
+ * A notification rule that cannot work (D905): its stored row does not load,
732
+ * or it still names a device / delivery target the prune CONFIRMED deleted.
733
+ * One edge per rule per distinct set of reasons; never on an unanswered read.
734
+ */
735
+ EventCategory["NotificationRuleBroken"] = "notification.rule-broken";
736
+ /** The clear of {@link NotificationRuleBroken}: the rule loads and names nothing deleted. */
737
+ EventCategory["NotificationRuleRepaired"] = "notification.rule-repaired";
721
738
  EventCategory["DeviceUpdated"] = "device.updated";
722
739
  /**
723
740
  * Transport-level connectivity. Emitted by the device driver when
@@ -5643,7 +5660,7 @@ var ZodIssueCode = {
5643
5660
  var ZodFirstPartyTypeKind;
5644
5661
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5645
5662
  //#endregion
5646
- //#region ../types/dist/sleep-_sV1BE2f.mjs
5663
+ //#region ../types/dist/sleep-DJFUfKvA.mjs
5647
5664
  /**
5648
5665
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5649
5666
  * window to float samples (D455).
@@ -8235,7 +8252,7 @@ var EntryDescriptorSchema = object({
8235
8252
  /** JSON Schema of the entry body; `secret: true` marks a password field. */
8236
8253
  fields: record(string(), unknown())
8237
8254
  }).strict();
8238
- /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
8255
+ /** What crosses the wire from an addon: JSON only, no Zod. An unknown key is refused. */
8239
8256
  var RecordKindDeclarationSchema = object({
8240
8257
  database: _enum(RECORD_DATABASES).default("settings"),
8241
8258
  class: _enum(RECORD_CLASSES),
@@ -8254,14 +8271,6 @@ var RecordKindDeclarationSchema = object({
8254
8271
  secretPaths: array(string().min(1)).default([]),
8255
8272
  /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8256
8273
  secretArrayKeys: record(string(), string()).default({}),
8257
- /**
8258
- * RETIRED (D900): the legacy table a kind adopted from during the records
8259
- * migration. Nothing declares it any more and nothing reads it; the schema
8260
- * still ACCEPTS it because the catalog rows the migration wrote carry it
8261
- * (an orphaned kind is never redeclared) and an addon built before the
8262
- * removal still sends it. Never set it.
8263
- */
8264
- adoptsFrom: string().min(1).optional(),
8265
8274
  /** Kinds that must agree through `transact` sit in one file under one family name. */
8266
8275
  transactFamily: string().min(1).optional(),
8267
8276
  entry: EntryDescriptorSchema.optional()
@@ -14163,17 +14172,6 @@ object({
14163
14172
  createdAt: number(),
14164
14173
  updatedAt: number()
14165
14174
  });
14166
- object({
14167
- id: string(),
14168
- label: string(),
14169
- isAdmin: boolean().default(false),
14170
- allowedProviders: AllowedProviderSchema,
14171
- allowedDevices: AllowedDevicesSchema,
14172
- tokenHash: string(),
14173
- tokenPrefix: string(),
14174
- createdAt: number(),
14175
- lastUsedAt: number().optional()
14176
- });
14177
14175
  object({
14178
14176
  id: string(),
14179
14177
  userId: string(),
@@ -18185,16 +18183,36 @@ var RecordKindStateSchema = _enum([
18185
18183
  var DeclareKindResultSchema = object({
18186
18184
  kindId: number().int(),
18187
18185
  state: RecordKindStateSchema,
18188
- createdIndexes: array(string()),
18189
- /**
18190
- * RETIRED (D900): always `null`. It carried the records-migration boot guard;
18191
- * it stays on the wire, null, because an addon built before the removal reads
18192
- * an ABSENT field as "adoption pending" and refuses to start.
18193
- */
18194
- adoptionPending: _null()
18186
+ createdIndexes: array(string())
18195
18187
  });
18196
18188
  /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
18197
18189
  var SecretRefsList = array(string());
18190
+ /**
18191
+ * One op of a `transact`: the single-row writes, each on a kind of the caller.
18192
+ * All ops of one call share ONE database file and ONE `transactFamily`.
18193
+ */
18194
+ var RecordTransactOpSchema = discriminatedUnion("op", [
18195
+ object({
18196
+ op: literal("put"),
18197
+ kind: RecordKindNameSchema,
18198
+ record: RecordInputSchema,
18199
+ ifRev: number().int().min(0).optional()
18200
+ }),
18201
+ object({
18202
+ op: literal("patch"),
18203
+ kind: RecordKindNameSchema,
18204
+ id: RecordIdSchema,
18205
+ data: RecordBodySchema,
18206
+ at: number().int().nullable().optional(),
18207
+ expiresAt: number().int().nullable().optional(),
18208
+ ifRev: number().int().min(1).optional()
18209
+ }),
18210
+ object({
18211
+ op: literal("delete"),
18212
+ kind: RecordKindNameSchema,
18213
+ id: RecordIdSchema
18214
+ })
18215
+ ]);
18198
18216
  var RecordSecretRefsSchema = record(string(), record(string(), string()));
18199
18217
  method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
18200
18218
  kind: "mutation",
@@ -18301,6 +18319,16 @@ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema)
18301
18319
  }), {
18302
18320
  kind: "mutation",
18303
18321
  auth: "admin"
18322
+ }), method(object({ ops: array(RecordTransactOpSchema).min(1).max(RECORD_BATCH_MAX) }), object({
18323
+ results: array(object({
18324
+ rev: number().int().nullable(),
18325
+ deleted: boolean()
18326
+ })),
18327
+ releasedRefs: SecretRefsList,
18328
+ secretRefs: SecretRefsList
18329
+ }), {
18330
+ kind: "mutation",
18331
+ auth: "admin"
18304
18332
  }), method(object({
18305
18333
  deviceId: number().int(),
18306
18334
  kinds: array(RecordKindNameSchema).optional()
@@ -44042,9 +44070,13 @@ var NcSystemEventKindSchema = _enum([
44042
44070
  "node-updating",
44043
44071
  "node-inference-unavailable",
44044
44072
  "detection-blind",
44073
+ "motion-noisy",
44074
+ "motion-calm",
44045
44075
  "recording-stalled",
44046
44076
  "recording-healthy",
44047
44077
  "recording-degraded",
44078
+ "device-attention-required",
44079
+ "device-attention-resolved",
44048
44080
  "storage-location-low",
44049
44081
  "storage-location-critical",
44050
44082
  "storage-location-ok",
@@ -44068,6 +44100,8 @@ var NcSystemEventKindSchema = _enum([
44068
44100
  "alert-critical",
44069
44101
  "alert-error",
44070
44102
  "alert-critical-resolved",
44103
+ "rule-broken",
44104
+ "rule-repaired",
44071
44105
  "camera-online",
44072
44106
  "camera-offline",
44073
44107
  "camera-disabled",
@@ -45597,6 +45631,14 @@ var NC_CONDITION_CATALOG = [
45597
45631
  value: "detection-blind",
45598
45632
  label: "Camera detecting nothing"
45599
45633
  },
45634
+ {
45635
+ value: "motion-noisy",
45636
+ label: "Camera motion constant, no subject"
45637
+ },
45638
+ {
45639
+ value: "motion-calm",
45640
+ label: "Camera motion calm again"
45641
+ },
45600
45642
  {
45601
45643
  value: "recording-stalled",
45602
45644
  label: "Recording stalled"
@@ -45609,6 +45651,14 @@ var NC_CONDITION_CATALOG = [
45609
45651
  value: "recording-degraded",
45610
45652
  label: "Recording degraded (restart storm)"
45611
45653
  },
45654
+ {
45655
+ value: "device-attention-required",
45656
+ label: "Device needs attention"
45657
+ },
45658
+ {
45659
+ value: "device-attention-resolved",
45660
+ label: "Device attention resolved"
45661
+ },
45612
45662
  {
45613
45663
  value: "storage-location-low",
45614
45664
  label: "Storage location low"
@@ -45693,6 +45743,14 @@ var NC_CONDITION_CATALOG = [
45693
45743
  value: "alert-critical-resolved",
45694
45744
  label: "Critical alert resolved"
45695
45745
  },
45746
+ {
45747
+ value: "rule-broken",
45748
+ label: "Notification rule broken"
45749
+ },
45750
+ {
45751
+ value: "rule-repaired",
45752
+ label: "Notification rule repaired"
45753
+ },
45696
45754
  {
45697
45755
  value: "alarm-arm-refused",
45698
45756
  label: "Alarm arm refused"
@@ -59248,6 +59306,16 @@ var DishwasherStatusSchema = object({
59248
59306
  powerState: string().nullable(),
59249
59307
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
59250
59308
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
59309
+ /**
59310
+ * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
59311
+ * combined care-and-filter reminder raised); false when every such reminder reads clear; null
59312
+ * when none is reported. A cleared reminder is not an unknown one.
59313
+ */
59314
+ filterCleaningDue: boolean().nullable(),
59315
+ /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
59316
+ machineCareDue: boolean().nullable(),
59317
+ /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
59318
+ machineCareRemainingRuns: number().int().nonnegative().nullable(),
59251
59319
  /** Option states: null when the appliance does not expose the option or has not said. */
59252
59320
  halfLoad: boolean().nullable(),
59253
59321
  hygienePlus: boolean().nullable(),
@@ -68067,16 +68135,6 @@ var UpdateUserInputSchema = object({
68067
68135
  allowedDevices: record(string(), union([array(string()), literal("*")])).optional(),
68068
68136
  scopes: array(TokenScopeSchema).optional()
68069
68137
  });
68070
- var ApiKeySummarySchema = object({
68071
- id: string(),
68072
- label: string(),
68073
- isAdmin: boolean().default(false),
68074
- allowedProviders: union([array(string()), literal("*")]).optional(),
68075
- allowedDevices: record(string(), union([array(string()), literal("*")])).optional(),
68076
- tokenPrefix: string(),
68077
- createdAt: number(),
68078
- lastUsedAt: number().optional()
68079
- });
68080
68138
  var OauthSessionSummarySchema = object({
68081
68139
  id: string(),
68082
68140
  userId: string(),
@@ -68098,8 +68156,7 @@ var TotpStatusSchema = object({
68098
68156
  confirmedAt: number().nullable()
68099
68157
  });
68100
68158
  /**
68101
- * user-management — singleton capability for user accounts and the
68102
- * legacy API-key rows.
68159
+ * user-management — singleton capability for user accounts.
68103
68160
  *
68104
68161
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
68105
68162
  * — the subset check on `setUserScopes` is moot
@@ -68155,10 +68212,6 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
68155
68212
  }), UserSummarySchema.extend({ passwordHash: string() }).nullable(), {
68156
68213
  kind: "mutation",
68157
68214
  access: "view"
68158
- }), method(_void(), array(ApiKeySummarySchema), { auth: "admin" }), method(object({ id: string() }), object({ success: literal(true) }), {
68159
- kind: "mutation",
68160
- auth: "admin",
68161
- access: "delete"
68162
68215
  }), method(object({ userId: string() }), TotpSetupResultSchema, {
68163
68216
  kind: "mutation",
68164
68217
  auth: "admin",
@@ -77184,6 +77237,12 @@ Object.freeze({
77184
77237
  addonId: null,
77185
77238
  access: "view"
77186
77239
  },
77240
+ "records.transact": {
77241
+ capName: "records",
77242
+ capScope: "system",
77243
+ addonId: null,
77244
+ access: "create"
77245
+ },
77187
77246
  "sceneMonitor.captureReference": {
77188
77247
  capName: "scene-monitor",
77189
77248
  capScope: "device",
@@ -78516,12 +78575,6 @@ Object.freeze({
78516
78575
  addonId: null,
78517
78576
  access: "view"
78518
78577
  },
78519
- "userManagement.listApiKeys": {
78520
- capName: "user-management",
78521
- capScope: "system",
78522
- addonId: null,
78523
- access: "view"
78524
- },
78525
78578
  "userManagement.listExternalIdentities": {
78526
78579
  capName: "user-management",
78527
78580
  capScope: "system",
@@ -78576,12 +78629,6 @@ Object.freeze({
78576
78629
  addonId: null,
78577
78630
  access: "create"
78578
78631
  },
78579
- "userManagement.revokeApiKey": {
78580
- capName: "user-management",
78581
- capScope: "system",
78582
- addonId: null,
78583
- access: "delete"
78584
- },
78585
78632
  "userManagement.revokeOauthSession": {
78586
78633
  capName: "user-management",
78587
78634
  capScope: "system",
@@ -82071,8 +82118,8 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
82071
82118
  */
82072
82119
  function systemEventFilterApplies(kind, filter) {
82073
82120
  switch (filter) {
82074
- case "deviceIds": return kind.startsWith("device-") || kind.startsWith("stream-") || kind === "detection-blind" || kind.startsWith("recording-") || kind === "alarm-triggered";
82075
- case "deviceTypes": return kind.startsWith("device-") || kind === "detection-blind";
82121
+ case "deviceIds": return kind.startsWith("device-") || kind.startsWith("stream-") || kind === "detection-blind" || kind.startsWith("motion-") || kind.startsWith("recording-") || kind === "alarm-triggered";
82122
+ case "deviceTypes": return kind.startsWith("device-") || kind === "detection-blind" || kind.startsWith("motion-");
82076
82123
  case "nodeIds": return kind.startsWith("node-") || kind === "addon-crash-loop" || kind === "addon-update-available" || kind === "addon-updated" || kind === "server-update-available" || kind === "wrapper-update-available" || kind === "server-updated" || kind.startsWith("storage-location-") || kind.startsWith("alert-");
82077
82124
  case "packageNames": return kind.endsWith("update-available") || kind === "addon-updated" || kind === "node-updating" || kind === "server-updated";
82078
82125
  case "consumableLowPercent": return NC_CONSUMABLE_SYSTEM_EVENT_KINDS.includes(kind);
@@ -82117,9 +82164,13 @@ var NC_SYSTEM_EVENT_FAMILY = {
82117
82164
  "stream-online": "device-events",
82118
82165
  "stream-offline": "device-events",
82119
82166
  "detection-blind": "device-events",
82167
+ "motion-noisy": "device-events",
82168
+ "motion-calm": "device-events",
82120
82169
  "recording-stalled": "device-events",
82121
82170
  "recording-healthy": "device-events",
82122
82171
  "recording-degraded": "device-events",
82172
+ "device-attention-required": "device-events",
82173
+ "device-attention-resolved": "device-events",
82123
82174
  "node-online": "system",
82124
82175
  "node-offline": "system",
82125
82176
  "node-restarting": "system",
@@ -82136,6 +82187,8 @@ var NC_SYSTEM_EVENT_FAMILY = {
82136
82187
  "alert-critical": "system",
82137
82188
  "alert-error": "system",
82138
82189
  "alert-critical-resolved": "system",
82190
+ "rule-broken": "system",
82191
+ "rule-repaired": "system",
82139
82192
  "storage-location-low": "system",
82140
82193
  "storage-location-critical": "system",
82141
82194
  "storage-location-ok": "system",
@@ -82218,6 +82271,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
82218
82271
  label: "Detecting nothing",
82219
82272
  kinds: ["detection-blind"]
82220
82273
  },
82274
+ {
82275
+ id: "motion-noise",
82276
+ family: "device-events",
82277
+ label: "Motion without a subject",
82278
+ kinds: ["motion-noisy", "motion-calm"]
82279
+ },
82221
82280
  {
82222
82281
  id: "recording",
82223
82282
  family: "device-events",
@@ -82228,6 +82287,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
82228
82287
  "recording-degraded"
82229
82288
  ]
82230
82289
  },
82290
+ {
82291
+ id: "device-attention",
82292
+ family: "device-events",
82293
+ label: "Needs attention",
82294
+ kinds: ["device-attention-required", "device-attention-resolved"]
82295
+ },
82231
82296
  {
82232
82297
  id: "nodes",
82233
82298
  family: "system",
@@ -82288,6 +82353,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
82288
82353
  "alert-critical-resolved"
82289
82354
  ]
82290
82355
  },
82356
+ {
82357
+ id: "rule-health",
82358
+ family: "system",
82359
+ label: "Notification rules",
82360
+ kinds: ["rule-broken", "rule-repaired"]
82361
+ },
82291
82362
  {
82292
82363
  id: "alarm",
82293
82364
  family: "alarm",
@@ -83569,6 +83640,16 @@ function alertEpisodeKind(severity, phase) {
83569
83640
  if (severity === "error" && phase === "raised") return "alert-error";
83570
83641
  return null;
83571
83642
  }
83643
+ /**
83644
+ * The kind of a CRITICAL episode edge about a DEVICE (D911): the alert's source
83645
+ * is `device`, so it is announced in the devices family as
83646
+ * `device-attention-required` / `-resolved` INSTEAD of `alert-critical`. One
83647
+ * alert notifies once, through one family. `null` for any other severity.
83648
+ */
83649
+ function deviceAttentionKind(severity, phase) {
83650
+ if (severity !== "critical") return null;
83651
+ return phase === "raised" ? "device-attention-required" : "device-attention-resolved";
83652
+ }
83572
83653
  function alertEpisodePayload(alert, phase, at) {
83573
83654
  const nodeId = alertNodeId(alert);
83574
83655
  return {
@@ -83602,6 +83683,7 @@ var ALERT_EPISODE = [
83602
83683
  "alert-error",
83603
83684
  "alert-critical-resolved"
83604
83685
  ];
83686
+ var DEVICE_ATTENTION = ["device-attention-required", "device-attention-resolved"];
83605
83687
  var UPDATES = [
83606
83688
  "addon-update-available",
83607
83689
  "server-update-available",
@@ -83631,9 +83713,12 @@ var DEVICE_EVENTS = [
83631
83713
  "stream-online",
83632
83714
  "stream-offline",
83633
83715
  "detection-blind",
83716
+ "motion-noisy",
83717
+ "motion-calm",
83634
83718
  "recording-stalled",
83635
83719
  "recording-healthy",
83636
83720
  "recording-degraded",
83721
+ ...DEVICE_ATTENTION,
83637
83722
  ...ALARM
83638
83723
  ];
83639
83724
  /** Every kind a summary may speak about — the two summarisable families. */
@@ -84207,7 +84292,36 @@ var NC_TEMPLATE_VARS = [
84207
84292
  families: ["rule"],
84208
84293
  fields: [...RULE_TEXT],
84209
84294
  kinds: ["system"],
84210
- systemEventKinds: ["detection-blind", "recording-stalled"]
84295
+ systemEventKinds: [
84296
+ "detection-blind",
84297
+ "motion-noisy",
84298
+ "motion-calm",
84299
+ "recording-stalled"
84300
+ ]
84301
+ },
84302
+ {
84303
+ name: "duty",
84304
+ label: "Motion share (%)",
84305
+ example: "55",
84306
+ group: "system",
84307
+ families: ["rule"],
84308
+ fields: [...RULE_TEXT],
84309
+ kinds: ["system"],
84310
+ systemEventKinds: ["motion-noisy", "motion-calm"]
84311
+ },
84312
+ {
84313
+ name: "sessions",
84314
+ label: "Detection sessions",
84315
+ example: "96",
84316
+ group: "system",
84317
+ families: ["rule"],
84318
+ fields: [...RULE_TEXT],
84319
+ kinds: ["system"],
84320
+ systemEventKinds: [
84321
+ "detection-blind",
84322
+ "motion-noisy",
84323
+ "motion-calm"
84324
+ ]
84211
84325
  },
84212
84326
  {
84213
84327
  name: "message",
@@ -84217,7 +84331,52 @@ var NC_TEMPLATE_VARS = [
84217
84331
  families: ["rule"],
84218
84332
  fields: [...RULE_TEXT],
84219
84333
  kinds: ["system"],
84220
- systemEventKinds: ["recording-degraded", ...ALERT_EPISODE]
84334
+ systemEventKinds: [
84335
+ "recording-degraded",
84336
+ ...DEVICE_ATTENTION,
84337
+ ...ALERT_EPISODE
84338
+ ]
84339
+ },
84340
+ {
84341
+ name: "ruleName",
84342
+ label: "Rule name",
84343
+ example: "Robot",
84344
+ group: "system",
84345
+ families: ["rule"],
84346
+ fields: [...RULE_TEXT],
84347
+ kinds: ["system"],
84348
+ systemEventKinds: ["rule-broken", "rule-repaired"]
84349
+ },
84350
+ {
84351
+ name: "ruleId",
84352
+ label: "Rule id",
84353
+ example: "3db3e226-9b82-4681-a200-de13b260aa48",
84354
+ group: "system",
84355
+ families: ["rule"],
84356
+ fields: [...RULE_TEXT],
84357
+ kinds: ["system"],
84358
+ systemEventKinds: ["rule-broken", "rule-repaired"]
84359
+ },
84360
+ {
84361
+ name: "brokenReason",
84362
+ label: "Why the rule is broken",
84363
+ description: "unparseable, device-deleted or target-deleted",
84364
+ example: "device-deleted",
84365
+ group: "system",
84366
+ families: ["rule"],
84367
+ fields: [...RULE_TEXT],
84368
+ kinds: ["system"],
84369
+ systemEventKinds: ["rule-broken"]
84370
+ },
84371
+ {
84372
+ name: "offendingIds",
84373
+ label: "Deleted devices or destinations",
84374
+ example: "4483",
84375
+ group: "system",
84376
+ families: ["rule"],
84377
+ fields: [...RULE_TEXT],
84378
+ kinds: ["system"],
84379
+ systemEventKinds: ["rule-broken"]
84221
84380
  },
84222
84381
  {
84223
84382
  name: "locationName",
@@ -84420,7 +84579,11 @@ var NC_TEMPLATE_VARS = [
84420
84579
  families: ["rule"],
84421
84580
  fields: [...RULE_TEXT],
84422
84581
  kinds: ["system"],
84423
- systemEventKinds: ["export-completed", ...ALERT_EPISODE]
84582
+ systemEventKinds: [
84583
+ "export-completed",
84584
+ ...DEVICE_ATTENTION,
84585
+ ...ALERT_EPISODE
84586
+ ]
84424
84587
  },
84425
84588
  {
84426
84589
  name: "severity",
@@ -84440,7 +84603,7 @@ var NC_TEMPLATE_VARS = [
84440
84603
  families: ["rule"],
84441
84604
  fields: [...RULE_TEXT],
84442
84605
  kinds: ["system"],
84443
- systemEventKinds: [...ALERT_EPISODE]
84606
+ systemEventKinds: [...DEVICE_ATTENTION, ...ALERT_EPISODE]
84444
84607
  },
84445
84608
  {
84446
84609
  name: "source",
@@ -84460,7 +84623,7 @@ var NC_TEMPLATE_VARS = [
84460
84623
  families: ["rule"],
84461
84624
  fields: [...RULE_TEXT],
84462
84625
  kinds: ["system"],
84463
- systemEventKinds: [...ALERT_EPISODE]
84626
+ systemEventKinds: [...DEVICE_ATTENTION, ...ALERT_EPISODE]
84464
84627
  },
84465
84628
  {
84466
84629
  name: "exportId",
@@ -84674,7 +84837,11 @@ var NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS = [
84674
84837
  "node-updating",
84675
84838
  "alert-critical",
84676
84839
  "alert-error",
84677
- "alert-critical-resolved"
84840
+ "alert-critical-resolved",
84841
+ "device-attention-required",
84842
+ "device-attention-resolved",
84843
+ "rule-broken",
84844
+ "rule-repaired"
84678
84845
  ];
84679
84846
  /**
84680
84847
  * The catalog as `getTemplateCatalog` SERVES it: every descriptor, with the
@@ -84779,6 +84946,185 @@ function templateVarsFor(ctx) {
84779
84946
  function isKnownTemplateVar(name, ctx) {
84780
84947
  return templateVarsFor(ctx).some((d) => d.dynamic !== void 0 ? name.startsWith(d.dynamic.prefix) && name.length > d.dynamic.prefix.length : d.name === name);
84781
84948
  }
84949
+ var CLASS_BY_KIND = new Map([
84950
+ {
84951
+ id: "device-connectivity",
84952
+ family: "device-events",
84953
+ label: "Device connectivity (offline / back online)",
84954
+ bad: ["device-offline"],
84955
+ recovery: ["device-online"],
84956
+ snapshotLabel: "Devices offline now",
84957
+ snapshotSection: "device-state"
84958
+ },
84959
+ {
84960
+ id: "device-switch",
84961
+ family: "device-events",
84962
+ label: "Device switched off / back on",
84963
+ bad: ["device-disabled"],
84964
+ recovery: ["device-enabled"],
84965
+ snapshotLabel: "Devices switched off now",
84966
+ snapshotSection: "device-state"
84967
+ },
84968
+ {
84969
+ id: "stream-connectivity",
84970
+ family: "device-events",
84971
+ label: "Stream connectivity (offline / back online)",
84972
+ bad: ["stream-offline"],
84973
+ recovery: ["stream-online"],
84974
+ snapshotLabel: "Streams offline now",
84975
+ snapshotSection: "streams"
84976
+ },
84977
+ {
84978
+ id: "battery",
84979
+ family: "device-events",
84980
+ label: "Battery (low / back to normal)",
84981
+ bad: ["device-battery-low"],
84982
+ recovery: ["device-battery-normal"],
84983
+ snapshotLabel: "Batteries low now",
84984
+ snapshotSection: "battery"
84985
+ },
84986
+ {
84987
+ id: "consumables",
84988
+ family: "device-events",
84989
+ label: "Consumables (low / replaced)",
84990
+ bad: ["device-consumable-low"],
84991
+ recovery: ["device-consumable-normal"],
84992
+ snapshotLabel: "Consumables low now",
84993
+ snapshotSection: "consumables"
84994
+ },
84995
+ {
84996
+ id: "tanks",
84997
+ family: "device-events",
84998
+ label: "Tanks (low or full / back to normal)",
84999
+ bad: ["device-tank-low", "device-tank-full"],
85000
+ recovery: ["device-tank-normal"],
85001
+ snapshotLabel: "Tanks low or full now",
85002
+ snapshotSection: "tanks"
85003
+ },
85004
+ {
85005
+ id: "motion-noise",
85006
+ family: "device-events",
85007
+ label: "Motion without a subject (constant / calm again)",
85008
+ bad: ["motion-noisy"],
85009
+ recovery: ["motion-calm"],
85010
+ snapshotLabel: "Cameras with constant motion now",
85011
+ snapshotSection: null
85012
+ },
85013
+ {
85014
+ id: "recording-health",
85015
+ family: "device-events",
85016
+ label: "Recording health (stalled or degraded / recording again)",
85017
+ bad: ["recording-stalled", "recording-degraded"],
85018
+ recovery: ["recording-healthy"],
85019
+ snapshotLabel: "Recordings stalled now",
85020
+ snapshotSection: null
85021
+ },
85022
+ {
85023
+ id: "device-attention",
85024
+ family: "device-events",
85025
+ label: "Device needs attention (raised / resolved)",
85026
+ bad: ["device-attention-required"],
85027
+ recovery: ["device-attention-resolved"],
85028
+ snapshotLabel: "Devices needing attention now",
85029
+ snapshotSection: null
85030
+ },
85031
+ {
85032
+ id: "node-connectivity",
85033
+ family: "system",
85034
+ label: "Node connectivity (offline / back online)",
85035
+ bad: ["node-offline"],
85036
+ recovery: ["node-online"],
85037
+ snapshotLabel: "Nodes offline now",
85038
+ snapshotSection: "nodes"
85039
+ },
85040
+ {
85041
+ id: "storage-space",
85042
+ family: "system",
85043
+ label: "Storage space (low or critical / ok again)",
85044
+ bad: ["storage-location-low", "storage-location-critical"],
85045
+ recovery: ["storage-location-ok"],
85046
+ snapshotLabel: "Storage locations low now",
85047
+ snapshotSection: null
85048
+ },
85049
+ {
85050
+ id: "critical-alerts",
85051
+ family: "system",
85052
+ label: "Critical alerts (raised / resolved)",
85053
+ bad: ["alert-critical"],
85054
+ recovery: ["alert-critical-resolved"],
85055
+ snapshotLabel: "Critical alerts open now",
85056
+ snapshotSection: null
85057
+ },
85058
+ {
85059
+ id: "rule-health",
85060
+ family: "system",
85061
+ label: "Rule health (broken / repaired)",
85062
+ bad: ["rule-broken"],
85063
+ recovery: ["rule-repaired"],
85064
+ snapshotLabel: "Notification rules broken now",
85065
+ snapshotSection: null
85066
+ }
85067
+ ].flatMap((spec) => [...spec.bad, ...spec.recovery].map((kind) => [kind, spec])));
85068
+ /** The class a kind belongs to, or `undefined` for a one-edge kind. */
85069
+ function systemEventClassOf(kind) {
85070
+ return CLASS_BY_KIND.get(kind);
85071
+ }
85072
+ /**
85073
+ * A kind list with the OTHER front of every class it touches: a bad edge
85074
+ * brings the class's recovery, a recovery brings the class's bad edges. A
85075
+ * sibling bad edge is never added by a bad edge — a rule on
85076
+ * `storage-location-critical` does not start hearing `storage-location-low`.
85077
+ * Input order is kept, each added edge right after the kind that brought it.
85078
+ * Kinds of no class (and legacy names) pass through.
85079
+ */
85080
+ function expandSystemEventClasses(kinds) {
85081
+ const out = [];
85082
+ const seen = /* @__PURE__ */ new Set();
85083
+ const push = (kind) => {
85084
+ if (seen.has(kind)) return;
85085
+ seen.add(kind);
85086
+ out.push(kind);
85087
+ };
85088
+ const listed = new Set(kinds);
85089
+ for (const kind of kinds) {
85090
+ push(kind);
85091
+ const spec = systemEventClassOf(kind);
85092
+ if (spec === void 0) continue;
85093
+ const hasBad = spec.bad.some((k) => listed.has(k));
85094
+ if (spec.bad.some((k) => k === kind)) for (const edge of spec.recovery) push(edge);
85095
+ else if (!hasBad) for (const edge of spec.bad) push(edge);
85096
+ }
85097
+ return out;
85098
+ }
85099
+ /** Does this rule speak per EVENT (not a scheduled summary)? */
85100
+ function isInstantSystemRule(rule) {
85101
+ if (rule.delivery !== "system-event") return false;
85102
+ return rule.systemEventDelivery?.mode !== "summary";
85103
+ }
85104
+ /**
85105
+ * An INSTANT system rule with each class it touches completed with both edges;
85106
+ * the rule itself (same object) when there is nothing to add, a summary rule,
85107
+ * or a rule spanning families (`mixed` stays read-only, D637). A copy, never a
85108
+ * mutation.
85109
+ */
85110
+ function withSystemEventClasses(rule) {
85111
+ const condition = rule.conditions.systemEvent;
85112
+ if (condition === void 0 || !isInstantSystemRule(rule)) return rule;
85113
+ const families = new Set(condition.kinds.map((kind) => NC_SYSTEM_EVENT_FAMILY[kind]));
85114
+ if (families.size !== 1 || families.has(null)) return rule;
85115
+ const kinds = expandSystemEventClasses(condition.kinds);
85116
+ if (kinds.length === condition.kinds.length) return rule;
85117
+ return {
85118
+ ...rule,
85119
+ conditions: {
85120
+ ...rule.conditions,
85121
+ systemEvent: {
85122
+ ...condition,
85123
+ kinds
85124
+ }
85125
+ }
85126
+ };
85127
+ }
84782
85128
  /** The families a rule may summarise. The alarm is not one of them. */
84783
85129
  var NC_SYSTEM_EVENT_SUMMARY_FAMILIES = ["device-events", "system"];
84784
85130
  /** The summary's schedule, or `null` for any rule that is not a summary system rule. */
@@ -86832,6 +87178,12 @@ Object.defineProperty(exports, "FailureCounters", {
86832
87178
  return FailureCounters;
86833
87179
  }
86834
87180
  });
87181
+ Object.defineProperty(exports, "InvalidRecordError", {
87182
+ enumerable: true,
87183
+ get: function() {
87184
+ return InvalidRecordError;
87185
+ }
87186
+ });
86835
87187
  Object.defineProperty(exports, "LABEL_SUPPLY_MACRO", {
86836
87188
  enumerable: true,
86837
87189
  get: function() {
@@ -87672,6 +88024,12 @@ Object.defineProperty(exports, "describeSystemEventFamilyProblem", {
87672
88024
  return describeSystemEventFamilyProblem;
87673
88025
  }
87674
88026
  });
88027
+ Object.defineProperty(exports, "deviceAttentionKind", {
88028
+ enumerable: true,
88029
+ get: function() {
88030
+ return deviceAttentionKind;
88031
+ }
88032
+ });
87675
88033
  Object.defineProperty(exports, "deviceRemovalHookCapability", {
87676
88034
  enumerable: true,
87677
88035
  get: function() {
@@ -88314,6 +88672,12 @@ Object.defineProperty(exports, "viewerLinkBaseOf", {
88314
88672
  return viewerLinkBaseOf;
88315
88673
  }
88316
88674
  });
88675
+ Object.defineProperty(exports, "withSystemEventClasses", {
88676
+ enumerable: true,
88677
+ get: function() {
88678
+ return withSystemEventClasses;
88679
+ }
88680
+ });
88317
88681
  Object.defineProperty(exports, "zoneAnalyticsCapability", {
88318
88682
  enumerable: true,
88319
88683
  get: function() {