@camstack/server 1.2.848 → 1.2.849

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 (93) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +13 -10
  3. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/system/dist/builtins/autotrack/index.js +1 -1
  10. package/system/dist/builtins/autotrack/index.mjs +1 -1
  11. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/system/dist/builtins/camera-grid/index.js +1 -1
  16. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  17. package/system/dist/builtins/composer/composer.addon.js +4 -4
  18. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  19. package/system/dist/builtins/console-logging/index.js +1 -1
  20. package/system/dist/builtins/console-logging/index.mjs +1 -1
  21. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  22. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  23. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  24. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  25. package/system/dist/builtins/device-manager/device-manager.addon.d.ts +0 -25
  26. package/system/dist/builtins/device-manager/device-manager.addon.js +62 -4
  27. package/system/dist/builtins/device-manager/device-manager.addon.mjs +62 -4
  28. package/system/dist/builtins/device-manager/transitions/transitions-wiring.d.ts +6 -1
  29. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  30. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  31. package/system/dist/builtins/keychain/index.js +4 -4
  32. package/system/dist/builtins/keychain/index.mjs +4 -4
  33. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  34. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  35. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  36. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  37. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  38. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  39. package/system/dist/builtins/loki-logging/index.js +1 -1
  40. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  41. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  42. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  43. package/system/dist/builtins/platform-probe/index.js +1 -1
  44. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  45. package/system/dist/builtins/record-entries/index.js +1 -1
  46. package/system/dist/builtins/record-entries/index.mjs +1 -1
  47. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  48. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  49. package/system/dist/builtins/snapshot/index.js +1 -1
  50. package/system/dist/builtins/snapshot/index.mjs +1 -1
  51. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  52. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  53. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  54. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  55. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  56. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  57. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  58. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  59. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  60. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  61. package/system/dist/builtins/winston-logging/index.js +1 -1
  62. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  63. package/system/dist/{capture-engine-BDgAg1_L.mjs → capture-engine-CgCljSbM.mjs} +1 -1
  64. package/system/dist/{capture-engine-CLow73VK.js → capture-engine-QQtJ9iXs.js} +1 -1
  65. package/system/dist/{composition-sources-Xb2YACrP.js → composition-sources-DxDmYFCD.js} +1 -1
  66. package/system/dist/{composition-sources-PCla-eR3.mjs → composition-sources-pEPr0Ucn.mjs} +1 -1
  67. package/system/dist/{constants-Cjv1STtI.mjs → constants-CNZ_oxrp.mjs} +1 -1
  68. package/system/dist/{constants-Crx9nPwX.js → constants-Df49f3b4.js} +1 -1
  69. package/system/dist/{device-ca-D5bhkYRx.mjs → device-ca-Bl-6F9mv.mjs} +1 -1
  70. package/system/dist/{device-ca-jaJY-9dh.js → device-ca-BzUtH2U5.js} +1 -1
  71. package/system/dist/{dist-D9G24tL4.js → dist-DKsFOzpr.js} +97 -14
  72. package/system/dist/{dist-CUB8zpv-.mjs → dist-zkNb0bBi.mjs} +97 -14
  73. package/system/dist/file-host-worker.js +1 -1
  74. package/system/dist/file-host-worker.mjs +1 -1
  75. package/system/dist/{hub-identity-0lAqqUXZ.mjs → hub-identity-BrGlipuh.mjs} +1 -1
  76. package/system/dist/{hub-identity-D6Yzg92a.js → hub-identity-Dv4V44gP.js} +1 -1
  77. package/system/dist/{hub-mdns-ciao-0vZomp05.js → hub-mdns-ciao-DcWSdIki.js} +2 -2
  78. package/system/dist/{hub-mdns-ciao-dT75vFJK.mjs → hub-mdns-ciao-Dzht7PBY.mjs} +2 -2
  79. package/system/dist/index.js +36 -2505
  80. package/system/dist/index.mjs +36 -2505
  81. package/system/dist/kernel/bootstrap-config.d.ts +1 -2
  82. package/system/dist/kernel/capability-registry.d.ts +6 -2
  83. package/system/dist/{legacy-integration-rows-door-V0HNtga9.js → legacy-integration-rows-door-CISh8s7H.js} +1 -1
  84. package/system/dist/{legacy-integration-rows-door-CkwpRASZ.mjs → legacy-integration-rows-door-CL6R8xaY.mjs} +1 -1
  85. package/system/dist/migrations/hub/2026-11-12-drop-retired-storage-leftovers.d.ts +16 -0
  86. package/system/dist/{rename-composition-block-CmNS12Yh.js → rename-composition-block-DFi7GTKn.js} +1 -1
  87. package/system/dist/{rename-composition-block-CKO6KFN4.mjs → rename-composition-block-DM_koTq7.mjs} +1 -1
  88. package/system/dist/{restore-archive-Cp8P5gxb.mjs → restore-archive-D_3y4vj-.mjs} +1 -1
  89. package/system/dist/{restore-archive-DRyTaAb5.js → restore-archive-Daw2fB9X.js} +1 -1
  90. package/system/dist/{wal-maintenance-CyW12mpW.mjs → wal-maintenance-BPohUtyD.mjs} +0 -0
  91. package/system/dist/{wal-maintenance-EJcAHbIL.js → wal-maintenance-GyMlkYI_.js} +0 -0
  92. package/system/package.json +1 -1
  93. package/system/dist/kernel/legacy-config-yaml.d.ts +0 -37
