@camstack/types 1.2.397 → 1.2.399

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 (40) hide show
  1. package/dist/addon.js +17 -2
  2. package/dist/addon.mjs +15 -3
  3. package/dist/capabilities/dishwasher.cap.d.ts +9 -0
  4. package/dist/capabilities/index.d.ts +2 -2
  5. package/dist/capabilities/notification-rules.cap.d.ts +92 -0
  6. package/dist/capabilities/osd-manager.cap.d.ts +24 -0
  7. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +0 -16
  8. package/dist/capabilities/records.cap.d.ts +67 -3
  9. package/dist/capabilities/storage-admin.cap.d.ts +0 -2
  10. package/dist/capabilities/user-management.cap.d.ts +2 -28
  11. package/dist/client.js +88 -9
  12. package/dist/client.mjs +88 -9
  13. package/dist/enums/event-category.d.ts +9 -0
  14. package/dist/enums.js +1 -1
  15. package/dist/enums.mjs +1 -1
  16. package/dist/{event-category-kpu1bZMs.js → event-category-7AwNbPjm.js} +9 -0
  17. package/dist/{event-category-7pZEBmVg.mjs → event-category-BfJwUd2S.mjs} +9 -0
  18. package/dist/generated/addon-api.d.ts +7 -14
  19. package/dist/generated/addon-cap-facts.d.ts +1 -1
  20. package/dist/generated/method-access-map.d.ts +1 -1
  21. package/dist/generated/system-proxy.d.ts +1 -1
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +305 -135
  24. package/dist/index.mjs +300 -134
  25. package/dist/interfaces/auth.d.ts +1 -1
  26. package/dist/interfaces/event-bus.d.ts +24 -5
  27. package/dist/notification/alert-episode.d.ts +7 -0
  28. package/dist/pipeline/auto-tune/detector-performance.d.ts +2 -1
  29. package/dist/pipeline/auto-tune/plan-schemas.d.ts +0 -28
  30. package/dist/pipeline/auto-tune/recommend.d.ts +9 -1
  31. package/dist/pipeline/load-balancing/share-election.d.ts +7 -0
  32. package/dist/records/errors.d.ts +9 -1
  33. package/dist/records/index.d.ts +1 -0
  34. package/dist/records/record-kind.d.ts +62 -2
  35. package/dist/records/records-access.d.ts +36 -1
  36. package/dist/records/transact-rules.d.ts +7 -0
  37. package/dist/schemas/auth-records.d.ts +0 -12
  38. package/dist/{sleep-Bo7fq491.js → sleep-CD18m9HF.js} +478 -311
  39. package/dist/{sleep-CueztlR1.mjs → sleep-DJFUfKvA.mjs} +461 -312
  40. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-Bo7fq491.js");
3
- const require_event_category = require("./event-category-kpu1bZMs.js");
2
+ const require_sleep = require("./sleep-CD18m9HF.js");
3
+ const require_event_category = require("./event-category-7AwNbPjm.js");
4
4
  const require_composition = require("./composition-eoYYVfOp.js");
5
5
  const require_node_color = require("./node-color.js");
6
6
  const require_err_msg = require("./err-msg-BhVbr0NX.js");
@@ -6812,17 +6812,6 @@ var UserRecordSchema = zod.z.object({
6812
6812
  createdAt: zod.z.number(),
6813
6813
  updatedAt: zod.z.number()
6814
6814
  });
