@camstack/server 1.2.822 → 1.2.824

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 (109) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-routers.js +0 -45
  3. package/package.json +11 -11
  4. package/system/dist/addon-runner.js +42 -15
  5. package/system/dist/addon-runner.mjs +43 -16
  6. package/system/dist/addon-utils.d.ts +1 -0
  7. package/system/dist/addon-utils.js +2 -0
  8. package/system/dist/addon-utils.mjs +2 -1
  9. package/system/dist/{agent-https-SGBI0xP8.js → agent-https-B2nqARmj.js} +1 -1
  10. package/system/dist/{agent-https-C4yxMErF.mjs → agent-https-BBO2OtNH.mjs} +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  14. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  15. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  16. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  17. package/system/dist/builtins/autotrack/index.js +1 -1
  18. package/system/dist/builtins/autotrack/index.mjs +1 -1
  19. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  20. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  21. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  22. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  23. package/system/dist/builtins/camera-grid/index.js +1 -1
  24. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  25. package/system/dist/builtins/composer/composed-device-set.d.ts +5 -1
  26. package/system/dist/builtins/composer/composed-device.d.ts +4 -0
  27. package/system/dist/builtins/composer/composed-name.d.ts +30 -0
  28. package/system/dist/builtins/composer/composer.addon.js +94 -6
  29. package/system/dist/builtins/composer/composer.addon.mjs +94 -6
  30. package/system/dist/builtins/composer/composer.d.ts +13 -0
  31. package/system/dist/builtins/console-logging/index.js +1 -1
  32. package/system/dist/builtins/console-logging/index.mjs +1 -1
  33. package/system/dist/builtins/core-blocks/actions-service.d.ts +8 -0
  34. package/system/dist/builtins/core-blocks/composition-api.d.ts +6 -0
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.js +143 -23
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +144 -24
  37. package/system/dist/builtins/core-blocks/record-kinds.d.ts +1 -0
  38. package/system/dist/builtins/core-blocks/rename-composition-block.d.ts +16 -0
  39. package/system/dist/builtins/core-blocks/sync-composed-device-name.d.ts +19 -0
  40. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  42. package/system/dist/builtins/device-manager/device-manager.addon.js +43 -4
  43. package/system/dist/builtins/device-manager/device-manager.addon.mjs +43 -4
  44. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  45. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  46. package/system/dist/builtins/keychain/index.js +4 -4
  47. package/system/dist/builtins/keychain/index.mjs +4 -4
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  49. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  50. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  51. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  52. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  53. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  54. package/system/dist/builtins/loki-logging/index.js +1 -1
  55. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  57. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  58. package/system/dist/builtins/platform-probe/index.js +1 -1
  59. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  60. package/system/dist/builtins/record-entries/index.js +1 -1
  61. package/system/dist/builtins/record-entries/index.mjs +1 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  63. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  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 +3 -3
  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/cap-call-scope-8eiugfLl.js +46 -0
  79. package/system/dist/cap-call-scope-Bic6Ekfw.mjs +30 -0
  80. package/system/dist/{capture-engine-BSjE-CQA.mjs → capture-engine-C-rHYVFq.mjs} +1 -1
  81. package/system/dist/{capture-engine-6MVUyUry.js → capture-engine-DP4HbT3W.js} +1 -1
  82. package/system/dist/{composition-sources-C8T9DRbZ.mjs → composition-sources-CL9JFN4y.mjs} +1 -1
  83. package/system/dist/{composition-sources-BBAOXZdC.js → composition-sources-CM9c_jAj.js} +1 -1
  84. package/system/dist/{constants-CReG6K4k.mjs → constants-DzGFnCKZ.mjs} +1 -1
  85. package/system/dist/{constants-v0g9--wN.js → constants-jk7JccZ0.js} +1 -1
  86. package/system/dist/{device-ca-BFcBTfff.js → device-ca-B7_R5WJh.js} +1 -1
  87. package/system/dist/{device-ca-cX8qUs2s.mjs → device-ca-DZ_OQiCc.mjs} +1 -1
  88. package/system/dist/{dist-DjBZ1HhF.mjs → dist-BgRMQHuL.mjs} +171 -184
  89. package/system/dist/{dist-C2czR9xK.js → dist-BpTL3uNe.js} +188 -183
  90. package/system/dist/file-host-worker.js +1 -1
  91. package/system/dist/file-host-worker.mjs +1 -1
  92. package/system/dist/{hub-mdns-ciao-Cnr8xiSd.mjs → hub-mdns-ciao-DIcBingB.mjs} +2 -2
  93. package/system/dist/{hub-mdns-ciao-CpCleue0.js → hub-mdns-ciao-DPUaYAD3.js} +2 -2
  94. package/system/dist/index.d.ts +1 -0
  95. package/system/dist/index.js +65 -42
  96. package/system/dist/index.mjs +64 -44
  97. package/system/dist/kernel/cap-call-scope.d.ts +10 -0
  98. package/system/dist/kernel/transport/cap-route-resolver.d.ts +27 -1
  99. package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
  100. package/system/dist/kernel/transport/parent-unowned-call.d.ts +0 -11
  101. package/system/dist/{legacy-integration-rows-door-CGajkVPh.mjs → legacy-integration-rows-door-1GnkpMgH.mjs} +1 -1
  102. package/system/dist/{legacy-integration-rows-door-DhW6mPZj.js → legacy-integration-rows-door-DYNePgj4.js} +1 -1
  103. package/system/dist/rename-composition-block-Cp0_nwAI.mjs +101 -0
  104. package/system/dist/rename-composition-block-Dn2z4fnA.js +112 -0
  105. package/system/dist/{restore-archive-eA7L58KT.mjs → restore-archive-B3FEpUfz.mjs} +1 -1
  106. package/system/dist/{restore-archive-BLab80kx.js → restore-archive-BGa5pdp9.js} +1 -1
  107. package/system/dist/{wal-maintenance-DeBxoOFh.mjs → wal-maintenance-BLWLlVfF.mjs} +0 -0
  108. package/system/dist/{wal-maintenance-DhnSF7K-.js → wal-maintenance-GWFxnSnE.js} +0 -0
  109. package/system/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ let _camstack_types_addon = require("@camstack/types/addon");
2
+ //#region src/kernel/cap-call-scope.ts
3
+ /**
4
+ * The command-origin claim of the cap call currently running (D1022).
5
+ *
6
+ * A provider method is invoked with its args only — the claim rides out of band,
7
+ * the same way `commandOrigin` puts it on a tRPC call. The dispatch that is about
8
+ * to call the provider enters this scope, and the provider reads it back with
9
+ * {@link readCommandOrigin}. The store does not cross a process: the parent copies
10
+ * the claim onto the child `cap-call`, and the child enters the scope again.
11
+ */
12
+ var scope = new (require("node:async_hooks")).AsyncLocalStorage();
13
+ /** The tRPC-shaped context of the cap call on this stack, or `undefined` outside one. */
14
+ function currentCapCallContext() {
15
+ return scope.getStore();
16
+ }
17
+ /** The command origin of the cap call on this stack, if the call carried a well-formed one. */
18
+ function readCurrentCommandOrigin() {
19
+ return (0, _camstack_types_addon.readCommandOrigin)(scope.getStore());
20
+ }
21
+ /**
22
+ * Run `fn` as a cap call whose context is `context` (`commandOrigin(claim).context`,
23
+ * or the raw `op.context`). `undefined` is a call that carried no claim.
24
+ */
25
+ function runWithCapCallContext(context, fn) {
26
+ return scope.run(context, fn);
27
+ }
28
+ //#endregion
29
+ Object.defineProperty(exports, "currentCapCallContext", {
30
+ enumerable: true,
31
+ get: function() {
32
+ return currentCapCallContext;
33
+ }
34
+ });
35
+ Object.defineProperty(exports, "readCurrentCommandOrigin", {
36
+ enumerable: true,
37
+ get: function() {
38
+ return readCurrentCommandOrigin;
39
+ }
40
+ });
41
+ Object.defineProperty(exports, "runWithCapCallContext", {
42
+ enumerable: true,
43
+ get: function() {
44
+ return runWithCapCallContext;
45
+ }
46
+ });
@@ -0,0 +1,30 @@
1
+ import { readCommandOrigin } from "@camstack/types/addon";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ //#region src/kernel/cap-call-scope.ts
4
+ /**
5
+ * The command-origin claim of the cap call currently running (D1022).
6
+ *
7
+ * A provider method is invoked with its args only — the claim rides out of band,
8
+ * the same way `commandOrigin` puts it on a tRPC call. The dispatch that is about
9
+ * to call the provider enters this scope, and the provider reads it back with
10
+ * {@link readCommandOrigin}. The store does not cross a process: the parent copies
11
+ * the claim onto the child `cap-call`, and the child enters the scope again.
12
+ */
13
+ var scope = new AsyncLocalStorage();
14
+ /** The tRPC-shaped context of the cap call on this stack, or `undefined` outside one. */
15
+ function currentCapCallContext() {
16
+ return scope.getStore();
17
+ }
18
+ /** The command origin of the cap call on this stack, if the call carried a well-formed one. */
19
+ function readCurrentCommandOrigin() {
20
+ return readCommandOrigin(scope.getStore());
21
+ }
22
+ /**
23
+ * Run `fn` as a cap call whose context is `context` (`commandOrigin(claim).context`,
24
+ * or the raw `op.context`). `undefined` is a call that carried no claim.
25
+ */
26
+ function runWithCapCallContext(context, fn) {
27
+ return scope.run(context, fn);
28
+ }
29
+ //#endregion
30
+ export { readCurrentCommandOrigin as n, runWithCapCallContext as r, currentCapCallContext as t };
@@ -1,4 +1,4 @@
1
- import { gs as HISTORY_DEFAULT_MIN_INTERVAL_MS, mc as historyItemFieldPath, tl as DeviceType } from "./dist-DjBZ1HhF.mjs";
1
+ import { _s as HISTORY_DEFAULT_MIN_INTERVAL_MS, hc as historyItemFieldPath, il as DeviceType } from "./dist-BgRMQHuL.mjs";
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C2czR9xK.js");
1
+ const require_dist = require("./dist-BpTL3uNe.js");
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- import { Ho as compositionSourceKey, nl as errMsg } from "./dist-DjBZ1HhF.mjs";
1
+ import { Uo as compositionSourceKey, al as errMsg } from "./dist-BgRMQHuL.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C2czR9xK.js");
1
+ const require_dist = require("./dist-BpTL3uNe.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Ys as buildSecretRef } from "./dist-DjBZ1HhF.mjs";
1
+ import { Xs as buildSecretRef } from "./dist-BgRMQHuL.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,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-C2czR9xK.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-BpTL3uNe.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C2czR9xK.js");
1
+ const require_dist = require("./dist-BpTL3uNe.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
@@ -1,4 +1,4 @@
1
- import { G as DEVICE_SAN_USER_PREFIX, W as DEVICE_SAN_CREDENTIAL_PREFIX, Ys as buildSecretRef } from "./dist-DjBZ1HhF.mjs";
1
+ import { G as DEVICE_SAN_CREDENTIAL_PREFIX, K as DEVICE_SAN_USER_PREFIX, Xs as buildSecretRef } from "./dist-BgRMQHuL.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