@@ -1,6 +1,6 @@
1
1
  let zod = require("zod");
2
2
  require("node:crypto");
3
- //#region ../types/dist/event-category-78tcBemo.mjs
3
+ //#region ../types/dist/event-category-Dv-Gcv1f.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -441,6 +441,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
441
441
  */
442
442
  EventCategory["DeviceStateChanged"] = "device.state-changed";
443
443
  /**
444
+ * A device COMMAND (a vocabulary action, D920/D983) settled in the hub's
445
+ * transition audit (D1022): confirmed, already in place, unconfirmed or
446
+ * failed. Never a device's own change. Payload: `DeviceCommandSettledEvent`
447
+ * (`{deviceId, action, outcome, actor, at}`, no arguments). It feeds
448
+ * the Notification Center `device-command` kind. Telemetry (D8): losing one
449
+ * costs a notification, never state; the audit row is the record.
450
+ */
451
+ EventCategory["DeviceCommandSettled"] = "device.command-settled";
452
+ /**
444
453
  * The NATIVE shadow of a cap a composition has claimed fields of moved
445
454
  * (D663). Payload: `{ deviceId, capName, native }` — what the provider
446
455
  * wrote, BEFORE the owned fields are overlaid. Owner-only (D224): it is for
@@ -1243,7 +1252,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1243
1252
  */
1244
1253
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1245
1254
  //#endregion
1246
- //#region ../types/dist/sleep-Ba1dJYDo.mjs
1255
+ //#region ../types/dist/sleep-Czv-4wFH.mjs
1247
1256
  /**
1248
1257
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1249
1258
  * window to float samples (D455).
@@ -1990,6 +1999,13 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
1990
1999
  else skipped.push(id);
1991
2000
  };
1992
2001
  const selected = options.only === void 0 ? null : new Set(options.only);
2002
+ const deferred = /* @__PURE__ */ new Set();
2003
+ const deferredBy = (reason) => {
2004
+ if (selected === null || reason === null) return null;
2005
+ const dep = /^dependency-(?:pending|blocked):(.+)$/.exec(reason)?.[1];
2006
+ if (dep === void 0 || !byId.has(dep)) return null;
2007
+ return !selected.has(dep) || deferred.has(dep) ? dep : null;
2008
+ };
1993
2009
  for (const step of declaration.steps) {
1994
2010
  if (selected !== null && !selected.has(step.id)) continue;
1995
2011
  const bound = byId.get(step.id);
@@ -2001,6 +2017,19 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
2001
2017
  try {
2002
2018
  const gate = await host.startMigration({ id: step.id });
2003
2019
  if (!gate.proceed) {
2020
+ const waitsFor = deferredBy(gate.reason);
2021
+ if (waitsFor !== null) {
2022
+ log.info("migration deferred: its predecessor runs in another phase of this owner", {
2023
+ tags,
2024
+ meta: {
2025
+ waitsFor,
2026
+ reason: gate.reason
2027
+ }
2028
+ });
2029
+ deferred.add(step.id);
2030
+ skipped.push(step.id);
2031
+ continue;
2032
+ }
2004
2033
  log.warn("migration not run", {
2005
2034
  tags,
2006
2035
  meta: {
@@ -5739,6 +5768,13 @@ var DeviceTransitionSchema = zod.z.object({
5739
5768
  actor: TransitionActorSchema,
5740
5769
  command: TransitionCommandSchema.optional()
5741
5770
  });
5771
+ zod.z.object({
5772
+ deviceId: zod.z.number().int(),
5773
+ action: zod.z.string(),
5774
+ outcome: TransitionOutcomeSchema,
5775
+ actor: TransitionActorSchema,
5776
+ at: zod.z.number()
5777
+ });
5742
5778
  var READING_QUANTITIES = [
5743
5779
  "temperature",
5744
5780
  "pressure",
@@ -67061,18 +67097,32 @@ var HeroRowModelSchema = zod.z.object({
67061
67097
  extras: zod.z.array(HeroControlSchema).max(2).optional(),
67062
67098
  trailing: HeroFactSchema.nullable()
67063
67099
  });
67064
- /** The trailing fact, in order of preference. */
67100
+ /**
67101
+ * A measurement that IS the headline. The row trails it so a client that paints only
67102
+ * `trailing` still shows the reading. Power, battery and consumables stay ahead of these.
67103
+ */
67104
+ var ROW_READING_FACT_IDS = [
67105
+ "temperature",
67106
+ "humidity",
67107
+ "pressure",
67108
+ "illuminance",
67109
+ "reading",
67110
+ "air-quality",
67111
+ "valve"
67112
+ ];
67113
+ /** The trailing fact, in order of preference. A reading joins only when it repeats the headline. */
67065
67114
  var TRAILING_ORDER = [
67066
67115
  "power",
67067
67116
  "battery",
67068
67117
  "consumables"
67069
67118
  ];
67070
- function trailingOf(facts) {
67119
+ var READING_FACT_IDS = new Set(ROW_READING_FACT_IDS);
67120
+ function trailingOf(model) {
67071
67121
  for (const id of TRAILING_ORDER) {
67072
- const found = facts.find((f) => f.id === id);
67122
+ const found = model.facts.find((f) => f.id === id);
67073
67123
  if (found !== void 0) return found;
67074
67124
  }
67075
- return null;
67125
+ return model.facts.find((f) => READING_FACT_IDS.has(f.id) && f.text.en === model.title.en) ?? null;
67076
67126
  }
67077
67127
  /**
67078
67128
  * A type whose primary is a named control, not its power: a climate row is the mode
@@ -67167,7 +67217,7 @@ function timedRunOf(model) {
67167
67217
  };
67168
67218
  }
67169
67219
  function projectDeviceRow(model) {
67170
- const trailing = trailingOf(model.facts);
67220
+ const trailing = trailingOf(model);
67171
67221
  const primary = primaryOf(model);
67172
67222
  return {
67173
67223
  deviceId: model.deviceId,
@@ -80760,6 +80810,7 @@ var NcSystemEventKindSchema = zod.z.enum([
80760
80810
  "recording-degraded",
80761
80811
  "device-attention-required",
80762
80812
  "device-attention-resolved",
80813
+ "device-command",
80763
80814
  "storage-location-low",
80764
80815
  "storage-location-critical",
80765
80816
  "storage-location-ok",
@@ -80822,11 +80873,6 @@ var NC_ALARM_SYSTEM_EVENT_KINDS = [
80822
80873
  "alarm-sensor-bypass",
80823
80874
  "alarm-disarmed"
80824
80875
  ];
80825
- /**
80826
- * One coherent system-event condition. `kinds` is the required opt-in safety
80827
- * gate; the remaining lists are optional narrowing filters relevant to the
80828
- * selected kinds.
80829
- */
80830
80876
  var NcSystemEventConditionSchema = zod.z.object({
80831
80877
  kinds: zod.z.array(NcSystemEventKindSchema).min(1),
80832
80878
  deviceIds: zod.z.array(zod.z.number().int()).min(1).optional(),
@@ -80858,6 +80904,28 @@ var NcSystemEventConditionSchema = zod.z.object({
80858
80904
  nodeIds: zod.z.array(zod.z.string().min(1)).min(1).optional(),
80859
80905
  packageNames: zod.z.array(zod.z.string().min(1)).min(1).optional(),
80860
80906
  /**
80907
+ * `device-command` only: the vocabulary ACTION IDS (D983, `powerSource.forceRestart`)
80908
+ * this rule speaks about - the same dictionary the automation action blocks
80909
+ * pick from. The hub refuses an id the action index does not know.
80910
+ */
80911
+ commandActions: zod.z.array(zod.z.string().min(1)).min(1).optional(),
80912
+ /** `device-command` only: how the command settled. A device's own change is not a command. */
80913
+ commandOutcomes: zod.z.array(zod.z.enum([
80914
+ "confirmed",
80915
+ "already",
80916
+ "unconfirmed",
80917
+ "failed"
80918
+ ])).min(1).optional(),
80919
+ /** `device-command` only: who asked (`user`, `addon`, `action`, `scheduler`, `composition`, `node`). */
80920
+ commandActorKinds: zod.z.array(zod.z.enum([
80921
+ "user",
80922
+ "addon",
80923
+ "action",
80924
+ "scheduler",
80925
+ "composition",
80926
+ "node"
80927
+ ])).min(1).optional(),
80928
+ /**
80861
80929
  * At or below this remaining-life %, a consumable is LOW for THIS rule
80862
80930
  * (D642). Absent = {@link NC_CONSUMABLE_LOW_PERCENT_DEFAULT}; at most
80863
80931
  * {@link NC_CONSUMABLE_LOW_PERCENT_MAX}, so every episode can recover. Scoped to the
@@ -104968,7 +105036,8 @@ function buildHeroModel(input) {
104968
105036
  label: t(integration, integration)
104969
105037
  }], ...fragments.flatMap((f) => f.badges ?? [])];
104970
105038
  const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
104971
- const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en);
105039
+ const readingIds = new Set(ROW_READING_FACT_IDS);
105040
+ const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en || readingIds.has(f.id));
104972
105041
  const sideTiles = {
104973
105042
  left: tilesOf(fragments, "left"),
104974
105043
  right: tilesOf(fragments, "right")
@@ -119278,7 +119347,10 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
119278
119347
  "deviceTypes",
119279
119348
  "nodeIds",
119280
119349
  "packageNames",
119281
- "consumableLowPercent"
119350
+ "consumableLowPercent",
119351
+ "commandActions",
119352
+ "commandOutcomes",
119353
+ "commandActorKinds"
119282
119354
  ];
119283
119355
  new Map(Object.entries({
119284
119356
  "device-online": "device-events",
@@ -119301,6 +119373,7 @@ new Map(Object.entries({
119301
119373
  "recording-degraded": "device-events",
119302
119374
  "device-attention-required": "device-events",
119303
119375
  "device-attention-resolved": "device-events",
119376
+ "device-command": "device-events",
119304
119377
  "node-online": "system",
119305
119378
  "node-offline": "system",
119306
119379
  "node-restarting": "system",
@@ -119401,6 +119474,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
119401
119474
  label: "Needs attention",
119402
119475
  kinds: ["device-attention-required", "device-attention-resolved"]
119403
119476
  },
119477
+ {
119478
+ id: "device-command",
119479
+ family: "device-events",
119480
+ label: "Commands given to devices",
119481
+ kinds: ["device-command"]
119482
+ },
119404
119483
  {
119405
119484
  id: "nodes",
119406
119485
  family: "system",
@@ -119715,6 +119794,7 @@ var DEVICE_EVENTS = [
119715
119794
  "recording-healthy",
119716
119795
  "recording-degraded",
119717
119796
  ...DEVICE_ATTENTION,
119797
+ "device-command",
119718
119798
  ...ALARM
119719
119799
  ];
119720
119800
  /** Every kind a summary may speak about — the two summarisable families. */
@@ -119868,6 +119948,9 @@ var STATE_SUMMARY_VARS = [
119868
119948
  [...RULE_BODY_ONLY],
119869
119949
  [...RULE_TEXT],
119870
119950
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
119951
+ [...RULE_TEXT],
119952
+ [...RULE_TEXT],
119953
+ ([...RULE_TEXT], [...DEVICE_EVENTS]),
119871
119954
  ([...RULE_TEXT], [...COMBINED_ALARM]),
119872
119955
  ([...RULE_TEXT], [...COMBINED_ALARM]),
119873
119956
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import "node:crypto";
3
- //#region ../types/dist/event-category-78tcBemo.mjs
3
+ //#region ../types/dist/event-category-Dv-Gcv1f.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -441,6 +441,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
441
441
  */
442
442
  EventCategory["DeviceStateChanged"] = "device.state-changed";
443
443
  /**
444
+ * A device COMMAND (a vocabulary action, D920/D983) settled in the hub's
445
+ * transition audit (D1022): confirmed, already in place, unconfirmed or
446
+ * failed. Never a device's own change. Payload: `DeviceCommandSettledEvent`
447
+ * (`{deviceId, action, outcome, actor, at}`, no arguments). It feeds
448
+ * the Notification Center `device-command` kind. Telemetry (D8): losing one
449
+ * costs a notification, never state; the audit row is the record.
450
+ */
451
+ EventCategory["DeviceCommandSettled"] = "device.command-settled";
452
+ /**
444
453
  * The NATIVE shadow of a cap a composition has claimed fields of moved
445
454
  * (D663). Payload: `{ deviceId, capName, native }` — what the provider
446
455
  * wrote, BEFORE the owned fields are overlaid. Owner-only (D224): it is for
@@ -1243,7 +1252,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1243
1252
  */
1244
1253
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1245
1254
  //#endregion
1246
- //#region ../types/dist/sleep-Ba1dJYDo.mjs
1255
+ //#region ../types/dist/sleep-Czv-4wFH.mjs
1247
1256
  /**
1248
1257
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1249
1258
  * window to float samples (D455).
@@ -1990,6 +1999,13 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
1990
1999
  else skipped.push(id);
1991
2000
  };
1992
2001
  const selected = options.only === void 0 ? null : new Set(options.only);
2002
+ const deferred = /* @__PURE__ */ new Set();
2003
+ const deferredBy = (reason) => {
2004
+ if (selected === null || reason === null) return null;
2005
+ const dep = /^dependency-(?:pending|blocked):(.+)$/.exec(reason)?.[1];
2006
+ if (dep === void 0 || !byId.has(dep)) return null;
2007
+ return !selected.has(dep) || deferred.has(dep) ? dep : null;
2008
+ };
1993
2009
  for (const step of declaration.steps) {
1994
2010
  if (selected !== null && !selected.has(step.id)) continue;
1995
2011
  const bound = byId.get(step.id);
@@ -2001,6 +2017,19 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
2001
2017
  try {
2002
2018
  const gate = await host.startMigration({ id: step.id });
2003
2019
  if (!gate.proceed) {
2020
+ const waitsFor = deferredBy(gate.reason);
2021
+ if (waitsFor !== null) {
2022
+ log.info("migration deferred: its predecessor runs in another phase of this owner", {
2023
+ tags,
2024
+ meta: {
2025
+ waitsFor,
2026
+ reason: gate.reason
2027
+ }
2028
+ });
2029
+ deferred.add(step.id);
2030
+ skipped.push(step.id);
2031
+ continue;
2032
+ }
2004
2033
  log.warn("migration not run", {
2005
2034
  tags,
2006
2035
  meta: {
@@ -5739,6 +5768,13 @@ var DeviceTransitionSchema = z.object({
5739
5768
  actor: TransitionActorSchema,
5740
5769
  command: TransitionCommandSchema.optional()
5741
5770
  });
5771
+ z.object({
5772
+ deviceId: z.number().int(),
5773
+ action: z.string(),
5774
+ outcome: TransitionOutcomeSchema,
5775
+ actor: TransitionActorSchema,
5776
+ at: z.number()
5777
+ });
5742
5778
  var READING_QUANTITIES = [
5743
5779
  "temperature",
5744
5780
  "pressure",
@@ -67061,18 +67097,32 @@ var HeroRowModelSchema = z.object({
67061
67097
  extras: z.array(HeroControlSchema).max(2).optional(),
67062
67098
  trailing: HeroFactSchema.nullable()
67063
67099
  });
67064
- /** The trailing fact, in order of preference. */
67100
+ /**
67101
+ * A measurement that IS the headline. The row trails it so a client that paints only
67102
+ * `trailing` still shows the reading. Power, battery and consumables stay ahead of these.
67103
+ */
67104
+ var ROW_READING_FACT_IDS = [
67105
+ "temperature",
67106
+ "humidity",
67107
+ "pressure",
67108
+ "illuminance",
67109
+ "reading",
67110
+ "air-quality",
67111
+ "valve"
67112
+ ];
67113
+ /** The trailing fact, in order of preference. A reading joins only when it repeats the headline. */
67065
67114
  var TRAILING_ORDER = [
67066
67115
  "power",
67067
67116
  "battery",
67068
67117
  "consumables"
67069
67118
  ];
67070
- function trailingOf(facts) {
67119
+ var READING_FACT_IDS = new Set(ROW_READING_FACT_IDS);
67120
+ function trailingOf(model) {
67071
67121
  for (const id of TRAILING_ORDER) {
67072
- const found = facts.find((f) => f.id === id);
67122
+ const found = model.facts.find((f) => f.id === id);
67073
67123
  if (found !== void 0) return found;
67074
67124
  }
67075
- return null;
67125
+ return model.facts.find((f) => READING_FACT_IDS.has(f.id) && f.text.en === model.title.en) ?? null;
67076
67126
  }
67077
67127
  /**
67078
67128
  * A type whose primary is a named control, not its power: a climate row is the mode
@@ -67167,7 +67217,7 @@ function timedRunOf(model) {
67167
67217
  };
67168
67218
  }
67169
67219
  function projectDeviceRow(model) {
67170
- const trailing = trailingOf(model.facts);
67220
+ const trailing = trailingOf(model);
67171
67221
  const primary = primaryOf(model);
67172
67222
  return {
67173
67223
  deviceId: model.deviceId,
@@ -80760,6 +80810,7 @@ var NcSystemEventKindSchema = z.enum([
80760
80810
  "recording-degraded",
80761
80811
  "device-attention-required",
80762
80812
  "device-attention-resolved",
80813
+ "device-command",
80763
80814
  "storage-location-low",
80764
80815
  "storage-location-critical",
80765
80816
  "storage-location-ok",
@@ -80822,11 +80873,6 @@ var NC_ALARM_SYSTEM_EVENT_KINDS = [
80822
80873
  "alarm-sensor-bypass",
80823
80874
  "alarm-disarmed"
80824
80875
  ];
80825
- /**
80826
- * One coherent system-event condition. `kinds` is the required opt-in safety
80827
- * gate; the remaining lists are optional narrowing filters relevant to the
80828
- * selected kinds.
80829
- */
80830
80876
  var NcSystemEventConditionSchema = z.object({
80831
80877
  kinds: z.array(NcSystemEventKindSchema).min(1),
80832
80878
  deviceIds: z.array(z.number().int()).min(1).optional(),
@@ -80858,6 +80904,28 @@ var NcSystemEventConditionSchema = z.object({
80858
80904
  nodeIds: z.array(z.string().min(1)).min(1).optional(),
80859
80905
  packageNames: z.array(z.string().min(1)).min(1).optional(),
80860
80906
  /**
80907
+ * `device-command` only: the vocabulary ACTION IDS (D983, `powerSource.forceRestart`)
80908
+ * this rule speaks about - the same dictionary the automation action blocks
80909
+ * pick from. The hub refuses an id the action index does not know.
80910
+ */
80911
+ commandActions: z.array(z.string().min(1)).min(1).optional(),
80912
+ /** `device-command` only: how the command settled. A device's own change is not a command. */
80913
+ commandOutcomes: z.array(z.enum([
80914
+ "confirmed",
80915
+ "already",
80916
+ "unconfirmed",
80917
+ "failed"
80918
+ ])).min(1).optional(),
80919
+ /** `device-command` only: who asked (`user`, `addon`, `action`, `scheduler`, `composition`, `node`). */
80920
+ commandActorKinds: z.array(z.enum([
80921
+ "user",
80922
+ "addon",
80923
+ "action",
80924
+ "scheduler",
80925
+ "composition",
80926
+ "node"
80927
+ ])).min(1).optional(),
80928
+ /**
80861
80929
  * At or below this remaining-life %, a consumable is LOW for THIS rule
80862
80930
  * (D642). Absent = {@link NC_CONSUMABLE_LOW_PERCENT_DEFAULT}; at most
80863
80931
  * {@link NC_CONSUMABLE_LOW_PERCENT_MAX}, so every episode can recover. Scoped to the
@@ -104968,7 +105036,8 @@ function buildHeroModel(input) {
104968
105036
  label: t(integration, integration)
104969
105037
  }], ...fragments.flatMap((f) => f.badges ?? [])];
104970
105038
  const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
104971
- const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en);
105039
+ const readingIds = new Set(ROW_READING_FACT_IDS);
105040
+ const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en || readingIds.has(f.id));
104972
105041
  const sideTiles = {
104973
105042
  left: tilesOf(fragments, "left"),
104974
105043
  right: tilesOf(fragments, "right")
@@ -119278,7 +119347,10 @@ var NC_SYSTEM_EVENT_FILTER_KEYS = [
119278
119347
  "deviceTypes",
119279
119348
  "nodeIds",
119280
119349
  "packageNames",
119281
- "consumableLowPercent"
119350
+ "consumableLowPercent",
119351
+ "commandActions",
119352
+ "commandOutcomes",
119353
+ "commandActorKinds"
119282
119354
  ];
119283
119355
  new Map(Object.entries({
119284
119356
  "device-online": "device-events",
@@ -119301,6 +119373,7 @@ new Map(Object.entries({
119301
119373
  "recording-degraded": "device-events",
119302
119374
  "device-attention-required": "device-events",
119303
119375
  "device-attention-resolved": "device-events",
119376
+ "device-command": "device-events",
119304
119377
  "node-online": "system",
119305
119378
  "node-offline": "system",
119306
119379
  "node-restarting": "system",
@@ -119401,6 +119474,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
119401
119474
  label: "Needs attention",
119402
119475
  kinds: ["device-attention-required", "device-attention-resolved"]
119403
119476
  },
119477
+ {
119478
+ id: "device-command",
119479
+ family: "device-events",
119480
+ label: "Commands given to devices",
119481
+ kinds: ["device-command"]
119482
+ },
119404
119483
  {
119405
119484
  id: "nodes",
119406
119485
  family: "system",
@@ -119715,6 +119794,7 @@ var DEVICE_EVENTS = [
119715
119794
  "recording-healthy",
119716
119795
  "recording-degraded",
119717
119796
  ...DEVICE_ATTENTION,
119797
+ "device-command",
119718
119798
  ...ALARM
119719
119799
  ];
119720
119800
  /** Every kind a summary may speak about — the two summarisable families. */
@@ -119868,6 +119948,9 @@ var STATE_SUMMARY_VARS = [
119868
119948
  [...RULE_BODY_ONLY],
119869
119949
  [...RULE_TEXT],
119870
119950
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
119951
+ [...RULE_TEXT],
119952
+ [...RULE_TEXT],
119953
+ ([...RULE_TEXT], [...DEVICE_EVENTS]),
119871
119954
  ([...RULE_TEXT], [...COMBINED_ALARM]),
119872
119955
  ([...RULE_TEXT], [...COMBINED_ALARM]),
119873
119956
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-EJcAHbIL.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-GyMlkYI_.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-CyW12mpW.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-BPohUtyD.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Cc as defineRecordKinds } from "./dist-CUB8zpv-.mjs";
1
+ import { Cc as defineRecordKinds } from "./dist-zkNb0bBi.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { z } from "zod";
4
4
  import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-D9G24tL4.js");
2
+ const require_dist = require("./dist-DKsFOzpr.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
4
  let zod = require("zod");
5
5
  let node_crypto = require("node:crypto");
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-D9G24tL4.js");
2
+ const require_dist = require("./dist-DKsFOzpr.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_hub_identity = require("./hub-identity-D6Yzg92a.js");
4
+ const require_hub_identity = require("./hub-identity-Dv4V44gP.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs = require("node:fs");
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { pl as userError } from "./dist-CUB8zpv-.mjs";
2
+ import { pl as userError } from "./dist-zkNb0bBi.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { A as evaluateExistingCert, C as localCaCommonName, F as isConstrainedCa, L as permitsIdentity, S as loadCa, b as generateCa, j as reasonRequiresNewCa, w as collectCertIdentity, x as issueLeaf, z as readNameConstraints } from "./hub-identity-0lAqqUXZ.mjs";
4
+ import { A as evaluateExistingCert, C as localCaCommonName, F as isConstrainedCa, L as permitsIdentity, S as loadCa, b as generateCa, j as reasonRequiresNewCa, w as collectCertIdentity, x as issueLeaf, z as readNameConstraints } from "./hub-identity-BrGlipuh.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";