6815
- var ApiKeyRecordSchema = zod.z.object({
6816
- id: zod.z.string(),
6817
- label: zod.z.string(),
6818
- isAdmin: zod.z.boolean().default(false),
6819
- allowedProviders: AllowedProviderSchema,
6820
- allowedDevices: AllowedDevicesSchema,
6821
- tokenHash: zod.z.string(),
6822
- tokenPrefix: zod.z.string(),
6823
- createdAt: zod.z.number(),
6824
- lastUsedAt: zod.z.number().optional()
6825
- });
6826
6815
  var ScopedTokenSchema = zod.z.object({
6827
6816
  id: zod.z.string(),
6828
6817
  userId: zod.z.string(),
@@ -14502,16 +14491,36 @@ var RecordKindStateSchema = zod.z.enum([
14502
14491
  var DeclareKindResultSchema = zod.z.object({
14503
14492
  kindId: zod.z.number().int(),
14504
14493
  state: RecordKindStateSchema,
14505
- createdIndexes: zod.z.array(zod.z.string()),
14506
- /**
14507
- * RETIRED (D900): always `null`. It carried the records-migration boot guard;
14508
- * it stays on the wire, null, because an addon built before the removal reads
14509
- * an ABSENT field as "adoption pending" and refuses to start.
14510
- */
14511
- adoptionPending: zod.z.null()
14494
+ createdIndexes: zod.z.array(zod.z.string())
14512
14495
  });
14513
14496
  /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
14514
14497
  var SecretRefsList = zod.z.array(zod.z.string());
14498
+ /**
14499
+ * One op of a `transact`: the single-row writes, each on a kind of the caller.
14500
+ * All ops of one call share ONE database file and ONE `transactFamily`.
14501
+ */
14502
+ var RecordTransactOpSchema = zod.z.discriminatedUnion("op", [
14503
+ zod.z.object({
14504
+ op: zod.z.literal("put"),
14505
+ kind: require_sleep.RecordKindNameSchema,
14506
+ record: RecordInputSchema,
14507
+ ifRev: zod.z.number().int().min(0).optional()
14508
+ }),
14509
+ zod.z.object({
14510
+ op: zod.z.literal("patch"),
14511
+ kind: require_sleep.RecordKindNameSchema,
14512
+ id: RecordIdSchema,
14513
+ data: RecordBodySchema,
14514
+ at: zod.z.number().int().nullable().optional(),
14515
+ expiresAt: zod.z.number().int().nullable().optional(),
14516
+ ifRev: zod.z.number().int().min(1).optional()
14517
+ }),
14518
+ zod.z.object({
14519
+ op: zod.z.literal("delete"),
14520
+ kind: require_sleep.RecordKindNameSchema,
14521
+ id: RecordIdSchema
14522
+ })
14523
+ ]);
14515
14524
  var RecordSecretRefsSchema = zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.string()));
14516
14525
  var recordsCapability = {
14517
14526
  name: "records",
@@ -14643,6 +14652,22 @@ var recordsCapability = {
14643
14652
  kind: "mutation",
14644
14653
  auth: "admin"
14645
14654
  }),
14655
+ /**
14656
+ * Several single-row writes (put / patch / delete) in ONE SQLite transaction:
14657
+ * all land or none does. Every op's kind must sit in one file and share one
14658
+ * `transactFamily` (`records/transact-refused` otherwise). Results are in op order.
14659
+ */
14660
+ transact: require_sleep.method(zod.z.object({ ops: zod.z.array(RecordTransactOpSchema).min(1).max(require_sleep.RECORD_BATCH_MAX) }), zod.z.object({
14661
+ results: zod.z.array(zod.z.object({
14662
+ rev: zod.z.number().int().nullable(),
14663
+ deleted: zod.z.boolean()
14664
+ })),
14665
+ releasedRefs: SecretRefsList,
14666
+ secretRefs: SecretRefsList
14667
+ }), {
14668
+ kind: "mutation",
14669
+ auth: "admin"
14670
+ }),
14646
14671
  /** The D865 hook body: every kind of this addon declared `deviceRemoval: 'delete'`. */
14647
14672
  deleteDevice: require_sleep.method(zod.z.object({
14648
14673
  deviceId: zod.z.number().int(),
@@ -43434,9 +43459,13 @@ var NcSystemEventKindSchema = zod.z.enum([
43434
43459
  "node-updating",
43435
43460
  "node-inference-unavailable",
43436
43461
  "detection-blind",
43462
+ "motion-noisy",
43463
+ "motion-calm",
43437
43464
  "recording-stalled",
43438
43465
  "recording-healthy",
43439
43466
  "recording-degraded",
43467
+ "device-attention-required",
43468
+ "device-attention-resolved",
43440
43469
  "storage-location-low",
43441
43470
  "storage-location-critical",
43442
43471
  "storage-location-ok",
@@ -45073,6 +45102,14 @@ var NC_CONDITION_CATALOG = [
45073
45102
  value: "detection-blind",
45074
45103
  label: "Camera detecting nothing"
45075
45104
  },
45105
+ {
45106
+ value: "motion-noisy",
45107
+ label: "Camera motion constant, no subject"
45108
+ },
45109
+ {
45110
+ value: "motion-calm",
45111
+ label: "Camera motion calm again"
45112
+ },
45076
45113
  {
45077
45114
  value: "recording-stalled",
45078
45115
  label: "Recording stalled"
@@ -45085,6 +45122,14 @@ var NC_CONDITION_CATALOG = [
45085
45122
  value: "recording-degraded",
45086
45123
  label: "Recording degraded (restart storm)"
45087
45124
  },
45125
+ {
45126
+ value: "device-attention-required",
45127
+ label: "Device needs attention"
45128
+ },
45129
+ {
45130
+ value: "device-attention-resolved",
45131
+ label: "Device attention resolved"
45132
+ },
45088
45133
  {
45089
45134
  value: "storage-location-low",
45090
45135
  label: "Storage location low"
@@ -51287,7 +51332,6 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
51287
51332
  modelId: zod.z.string()
51288
51333
  }),
51289
51334
  zod.z.object({ kind: zod.z.literal("cpu-device") }),
51290
- zod.z.object({ kind: zod.z.literal("coral-untouched") }),
51291
51335
  zod.z.object({ kind: zod.z.literal("device-disabled") }),
51292
51336
  zod.z.object({ kind: zod.z.literal("device-unavailable") }),
51293
51337
  zod.z.object({ kind: zod.z.literal("node-offline") }),
@@ -51385,11 +51429,6 @@ var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
51385
51429
  kind: zod.z.literal("detector-store-unreadable"),
51386
51430
  error: zod.z.string()
51387
51431
  }),
51388
- zod.z.object({
51389
- kind: zod.z.literal("coral-enabled"),
51390
- nodeId: zod.z.string(),
51391
- deviceKey: zod.z.string()
51392
- }),
51393
51432
  zod.z.object({
51394
51433
  kind: zod.z.literal("custom-pin-kept"),
51395
51434
  nodeId: zod.z.string(),
@@ -61853,6 +61892,16 @@ var DishwasherStatusSchema = zod.z.object({
61853
61892
  powerState: zod.z.string().nullable(),
61854
61893
  saltLevel: DishwasherConsumableLevelSchema.nullable(),
61855
61894
  rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
61895
+ /**
61896
+ * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
61897
+ * combined care-and-filter reminder raised); false when every such reminder reads clear; null
61898
+ * when none is reported. A cleared reminder is not an unknown one.
61899
+ */
61900
+ filterCleaningDue: zod.z.boolean().nullable(),
61901
+ /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
61902
+ machineCareDue: zod.z.boolean().nullable(),
61903
+ /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
61904
+ machineCareRemainingRuns: zod.z.number().int().nonnegative().nullable(),
61856
61905
  /** Option states: null when the appliance does not expose the option or has not said. */
61857
61906
  halfLoad: zod.z.boolean().nullable(),
61858
61907
  hygienePlus: zod.z.boolean().nullable(),
@@ -72887,16 +72936,6 @@ var UpdateUserInputSchema = zod.z.object({
72887
72936
  allowedDevices: zod.z.record(zod.z.string(), zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")])).optional(),
72888
72937
  scopes: zod.z.array(TokenScopeSchema).optional()
72889
72938
  });
72890
- var ApiKeySummarySchema = zod.z.object({
72891
- id: zod.z.string(),
72892
- label: zod.z.string(),
72893
- isAdmin: zod.z.boolean().default(false),
72894
- allowedProviders: zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")]).optional(),
72895
- allowedDevices: zod.z.record(zod.z.string(), zod.z.union([zod.z.array(zod.z.string()), zod.z.literal("*")])).optional(),
72896
- tokenPrefix: zod.z.string(),
72897
- createdAt: zod.z.number(),
72898
- lastUsedAt: zod.z.number().optional()
72899
- });
72900
72939
  var OauthSessionSummarySchema = zod.z.object({
72901
72940
  id: zod.z.string(),
72902
72941
  userId: zod.z.string(),
@@ -72918,8 +72957,7 @@ var TotpStatusSchema = zod.z.object({
72918
72957
  confirmedAt: zod.z.number().nullable()
72919
72958
  });
72920
72959
  /**
72921
- * user-management — singleton capability for user accounts and the
72922
- * legacy API-key rows.
72960
+ * user-management — singleton capability for user accounts.
72923
72961
  *
72924
72962
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
72925
72963
  * — the subset check on `setUserScopes` is moot
@@ -72987,12 +73025,6 @@ var userManagementCapability = {
72987
73025
  kind: "mutation",
72988
73026
  access: "view"
72989
73027
  }),
72990
- listApiKeys: require_sleep.method(zod.z.void(), zod.z.array(ApiKeySummarySchema), { auth: "admin" }),
72991
- revokeApiKey: require_sleep.method(zod.z.object({ id: zod.z.string() }), zod.z.object({ success: zod.z.literal(true) }), {
72992
- kind: "mutation",
72993
- auth: "admin",
72994
- access: "delete"
72995
- }),
72996
73028
  setupTotp: require_sleep.method(zod.z.object({ userId: zod.z.string() }), TotpSetupResultSchema, {
72997
73029
  kind: "mutation",
72998
73030
  auth: "admin",
@@ -84597,6 +84629,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
84597
84629
  addonId: null,
84598
84630
  access: "view"
84599
84631
  },
84632
+ "records.transact": {
84633
+ capName: "records",
84634
+ capScope: "system",
84635
+ addonId: null,
84636
+ access: "create"
84637
+ },
84600
84638
  "sceneMonitor.captureReference": {
84601
84639
  capName: "scene-monitor",
84602
84640
  capScope: "device",
@@ -85929,12 +85967,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
85929
85967
  addonId: null,
85930
85968
  access: "view"
85931
85969
  },
85932
- "userManagement.listApiKeys": {
85933
- capName: "user-management",
85934
- capScope: "system",
85935
- addonId: null,
85936
- access: "view"
85937
- },
85938
85970
  "userManagement.listExternalIdentities": {
85939
85971
  capName: "user-management",
85940
85972
  capScope: "system",
@@ -85989,12 +86021,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
85989
86021
  addonId: null,
85990
86022
  access: "create"
85991
86023
  },
85992
- "userManagement.revokeApiKey": {
85993
- capName: "user-management",
85994
- capScope: "system",
85995
- addonId: null,
85996
- access: "delete"
85997
- },
85998
86024
  "userManagement.revokeOauthSession": {
85999
86025
  capName: "user-management",
86000
86026
  capScope: "system",
@@ -94564,8 +94590,6 @@ function createSystemProxy(api) {
94564
94590
  resetPassword: (input) => dispatch("userManagement", "resetPassword", "mutation", input),
94565
94591
  setUserScopes: (input) => dispatch("userManagement", "setUserScopes", "mutation", input),
94566
94592
  validateCredentials: (input) => dispatch("userManagement", "validateCredentials", "mutation", input),
94567
- listApiKeys: (input) => dispatch("userManagement", "listApiKeys", "query", input),
94568
- revokeApiKey: (input) => dispatch("userManagement", "revokeApiKey", "mutation", input),
94569
94593
  setupTotp: (input) => dispatch("userManagement", "setupTotp", "mutation", input),
94570
94594
  confirmTotp: (input) => dispatch("userManagement", "confirmTotp", "mutation", input),
94571
94595
  disableTotp: (input) => dispatch("userManagement", "disableTotp", "mutation", input),
@@ -95411,8 +95435,8 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
95411
95435
  */
95412
95436
  function systemEventFilterApplies(kind, filter) {
95413
95437
  switch (filter) {
95414
- case "deviceIds": return kind.startsWith("device-") || kind.startsWith("stream-") || kind === "detection-blind" || kind.startsWith("recording-") || kind === "alarm-triggered";
95415
- case "deviceTypes": return kind.startsWith("device-") || kind === "detection-blind";
95438
+ case "deviceIds": return kind.startsWith("device-") || kind.startsWith("stream-") || kind === "detection-blind" || kind.startsWith("motion-") || kind.startsWith("recording-") || kind === "alarm-triggered";
95439
+ case "deviceTypes": return kind.startsWith("device-") || kind === "detection-blind" || kind.startsWith("motion-");
95416
95440
  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-");
95417
95441
  case "packageNames": return kind.endsWith("update-available") || kind === "addon-updated" || kind === "node-updating" || kind === "server-updated";
95418
95442
  case "consumableLowPercent": return NC_CONSUMABLE_SYSTEM_EVENT_KINDS.includes(kind);
@@ -95470,9 +95494,13 @@ var NC_SYSTEM_EVENT_FAMILY = {
95470
95494
  "stream-online": "device-events",
95471
95495
  "stream-offline": "device-events",
95472
95496
  "detection-blind": "device-events",
95497
+ "motion-noisy": "device-events",
95498
+ "motion-calm": "device-events",
95473
95499
  "recording-stalled": "device-events",
95474
95500
  "recording-healthy": "device-events",
95475
95501
  "recording-degraded": "device-events",
95502
+ "device-attention-required": "device-events",
95503
+ "device-attention-resolved": "device-events",
95476
95504
  "node-online": "system",
95477
95505
  "node-offline": "system",
95478
95506
  "node-restarting": "system",
@@ -95573,6 +95601,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
95573
95601
  label: "Detecting nothing",
95574
95602
  kinds: ["detection-blind"]
95575
95603
  },
95604
+ {
95605
+ id: "motion-noise",
95606
+ family: "device-events",
95607
+ label: "Motion without a subject",
95608
+ kinds: ["motion-noisy", "motion-calm"]
95609
+ },
95576
95610
  {
95577
95611
  id: "recording",
95578
95612
  family: "device-events",
@@ -95583,6 +95617,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
95583
95617
  "recording-degraded"
95584
95618
  ]
95585
95619
  },
95620
+ {
95621
+ id: "device-attention",
95622
+ family: "device-events",
95623
+ label: "Needs attention",
95624
+ kinds: ["device-attention-required", "device-attention-resolved"]
95625
+ },
95586
95626
  {
95587
95627
  id: "nodes",
95588
95628
  family: "system",
@@ -97416,6 +97456,16 @@ function alertEpisodeKind(severity, phase) {
97416
97456
  if (severity === "error" && phase === "raised") return "alert-error";
97417
97457
  return null;
97418
97458
  }
97459
+ /**
97460
+ * The kind of a CRITICAL episode edge about a DEVICE (D911): the alert's source
97461
+ * is `device`, so it is announced in the devices family as
97462
+ * `device-attention-required` / `-resolved` INSTEAD of `alert-critical`. One
97463
+ * alert notifies once, through one family. `null` for any other severity.
97464
+ */
97465
+ function deviceAttentionKind(severity, phase) {
97466
+ if (severity !== "critical") return null;
97467
+ return phase === "raised" ? "device-attention-required" : "device-attention-resolved";
97468
+ }
97419
97469
  function alertEpisodePayload(alert, phase, at) {
97420
97470
  const nodeId = alertNodeId(alert);
97421
97471
  return {
@@ -97451,6 +97501,7 @@ var ALERT_EPISODE = [
97451
97501
  "alert-error",
97452
97502
  "alert-critical-resolved"
97453
97503
  ];
97504
+ var DEVICE_ATTENTION = ["device-attention-required", "device-attention-resolved"];
97454
97505
  var UPDATES = [
97455
97506
  "addon-update-available",
97456
97507
  "server-update-available",
@@ -97480,9 +97531,12 @@ var DEVICE_EVENTS = [
97480
97531
  "stream-online",
97481
97532
  "stream-offline",
97482
97533
  "detection-blind",
97534
+ "motion-noisy",
97535
+ "motion-calm",
97483
97536
  "recording-stalled",
97484
97537
  "recording-healthy",
97485
97538
  "recording-degraded",
97539
+ ...DEVICE_ATTENTION,
97486
97540
  ...ALARM
97487
97541
  ];
97488
97542
  /** Every kind a summary may speak about — the two summarisable families. */
@@ -98056,7 +98110,36 @@ var NC_TEMPLATE_VARS = [
98056
98110
  families: ["rule"],
98057
98111
  fields: [...RULE_TEXT],
98058
98112
  kinds: ["system"],
98059
- systemEventKinds: ["detection-blind", "recording-stalled"]
98113
+ systemEventKinds: [
98114
+ "detection-blind",
98115
+ "motion-noisy",
98116
+ "motion-calm",
98117
+ "recording-stalled"
98118
+ ]
98119
+ },
98120
+ {
98121
+ name: "duty",
98122
+ label: "Motion share (%)",
98123
+ example: "55",
98124
+ group: "system",
98125
+ families: ["rule"],
98126
+ fields: [...RULE_TEXT],
98127
+ kinds: ["system"],
98128
+ systemEventKinds: ["motion-noisy", "motion-calm"]
98129
+ },
98130
+ {
98131
+ name: "sessions",
98132
+ label: "Detection sessions",
98133
+ example: "96",
98134
+ group: "system",
98135
+ families: ["rule"],
98136
+ fields: [...RULE_TEXT],
98137
+ kinds: ["system"],
98138
+ systemEventKinds: [
98139
+ "detection-blind",
98140
+ "motion-noisy",
98141
+ "motion-calm"
98142
+ ]
98060
98143
  },
98061
98144
  {
98062
98145
  name: "message",
@@ -98066,7 +98149,11 @@ var NC_TEMPLATE_VARS = [
98066
98149
  families: ["rule"],
98067
98150
  fields: [...RULE_TEXT],
98068
98151
  kinds: ["system"],
98069
- systemEventKinds: ["recording-degraded", ...ALERT_EPISODE]
98152
+ systemEventKinds: [
98153
+ "recording-degraded",
98154
+ ...DEVICE_ATTENTION,
98155
+ ...ALERT_EPISODE
98156
+ ]
98070
98157
  },
98071
98158
  {
98072
98159
  name: "ruleName",
@@ -98310,7 +98397,11 @@ var NC_TEMPLATE_VARS = [
98310
98397
  families: ["rule"],
98311
98398
  fields: [...RULE_TEXT],
98312
98399
  kinds: ["system"],
98313
- systemEventKinds: ["export-completed", ...ALERT_EPISODE]
98400
+ systemEventKinds: [
98401
+ "export-completed",
98402
+ ...DEVICE_ATTENTION,
98403
+ ...ALERT_EPISODE
98404
+ ]
98314
98405
  },
98315
98406
  {
98316
98407
  name: "severity",
@@ -98330,7 +98421,7 @@ var NC_TEMPLATE_VARS = [
98330
98421
  families: ["rule"],
98331
98422
  fields: [...RULE_TEXT],
98332
98423
  kinds: ["system"],
98333
- systemEventKinds: [...ALERT_EPISODE]
98424
+ systemEventKinds: [...DEVICE_ATTENTION, ...ALERT_EPISODE]
98334
98425
  },
98335
98426
  {
98336
98427
  name: "source",
@@ -98350,7 +98441,7 @@ var NC_TEMPLATE_VARS = [
98350
98441
  families: ["rule"],
98351
98442
  fields: [...RULE_TEXT],
98352
98443
  kinds: ["system"],
98353
- systemEventKinds: [...ALERT_EPISODE]
98444
+ systemEventKinds: [...DEVICE_ATTENTION, ...ALERT_EPISODE]
98354
98445
  },
98355
98446
  {
98356
98447
  name: "exportId",
@@ -98565,6 +98656,8 @@ var NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS = [
98565
98656
  "alert-critical",
98566
98657
  "alert-error",
98567
98658
  "alert-critical-resolved",
98659
+ "device-attention-required",
98660
+ "device-attention-resolved",
98568
98661
  "rule-broken",
98569
98662
  "rule-repaired"
98570
98663
  ];
@@ -98728,6 +98821,15 @@ var NC_SYSTEM_EVENT_CLASS_SPECS = [
98728
98821
  snapshotLabel: "Tanks low or full now",
98729
98822
  snapshotSection: "tanks"
98730
98823
  },
98824
+ {
98825
+ id: "motion-noise",
98826
+ family: "device-events",
98827
+ label: "Motion without a subject (constant / calm again)",
98828
+ bad: ["motion-noisy"],
98829
+ recovery: ["motion-calm"],
98830
+ snapshotLabel: "Cameras with constant motion now",
98831
+ snapshotSection: null
98832
+ },
98731
98833
  {
98732
98834
  id: "recording-health",
98733
98835
  family: "device-events",
@@ -98737,6 +98839,15 @@ var NC_SYSTEM_EVENT_CLASS_SPECS = [
98737
98839
  snapshotLabel: "Recordings stalled now",
98738
98840
  snapshotSection: null
98739
98841
  },
98842
+ {
98843
+ id: "device-attention",
98844
+ family: "device-events",
98845
+ label: "Device needs attention (raised / resolved)",
98846
+ bad: ["device-attention-required"],
98847
+ recovery: ["device-attention-resolved"],
98848
+ snapshotLabel: "Devices needing attention now",
98849
+ snapshotSection: null
98850
+ },
98740
98851
  {
98741
98852
  id: "node-connectivity",
98742
98853
  family: "system",
@@ -100598,7 +100709,12 @@ var DETECTOR_PERF = {
100598
100709
  fps: 19,
100599
100710
  measured: true
100600
100711
  }
100601
- }
100712
+ },
100713
+ coral: { "yolov9s-320-edgetpu": {
100714
+ p50Ms: 32,
100715
+ fps: 31,
100716
+ measured: false
100717
+ } }
100602
100718
  },
100603
100719
  "intel-n-series": {
100604
100720
  "intel-igpu": {
@@ -100724,7 +100840,12 @@ var DETECTOR_PERF = {
100724
100840
  fps: 3,
100725
100841
  measured: true
100726
100842
  }
100727
- }
100843
+ },
100844
+ coral: { "yolov9s-320-edgetpu": {
100845
+ p50Ms: 32,
100846
+ fps: 31,
100847
+ measured: false
100848
+ } }
100728
100849
  },
100729
100850
  "amd-phoenix": {
100730
100851
  "x86-cpu": {
@@ -100815,72 +100936,91 @@ var DETECTOR_PERF = {
100815
100936
  fps: 1,
100816
100937
  measured: true
100817
100938
  }
100818
- }
100819
- },
100820
- "apple-m-pro": { "apple-ane": {
100821
- "yolov9t-320": {
100822
- p50Ms: 1.1,
100823
- fps: 952,
100824
- measured: true
100825
- },
100826
- "yolov9t-640": {
100827
- p50Ms: 3,
100828
- fps: 333,
100829
- measured: true
100830
100939
  },
100831
- "yolov9s-320": {
100832
- p50Ms: 1.5,
100833
- fps: 667,
100834
- measured: true
100835
- },
100836
- "yolov9s-640": {
100837
- p50Ms: 5.1,
100838
- fps: 196,
100839
- measured: true
100840
- },
100841
- "yolov9m-320": {
100842
- p50Ms: 3.2,
100843
- fps: 312,
100940
+ coral: { "yolov9s-320-edgetpu": {
100941
+ p50Ms: 32,
100942
+ fps: 31,
100844
100943
  measured: true
100944
+ } }
100945
+ },
100946
+ "apple-m-pro": {
100947
+ "apple-ane": {
100948
+ "yolov9t-320": {
100949
+ p50Ms: 1.1,
100950
+ fps: 952,
100951
+ measured: true
100952
+ },
100953
+ "yolov9t-640": {
100954
+ p50Ms: 3,
100955
+ fps: 333,
100956
+ measured: true
100957
+ },
100958
+ "yolov9s-320": {
100959
+ p50Ms: 1.5,
100960
+ fps: 667,
100961
+ measured: true
100962
+ },
100963
+ "yolov9s-640": {
100964
+ p50Ms: 5.1,
100965
+ fps: 196,
100966
+ measured: true
100967
+ },
100968
+ "yolov9m-320": {
100969
+ p50Ms: 3.2,
100970
+ fps: 312,
100971
+ measured: true
100972
+ },
100973
+ "yolov9m-640": {
100974
+ p50Ms: 10.2,
100975
+ fps: 98,
100976
+ measured: true
100977
+ }
100845
100978
  },
100846
- "yolov9m-640": {
100847
- p50Ms: 10.2,
100848
- fps: 98,
100849
- measured: true
100850
- }
100851
- } },
100852
- "apple-m-base": { "apple-ane": {
100853
- "yolov9t-320": {
100854
- p50Ms: 1.32,
100855
- fps: 758,
100979
+ coral: { "yolov9s-320-edgetpu": {
100980
+ p50Ms: 32,
100981
+ fps: 31,
100856
100982
  measured: false
100983
+ } }
100984
+ },
100985
+ "apple-m-base": {
100986
+ "apple-ane": {
100987
+ "yolov9t-320": {
100988
+ p50Ms: 1.32,
100989
+ fps: 758,
100990
+ measured: false
100991
+ },
100992
+ "yolov9t-640": {
100993
+ p50Ms: 3.45,
100994
+ fps: 290,
100995
+ measured: true
100996
+ },
100997
+ "yolov9s-320": {
100998
+ p50Ms: 1.8,
100999
+ fps: 556,
101000
+ measured: false
101001
+ },
101002
+ "yolov9s-640": {
101003
+ p50Ms: 5.46,
101004
+ fps: 183,
101005
+ measured: true
101006
+ },
101007
+ "yolov9m-320": {
101008
+ p50Ms: 3.79,
101009
+ fps: 264,
101010
+ measured: true
101011
+ },
101012
+ "yolov9m-640": {
101013
+ p50Ms: 10.34,
101014
+ fps: 97,
101015
+ measured: true
101016
+ }
100857
101017
  },
100858
- "yolov9t-640": {
100859
- p50Ms: 3.45,
100860
- fps: 290,
100861
- measured: true
100862
- },
100863
- "yolov9s-320": {
100864
- p50Ms: 1.8,
100865
- fps: 556,
101018
+ coral: { "yolov9s-320-edgetpu": {
101019
+ p50Ms: 32,
101020
+ fps: 31,
100866
101021
  measured: false
100867
- },
100868
- "yolov9s-640": {
100869
- p50Ms: 5.46,
100870
- fps: 183,
100871
- measured: true
100872
- },
100873
- "yolov9m-320": {
100874
- p50Ms: 3.79,
100875
- fps: 264,
100876
- measured: true
100877
- },
100878
- "yolov9m-640": {
100879
- p50Ms: 10.34,
100880
- fps: 97,
100881
- measured: true
100882
- }
100883
- } }
101022
+ } }
101023
+ }
100884
101024
  };
100885
101025
  var DETECTOR_ACCURACY = {
100886
101026
  "yolov9m-320": {
@@ -100936,6 +101076,11 @@ var DETECTOR_ACCURACY = {
100936
101076
  //#region src/pipeline/auto-tune/recommend.ts
100937
101077
  /** The family the cluster runs. */
100938
101078
  var AUTO_TUNE_FAMILY = "yolov9";
101079
+ /**
101080
+ * The model a Coral runs by default (D908) and the only one Auto tune sizes it
101081
+ * at (D912). Auto tune never enables a device; it sizes the enabled ones.
101082
+ */
101083
+ var CORAL_DEFAULT_MODEL_ID = "yolov9s-320-edgetpu";
100939
101084
  /** Recall within this of the best counts as a tie — the faster one wins. */
100940
101085
  var RECALL_TIE = .02;
100941
101086
  /** Default share of an accelerator's throughput kept free. */
@@ -101095,12 +101240,9 @@ function recommendNode(input) {
101095
101240
  const devices = node.devices.toSorted((a, b) => a.key.localeCompare(b.key));
101096
101241
  const contexts = /* @__PURE__ */ new Map();
101097
101242
  const early = /* @__PURE__ */ new Map();
101243
+ const corals = [];
101098
101244
  for (const device of devices) {
101099
101245
  const accelerator = acceleratorKindOf(device.key, hardware);
101100
- if (accelerator === "coral") {
101101
- early.set(device.key, device.enabled ? [{ kind: "coral-untouched" }] : []);
101102
- continue;
101103
- }
101104
101246
  if (!device.enabled) {
101105
101247
  early.set(device.key, [{ kind: "device-disabled" }]);
101106
101248
  continue;
@@ -101109,6 +101251,23 @@ function recommendNode(input) {
101109
101251
  early.set(device.key, [{ kind: "device-unavailable" }]);
101110
101252
  continue;
101111
101253
  }
101254
+ if (accelerator === "coral") {
101255
+ const column = overlayMeasured(classTable.coral, measured[device.key]);
101256
+ const builds = node.formatsByModel["yolov9s-320-edgetpu"] ?? [];
101257
+ if (column?.["yolov9s-320-edgetpu"] === void 0 || !builds.includes(device.format)) {
101258
+ early.set(device.key, [{
101259
+ kind: "no-family-build",
101260
+ format: device.format
101261
+ }]);
101262
+ continue;
101263
+ }
101264
+ corals.push({
101265
+ device,
101266
+ accelerator,
101267
+ column
101268
+ });
101269
+ continue;
101270
+ }
101112
101271
  const column = accelerator === null ? void 0 : overlayMeasured(classTable[accelerator], measured[device.key]);
101113
101272
  if (accelerator === null || column === void 0) {
101114
101273
  early.set(device.key, [{
@@ -101159,6 +101318,12 @@ function recommendNode(input) {
101159
101318
  kind: "no-family-build",
101160
101319
  format: ctx.device.format
101161
101320
  }]);
101321
+ for (const ctx of corals) {
101322
+ const choice = choiceOn(ctx, CORAL_DEFAULT_MODEL_ID, sizing);
101323
+ if (choice === null) continue;
101324
+ chosenByKey.set(ctx.device.key, choice);
101325
+ reasonsByKey.set(ctx.device.key, deviceReasonsFor(choice, sizing));
101326
+ }
101162
101327
  for (const ctx of cpus) {
101163
101328
  const pick = pickForGroup([ctx], node.formatsByModel, sizing);
101164
101329
  const choice = pick === null ? null : choiceOn(ctx, pick.modelId, sizing);
@@ -101209,10 +101374,11 @@ function spareOf(c) {
101209
101374
  function electByShare(candidates) {
101210
101375
  if (candidates.length === 0) return { kind: "none" };
101211
101376
  const shareSum = candidates.reduce((s, c) => s + Math.max(c.share, 0), 0);
101212
- const running = candidates.reduce((s, c) => s + Math.max(c.running, 0), 0);
101377
+ const loadOf = (c) => Math.max(c.running, 0) + Math.max(c.recent ?? 0, 0);
101378
+ const running = candidates.reduce((s, c) => s + loadOf(c), 0);
101213
101379
  const scored = candidates.map((candidate) => ({
101214
101380
  candidate,
101215
- deficit: (shareSum > 0 ? Math.max(candidate.share, 0) / shareSum : 1 / candidates.length) * (running + 1) - candidate.running
101381
+ deficit: (shareSum > 0 ? Math.max(candidate.share, 0) / shareSum : 1 / candidates.length) * (running + 1) - loadOf(candidate)
101216
101382
  })).toSorted(byDeficit);
101217
101383
  const turn = scored[0].candidate;
101218
101384
  if (!turn.capped && !turn.saturated) return {
@@ -104094,8 +104260,6 @@ exports.AlertSourceSchema = AlertSourceSchema;
104094
104260
  exports.AlertStatusSchema = AlertStatusSchema;
104095
104261
  exports.AmbientLightSensorStatusSchema = AmbientLightSensorStatusSchema;
104096
104262
  exports.AnalyticsLtsSeriesSchema = AnalyticsLtsSeriesSchema;
104097
- exports.ApiKeyRecordSchema = ApiKeyRecordSchema;
104098
- exports.ApiKeySummarySchema = ApiKeySummarySchema;
104099
104263
  exports.AppFlowPurposeSchema = AppFlowPurposeSchema;
104100
104264
  exports.AppLoginPathSchema = AppLoginPathSchema;
104101
104265
  exports.AppPageLangSchema = AppPageLangSchema;
@@ -104240,6 +104404,7 @@ exports.COMPOSITION_ITEM_ARRAY_PATH = require_composition.COMPOSITION_ITEM_ARRAY
104240
104404
  exports.COMPOSITION_ITEM_KEY_RE = require_composition.COMPOSITION_ITEM_KEY_RE;
104241
104405
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
104242
104406
  exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
104407
+ exports.CORAL_DEFAULT_MODEL_ID = CORAL_DEFAULT_MODEL_ID;
104243
104408
  exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
104244
104409
  exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
104245
104410
  exports.CREDENTIAL_TOKEN_AUDIENCE = CREDENTIAL_TOKEN_AUDIENCE;
@@ -105482,6 +105647,7 @@ exports.RecordRetentionSchema = require_sleep.RecordRetentionSchema;
105482
105647
  exports.RecordSecretRefsSchema = RecordSecretRefsSchema;
105483
105648
  exports.RecordSecretUnavailableError = require_sleep.RecordSecretUnavailableError;
105484
105649
  exports.RecordTooLargeError = require_sleep.RecordTooLargeError;
105650
+ exports.RecordTransactOpSchema = RecordTransactOpSchema;
105485
105651
  exports.RecordTriggerSchema = RecordTriggerSchema;
105486
105652
  exports.RecordUniqueViolationError = require_sleep.RecordUniqueViolationError;
105487
105653
  exports.RecordViewSchema = RecordViewSchema;
@@ -105751,6 +105917,7 @@ exports.StorageReadChunkInputSchema = ReadChunkInputSchema;
105751
105917
  exports.StorageTableSchema = StorageTableSchema;
105752
105918
  exports.StorageTestLocationResultSchema = TestLocationResultSchema;
105753
105919
  exports.StorageWriteChunkInputSchema = WriteChunkInputSchema;
105920
+ exports.StoredRecordKindDeclarationSchema = require_sleep.StoredRecordKindDeclarationSchema;
105754
105921
  exports.StreamCodecSchema = StreamCodecSchema;
105755
105922
  exports.StreamFormatSchema = StreamFormatSchema;
105756
105923
  exports.StreamNetworkStatsSchema = StreamNetworkStatsSchema;
@@ -105857,6 +106024,7 @@ exports.TrainingResultFileSchema = TrainingResultFileSchema;
105857
106024
  exports.TrainingResultSchema = TrainingResultSchema;
105858
106025
  exports.TrainingSplitPlanSchema = TrainingSplitPlanSchema;
105859
106026
  exports.TrainingStageSchema = TrainingStageSchema;
106027
+ exports.TransactRefusedError = require_sleep.TransactRefusedError;
105860
106028
  exports.TransportPlaneCountsSchema = TransportPlaneCountsSchema;
105861
106029
  exports.TransportPlaneSchema = TransportPlaneSchema;
105862
106030
  exports.TurnServerSchema = TurnServerSchema;
@@ -105991,6 +106159,7 @@ exports.asNumber = require_sleep.asNumber;
105991
106159
  exports.asRecordsError = require_sleep.asRecordsError;
105992
106160
  exports.asString = require_sleep.asString;
105993
106161
  exports.assertTimelapseCadences = assertTimelapseCadences;
106162
+ exports.assertTransactScope = require_sleep.assertTransactScope;
105994
106163
  exports.assertValidDeclaration = require_sleep.assertValidDeclaration;
105995
106164
  exports.assignNodeColorId = require_node_color.assignNodeColorId;
105996
106165
  exports.audioAnalysisCapability = audioAnalysisCapability;
@@ -106188,6 +106357,7 @@ exports.detectAccessRole = detectAccessRole;
106188
106357
  exports.detectionPipelineCapability = detectionPipelineCapability;
106189
106358
  exports.deviceAdminLinkCapability = deviceAdminLinkCapability;
106190
106359
  exports.deviceAdoptionCapability = deviceAdoptionCapability;
106360
+ exports.deviceAttentionKind = deviceAttentionKind;
106191
106361
  exports.deviceBackendToFormat = deviceBackendToFormat;
106192
106362
  exports.deviceCredentialsCapability = deviceCredentialsCapability;
106193
106363
  exports.deviceCustomAction = require_sleep.deviceCustomAction;