@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
@@ -279,15 +279,4 @@ export interface ParentUnownedCallDeps {
279
279
  /** Optional logger for the broker-fallback diagnostic line. */
280
280
  readonly logger?: ParentUnownedCallLogger;
281
281
  }
282
- /**
283
- * Build the `onUnownedCall` handler the hub / agent passes into
284
- * `new LocalChildRegistry({ ..., onUnownedCall })`.
285
- *
286
- * The returned handler:
287
- * - tries the resolver first (when present),
288
- * - falls back to the broker for `no-provider` resolver misses (the
289
- * `$`-infra / core services), and
290
- * - surfaces a clear error when the call is genuinely unroutable (so the
291
- * child's call rejects rather than hanging).
292
- */
293
282
  export declare function createParentUnownedCallHandler(deps: ParentUnownedCallDeps): (input: CapCallInput) => Promise<unknown>;
@@ -1,4 +1,4 @@
1
- import { Qs as collectSecretMarkerRefs } from "./dist-DjBZ1HhF.mjs";
1
+ import { $s as collectSecretMarkerRefs } from "./dist-BgRMQHuL.mjs";
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -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/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -0,0 +1,101 @@
1
+ import { al as errMsg, tl as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./dist-BgRMQHuL.mjs";
2
+ //#region src/builtins/core-blocks/rename-composition-block.ts
3
+ /**
4
+ * An operator rename of a composed device writes the composition block's
5
+ * name, so the next composer apply does not put the old name back (D659).
6
+ * Name-only: the composition body is not touched, and a customization (which
7
+ * has no name of its own) is never a composed device.
8
+ */
9
+ /** `CoreBlockSchema` / `ComposerBlockSchema` name max. A longer device name cannot be stored on the block. */
10
+ var BLOCK_NAME_MAX = 120;
11
+ /** The block id behind a composed device, or null when the row is not one. */
12
+ function composedBlockIdOf(addonId, stableId) {
13
+ if (addonId !== "composer") return null;
14
+ if (!stableId.startsWith("composed-")) return null;
15
+ const blockId = stableId.slice(COMPOSED_DEVICE_STABLE_ID_PREFIX.length);
16
+ return blockId.length === 0 ? null : blockId;
17
+ }
18
+ function lookupBlockName(read, blockId) {
19
+ if (read.state === "not-loaded") return {
20
+ kind: "skip",
21
+ reason: "core_blocks has not loaded"
22
+ };
23
+ if (read.view === null) return {
24
+ kind: "skip",
25
+ reason: `no composition "${blockId}"`
26
+ };
27
+ return {
28
+ kind: "ready",
29
+ block: {
30
+ name: read.view.block.name,
31
+ updatedAt: read.view.block.updatedAt
32
+ }
33
+ };
34
+ }
35
+ async function writeBlockName(api, blockId, name) {
36
+ const found = lookupBlockName(await api.coreBlocks.getComposition.query({ blockId }), blockId);
37
+ if (found.kind === "skip" || found.block.name === name) return found;
38
+ await api.coreBlocks.updateComposition.mutate({
39
+ blockId,
40
+ expectedUpdatedAt: found.block.updatedAt,
41
+ block: { name }
42
+ });
43
+ return found;
44
+ }
45
+ /**
46
+ * Make the stored block name `name`. A conflict with a save that landed
47
+ * between the read and the write is retried once. A failure is logged and
48
+ * swallowed: the device rename has already landed, and the composer's next
49
+ * apply writes the block again.
50
+ */
51
+ async function renameCompositionBlock(api, logger, deviceId, blockId, name) {
52
+ if (name.length < 1 || name.length > BLOCK_NAME_MAX) {
53
+ logger.warn("composed rename did not reach the block — the name is outside what a block stores", {
54
+ tags: { deviceId },
55
+ meta: {
56
+ blockId,
57
+ length: name.length
58
+ }
59
+ });
60
+ return;
61
+ }
62
+ try {
63
+ const found = await writeBlockName(api, blockId, name);
64
+ if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
65
+ tags: { deviceId },
66
+ meta: {
67
+ blockId,
68
+ reason: found.reason
69
+ }
70
+ });
71
+ } catch (err) {
72
+ const message = errMsg(err);
73
+ if (!message.includes("changed since you read it")) {
74
+ logBlockRenameFailed(logger, deviceId, blockId, message);
75
+ return;
76
+ }
77
+ try {
78
+ const found = await writeBlockName(api, blockId, name);
79
+ if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
80
+ tags: { deviceId },
81
+ meta: {
82
+ blockId,
83
+ reason: found.reason
84
+ }
85
+ });
86
+ } catch (retryErr) {
87
+ logBlockRenameFailed(logger, deviceId, blockId, errMsg(retryErr));
88
+ }
89
+ }
90
+ }
91
+ function logBlockRenameFailed(logger, deviceId, blockId, error) {
92
+ logger.warn("composed rename did not reach the block — retried on the next apply", {
93
+ tags: { deviceId },
94
+ meta: {
95
+ blockId,
96
+ error
97
+ }
98
+ });
99
+ }
100
+ //#endregion
101
+ export { renameCompositionBlock as n, composedBlockIdOf as t };
@@ -0,0 +1,112 @@
1
+ const require_dist = require("./dist-BpTL3uNe.js");
2
+ //#region src/builtins/core-blocks/rename-composition-block.ts
3
+ /**
4
+ * An operator rename of a composed device writes the composition block's
5
+ * name, so the next composer apply does not put the old name back (D659).
6
+ * Name-only: the composition body is not touched, and a customization (which
7
+ * has no name of its own) is never a composed device.
8
+ */
9
+ /** `CoreBlockSchema` / `ComposerBlockSchema` name max. A longer device name cannot be stored on the block. */
10
+ var BLOCK_NAME_MAX = 120;
11
+ /** The block id behind a composed device, or null when the row is not one. */
12
+ function composedBlockIdOf(addonId, stableId) {
13
+ if (addonId !== "composer") return null;
14
+ if (!stableId.startsWith("composed-")) return null;
15
+ const blockId = stableId.slice(require_dist.COMPOSED_DEVICE_STABLE_ID_PREFIX.length);
16
+ return blockId.length === 0 ? null : blockId;
17
+ }
18
+ function lookupBlockName(read, blockId) {
19
+ if (read.state === "not-loaded") return {
20
+ kind: "skip",
21
+ reason: "core_blocks has not loaded"
22
+ };
23
+ if (read.view === null) return {
24
+ kind: "skip",
25
+ reason: `no composition "${blockId}"`
26
+ };
27
+ return {
28
+ kind: "ready",
29
+ block: {
30
+ name: read.view.block.name,
31
+ updatedAt: read.view.block.updatedAt
32
+ }
33
+ };
34
+ }
35
+ async function writeBlockName(api, blockId, name) {
36
+ const found = lookupBlockName(await api.coreBlocks.getComposition.query({ blockId }), blockId);
37
+ if (found.kind === "skip" || found.block.name === name) return found;
38
+ await api.coreBlocks.updateComposition.mutate({
39
+ blockId,
40
+ expectedUpdatedAt: found.block.updatedAt,
41
+ block: { name }
42
+ });
43
+ return found;
44
+ }
45
+ /**
46
+ * Make the stored block name `name`. A conflict with a save that landed
47
+ * between the read and the write is retried once. A failure is logged and
48
+ * swallowed: the device rename has already landed, and the composer's next
49
+ * apply writes the block again.
50
+ */
51
+ async function renameCompositionBlock(api, logger, deviceId, blockId, name) {
52
+ if (name.length < 1 || name.length > BLOCK_NAME_MAX) {
53
+ logger.warn("composed rename did not reach the block — the name is outside what a block stores", {
54
+ tags: { deviceId },
55
+ meta: {
56
+ blockId,
57
+ length: name.length
58
+ }
59
+ });
60
+ return;
61
+ }
62
+ try {
63
+ const found = await writeBlockName(api, blockId, name);
64
+ if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
65
+ tags: { deviceId },
66
+ meta: {
67
+ blockId,
68
+ reason: found.reason
69
+ }
70
+ });
71
+ } catch (err) {
72
+ const message = require_dist.errMsg(err);
73
+ if (!message.includes("changed since you read it")) {
74
+ logBlockRenameFailed(logger, deviceId, blockId, message);
75
+ return;
76
+ }
77
+ try {
78
+ const found = await writeBlockName(api, blockId, name);
79
+ if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
80
+ tags: { deviceId },
81
+ meta: {
82
+ blockId,
83
+ reason: found.reason
84
+ }
85
+ });
86
+ } catch (retryErr) {
87
+ logBlockRenameFailed(logger, deviceId, blockId, require_dist.errMsg(retryErr));
88
+ }
89
+ }
90
+ }
91
+ function logBlockRenameFailed(logger, deviceId, blockId, error) {
92
+ logger.warn("composed rename did not reach the block — retried on the next apply", {
93
+ tags: { deviceId },
94
+ meta: {
95
+ blockId,
96
+ error
97
+ }
98
+ });
99
+ }
100
+ //#endregion
101
+ Object.defineProperty(exports, "composedBlockIdOf", {
102
+ enumerable: true,
103
+ get: function() {
104
+ return composedBlockIdOf;
105
+ }
106
+ });
107
+ Object.defineProperty(exports, "renameCompositionBlock", {
108
+ enumerable: true,
109
+ get: function() {
110
+ return renameCompositionBlock;
111
+ }
112
+ });
@@ -1,4 +1,4 @@
1
- import { P as DATABASE_SNAPSHOT_SUFFIX, X as DataStoreDatabaseSchema, sc as defineRecordKinds } from "./dist-DjBZ1HhF.mjs";
1
+ import { F as DATABASE_SNAPSHOT_SUFFIX, Z as DataStoreDatabaseSchema, cc as defineRecordKinds } from "./dist-BgRMQHuL.mjs";
2
2
  import { z } from "zod";
3
3
  import { createCipheriv, createDecipheriv, createHash, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from "node:crypto";
4
4
  import { Buffer as Buffer$1 } from "buffer";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-C2czR9xK.js");
2
+ const require_dist = require("./dist-BpTL3uNe.js");
3
3
  let zod = require("zod");
4
4
  let node_crypto = require("node:crypto");
5
5
  let buffer = require("buffer");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.822",
3
+ "version": "1.2.824",
4
4
  "description": "CamStack builtins — shipped inside @camstack/server (generated, do not edit)",
5
5
  "license": "MIT",
6
6
  "camstack": {