@camstack/server 1.2.897 → 1.2.899

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 (114) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/cap-router-runtime.js +1 -0
  3. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  4. package/dist/api/trpc/generated-cap-routers.js +1894 -1870
  5. package/dist/core/addon/hub-addon-api.js +1 -0
  6. package/dist/core/moleculer/moleculer.service.js +1 -0
  7. package/package.json +11 -10
  8. package/system/dist/addon-runner.js +207 -13
  9. package/system/dist/addon-runner.mjs +207 -13
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  15. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  16. package/system/dist/builtins/autotrack/index.js +1 -1
  17. package/system/dist/builtins/autotrack/index.mjs +1 -1
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  19. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  20. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  21. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  22. package/system/dist/builtins/camera-grid/index.js +1 -1
  23. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  24. package/system/dist/builtins/composer/composer.addon.js +14 -11
  25. package/system/dist/builtins/composer/composer.addon.mjs +11 -8
  26. package/system/dist/builtins/console-logging/index.js +1 -1
  27. package/system/dist/builtins/console-logging/index.mjs +1 -1
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.js +170 -14
  29. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +169 -13
  30. package/system/dist/builtins/core-blocks/migrations/automation-confirmed-view.d.ts +23 -0
  31. package/system/dist/builtins/core-blocks/migrations/index.d.ts +1 -0
  32. package/system/dist/builtins/core-blocks/migrations/pump-cycle-split.d.ts +1 -0
  33. package/system/dist/builtins/device-history/device-history.addon.js +10 -9
  34. package/system/dist/builtins/device-history/device-history.addon.mjs +10 -9
  35. package/system/dist/builtins/device-manager/command-holds-wiring.d.ts +22 -0
  36. package/system/dist/builtins/device-manager/command-holds.d.ts +77 -0
  37. package/system/dist/builtins/device-manager/device-manager.addon.d.ts +3 -0
  38. package/system/dist/builtins/device-manager/device-manager.addon.js +1078 -41
  39. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1062 -42
  40. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +42 -9
  41. package/system/dist/builtins/device-manager/state-refresh-scheduler.d.ts +92 -0
  42. package/system/dist/builtins/device-manager/state-refresh-wiring.d.ts +23 -0
  43. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  44. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  45. package/system/dist/builtins/keychain/index.js +4 -4
  46. package/system/dist/builtins/keychain/index.mjs +4 -4
  47. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  49. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  50. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  51. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  52. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  53. package/system/dist/builtins/loki-logging/index.js +1 -1
  54. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  55. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  57. package/system/dist/builtins/platform-probe/index.js +1 -1
  58. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  59. package/system/dist/builtins/record-entries/index.js +1 -1
  60. package/system/dist/builtins/record-entries/index.mjs +1 -1
  61. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  63. package/system/dist/builtins/shared/device-state-changed.d.ts +8 -0
  64. package/system/dist/builtins/snapshot/index.js +1 -1
  65. package/system/dist/builtins/snapshot/index.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  69. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  70. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  71. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  72. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  73. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  74. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  75. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  76. package/system/dist/builtins/winston-logging/index.js +1 -1
  77. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  78. package/system/dist/{capture-engine-Bjgs__i9.mjs → capture-engine-BcD6iCZM.mjs} +37 -2
  79. package/system/dist/{capture-engine-D1rjl2dW.js → capture-engine-LHKTf-nM.js} +48 -1
  80. package/system/dist/{composition-sources-B727nlA0.mjs → composition-sources-C3ARJk2g.mjs} +2 -21
  81. package/system/dist/{composition-sources-CF2-u58e.js → composition-sources-DNUDbuXy.js} +1 -32
  82. package/system/dist/{constants-DaR1SUh7.js → constants-dL8fl9aI.js} +1 -1
  83. package/system/dist/{constants-BF309c_I.mjs → constants-er38mZOb.mjs} +1 -1
  84. package/system/dist/{device-ca-DT1hYtdW.mjs → device-ca-Ccz5olgH.mjs} +1 -1
  85. package/system/dist/{device-ca-BqcX5_f2.js → device-ca-KWa6uJRU.js} +1 -1
  86. package/system/dist/{dist-DorY_sjS.mjs → dist-DBanWvHF.mjs} +819 -54
  87. package/system/dist/{dist-BoEy9sm9.js → dist-DEAjZE_-.js} +848 -53
  88. package/system/dist/file-host-worker.js +1 -1
  89. package/system/dist/file-host-worker.mjs +1 -1
  90. package/system/dist/{hub-identity-CZ0nE3GK.mjs → hub-identity-CVv79TVO.mjs} +1 -1
  91. package/system/dist/{hub-identity-DH1rxUMD.js → hub-identity-Dy8ZSUuq.js} +1 -1
  92. package/system/dist/{hub-mdns-ciao-N0nL34fx.js → hub-mdns-ciao-C_XjO7YI.js} +2 -2
  93. package/system/dist/{hub-mdns-ciao-7HK57Vtx.mjs → hub-mdns-ciao-DtmIyWDL.mjs} +2 -2
  94. package/system/dist/index.js +96 -17
  95. package/system/dist/index.mjs +92 -19
  96. package/system/dist/kernel/cap-router-builder.d.ts +7 -0
  97. package/system/dist/kernel/command-follow-up.d.ts +33 -0
  98. package/system/dist/kernel/command-hold-overrides.d.ts +42 -0
  99. package/system/dist/kernel/command-observation.d.ts +3 -0
  100. package/system/dist/kernel/index.d.ts +3 -0
  101. package/system/dist/kernel/moleculer/child-cap-descriptors.d.ts +5 -0
  102. package/system/dist/kernel/moleculer/device-cap-proxy.d.ts +3 -1
  103. package/system/dist/kernel/state-refresh-policies.d.ts +53 -0
  104. package/system/dist/kernel/transport/child-cap-protocol.d.ts +11 -1
  105. package/system/dist/kernel/transport/local-child-registry.d.ts +14 -0
  106. package/system/dist/{legacy-integration-rows-door-CdAQlIvv.mjs → legacy-integration-rows-door-BL8T4lya.mjs} +1 -1
  107. package/system/dist/{legacy-integration-rows-door-BTfeULYt.js → legacy-integration-rows-door-DPInWtE6.js} +1 -1
  108. package/system/dist/{rename-composition-block-B1x-yK5U.js → rename-composition-block-BxzETYOf.js} +1 -1
  109. package/system/dist/{rename-composition-block-CIQjxBUa.mjs → rename-composition-block-Dgo-9-Ts.mjs} +1 -1
  110. package/system/dist/{restore-archive-Bj_gYmE9.mjs → restore-archive-BUtuNTe1.mjs} +82 -82
  111. package/system/dist/{restore-archive-B086o8pL.js → restore-archive-Zvx9sHZP.js} +1 -1
  112. package/system/dist/{wal-maintenance-MVIyxmu7.js → wal-maintenance-DS2IKwtK.js} +0 -0
  113. package/system/dist/{wal-maintenance-Dgfmi-Ao.mjs → wal-maintenance-cASt_sYy.mjs} +0 -0
  114. package/system/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BoEy9sm9.js");
6
+ const require_dist = require("../../dist-DEAjZE_-.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Va as preconditionOf, fl as defineAddonMigrations, ia as logDestinationCapability, pc as BaseAddon } from "../../dist-DorY_sjS.mjs";
1
+ import { Ga as preconditionOf, _l as defineAddonMigrations, ca as logDestinationCapability, vc as BaseAddon } from "../../dist-DBanWvHF.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,39 @@
1
- import { Cc as HISTORY_DEFAULT_MIN_INTERVAL_MS, Sl as historyItemFieldPath, fu as DeviceType } from "./dist-DorY_sjS.mjs";
1
+ import { Dl as historyItemFieldPath, Oc as HISTORY_DEFAULT_MIN_INTERVAL_MS, _u as DeviceType } from "./dist-DBanWvHF.mjs";
2
+ //#region src/builtins/shared/device-state-changed.ts
3
+ /** Structural narrowing helper for untrusted bus payloads. */
4
+ function isRecord$2(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6
+ }
7
+ function parseDeviceStateChanged(data) {
8
+ if (!isRecord$2(data)) return null;
9
+ const deviceId = data["deviceId"];
10
+ const capName = data["capName"];
11
+ const slice = data["slice"];
12
+ if (typeof deviceId !== "number" || typeof capName !== "string") return null;
13
+ if (!isRecord$2(slice)) return null;
14
+ return {
15
+ deviceId,
16
+ capName,
17
+ slice
18
+ };
19
+ }
20
+ /**
21
+ * The same payload with `slice` set to what the DEVICE reported (D1061). While a
22
+ * command hold changes the slice the event carries the effective one in `slice`
23
+ * and the reported one in `confirmed`; history, automations and every
24
+ * decision read this view, so a value the device never confirmed is never
25
+ * recorded or acted on.
26
+ */
27
+ function parseConfirmedStateChanged(data) {
28
+ const parsed = parseDeviceStateChanged(data);
29
+ if (parsed === null || !isRecord$2(data)) return parsed;
30
+ const confirmed = data["confirmed"];
31
+ return isRecord$2(confirmed) ? {
32
+ ...parsed,
33
+ slice: confirmed
34
+ } : parsed;
35
+ }
36
+ //#endregion
2
37
  //#region src/builtins/device-history/store/series-registry.ts
3
38
  function subjectIdOf(subject) {
4
39
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -646,4 +681,4 @@ var CaptureEngine = class {
646
681
  }
647
682
  };
648
683
  //#endregion
649
- export { catalogMetrics as a, DeviceDirectory as c, identityOf as d, subjectIdOf as f, capSeriesKey as i, isRealDeviceType as l, CaptureEngine as n, readPath as o, capItemSeriesKey as r, readUnit as s, CAP_KEY_PREFIX as t, SeriesRegistry as u };
684
+ export { catalogMetrics as a, DeviceDirectory as c, identityOf as d, subjectIdOf as f, capSeriesKey as i, isRealDeviceType as l, parseConfirmedStateChanged as m, CaptureEngine as n, readPath as o, isRecord$2 as p, capItemSeriesKey as r, readUnit as s, CAP_KEY_PREFIX as t, SeriesRegistry as u };
@@ -1,4 +1,39 @@
1
- const require_dist = require("./dist-BoEy9sm9.js");
1
+ const require_dist = require("./dist-DEAjZE_-.js");
2
+ //#region src/builtins/shared/device-state-changed.ts
3
+ /** Structural narrowing helper for untrusted bus payloads. */
4
+ function isRecord$2(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6
+ }
7
+ function parseDeviceStateChanged(data) {
8
+ if (!isRecord$2(data)) return null;
9
+ const deviceId = data["deviceId"];
10
+ const capName = data["capName"];
11
+ const slice = data["slice"];
12
+ if (typeof deviceId !== "number" || typeof capName !== "string") return null;
13
+ if (!isRecord$2(slice)) return null;
14
+ return {
15
+ deviceId,
16
+ capName,
17
+ slice
18
+ };
19
+ }
20
+ /**
21
+ * The same payload with `slice` set to what the DEVICE reported (D1061). While a
22
+ * command hold changes the slice the event carries the effective one in `slice`
23
+ * and the reported one in `confirmed`; history, automations and every
24
+ * decision read this view, so a value the device never confirmed is never
25
+ * recorded or acted on.
26
+ */
27
+ function parseConfirmedStateChanged(data) {
28
+ const parsed = parseDeviceStateChanged(data);
29
+ if (parsed === null || !isRecord$2(data)) return parsed;
30
+ const confirmed = data["confirmed"];
31
+ return isRecord$2(confirmed) ? {
32
+ ...parsed,
33
+ slice: confirmed
34
+ } : parsed;
35
+ }
36
+ //#endregion
2
37
  //#region src/builtins/device-history/store/series-registry.ts
3
38
  function subjectIdOf(subject) {
4
39
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -700,6 +735,18 @@ Object.defineProperty(exports, "isRealDeviceType", {
700
735
  return isRealDeviceType;
701
736
  }
702
737
  });
738
+ Object.defineProperty(exports, "isRecord", {
739
+ enumerable: true,
740
+ get: function() {
741
+ return isRecord$2;
742
+ }
743
+ });
744
+ Object.defineProperty(exports, "parseConfirmedStateChanged", {
745
+ enumerable: true,
746
+ get: function() {
747
+ return parseConfirmedStateChanged;
748
+ }
749
+ });
703
750
  Object.defineProperty(exports, "readPath", {
704
751
  enumerable: true,
705
752
  get: function() {
@@ -1,23 +1,4 @@
1
- import { pu as errMsg, qs as compositionSourceKey } from "./dist-DorY_sjS.mjs";
2
- //#region src/builtins/shared/device-state-changed.ts
3
- /** Structural narrowing helper for untrusted bus payloads. */
4
- function isRecord(value) {
5
- return typeof value === "object" && value !== null && !Array.isArray(value);
6
- }
7
- function parseDeviceStateChanged(data) {
8
- if (!isRecord(data)) return null;
9
- const deviceId = data["deviceId"];
10
- const capName = data["capName"];
11
- const slice = data["slice"];
12
- if (typeof deviceId !== "number" || typeof capName !== "string") return null;
13
- if (!isRecord(slice)) return null;
14
- return {
15
- deviceId,
16
- capName,
17
- slice
18
- };
19
- }
20
- //#endregion
1
+ import { Qs as compositionSourceKey, vu as errMsg } from "./dist-DBanWvHF.mjs";
21
2
  //#region src/builtins/core-blocks/composition-sources.ts
22
3
  /**
23
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -157,4 +138,4 @@ async function describeCompositionSources(ports, sources, targets = [], unionRea
157
138
  };
158
139
  }
159
140
  //#endregion
160
- export { parseDeviceStateChanged as i, normalizedNativeOwner as n, isRecord as r, describeCompositionSources as t };
141
+ export { normalizedNativeOwner as n, describeCompositionSources as t };
@@ -1,23 +1,4 @@
1
- const require_dist = require("./dist-BoEy9sm9.js");
2
- //#region src/builtins/shared/device-state-changed.ts
3
- /** Structural narrowing helper for untrusted bus payloads. */
4
- function isRecord(value) {
5
- return typeof value === "object" && value !== null && !Array.isArray(value);
6
- }
7
- function parseDeviceStateChanged(data) {
8
- if (!isRecord(data)) return null;
9
- const deviceId = data["deviceId"];
10
- const capName = data["capName"];
11
- const slice = data["slice"];
12
- if (typeof deviceId !== "number" || typeof capName !== "string") return null;
13
- if (!isRecord(slice)) return null;
14
- return {
15
- deviceId,
16
- capName,
17
- slice
18
- };
19
- }
20
- //#endregion
1
+ const require_dist = require("./dist-DEAjZE_-.js");
21
2
  //#region src/builtins/core-blocks/composition-sources.ts
22
3
  /**
23
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -163,21 +144,9 @@ Object.defineProperty(exports, "describeCompositionSources", {
163
144
  return describeCompositionSources;
164
145
  }
165
146
  });
166
- Object.defineProperty(exports, "isRecord", {
167
- enumerable: true,
168
- get: function() {
169
- return isRecord;
170
- }
171
- });
172
147
  Object.defineProperty(exports, "normalizedNativeOwner", {
173
148
  enumerable: true,
174
149
  get: function() {
175
150
  return normalizedNativeOwner;
176
151
  }
177
152
  });
178
- Object.defineProperty(exports, "parseDeviceStateChanged", {
179
- enumerable: true,
180
- get: function() {
181
- return parseDeviceStateChanged;
182
- }
183
- });
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-BoEy9sm9.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-DEAjZE_-.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { rl as buildSecretRef } from "./dist-DorY_sjS.mjs";
1
+ import { cl as buildSecretRef } from "./dist-DBanWvHF.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,4 +1,4 @@
1
- import { K as DEVICE_SAN_CREDENTIAL_PREFIX, q as DEVICE_SAN_USER_PREFIX, rl as buildSecretRef } from "./dist-DorY_sjS.mjs";
1
+ import { J as DEVICE_SAN_USER_PREFIX, cl as buildSecretRef, q as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-DBanWvHF.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BoEy9sm9.js");
1
+ const require_dist = require("./dist-DEAjZE_-.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts