@camstack/server 1.2.768 → 1.2.770

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 (100) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/core/cap-providers.js +4 -193
  3. package/dist/api/trpc/generated-cap-routers.js +40 -30
  4. package/dist/core/addon/integration-visibility.js +0 -5
  5. package/package.json +36 -12
  6. package/system/dist/addon-runner.js +7 -1
  7. package/system/dist/addon-runner.mjs +7 -1
  8. package/system/dist/{agent-https-D03iyjJk.mjs → agent-https-BGRPCKwT.mjs} +1 -1
  9. package/system/dist/{agent-https-D62iihRo.js → agent-https-mq6d71iq.js} +1 -1
  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.d.ts +15 -0
  15. package/system/dist/builtins/alerts/alerts.addon.js +104 -4
  16. package/system/dist/builtins/alerts/alerts.addon.mjs +104 -4
  17. package/system/dist/builtins/alerts/cluster-state-alerts.d.ts +32 -0
  18. package/system/dist/builtins/autotrack/index.js +1 -1
  19. package/system/dist/builtins/autotrack/index.mjs +1 -1
  20. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  21. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  22. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  23. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  24. package/system/dist/builtins/camera-grid/index.js +1 -1
  25. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  26. package/system/dist/builtins/composer/composer.addon.js +5 -4
  27. package/system/dist/builtins/composer/composer.addon.mjs +5 -4
  28. package/system/dist/builtins/console-logging/index.js +1 -1
  29. package/system/dist/builtins/console-logging/index.mjs +1 -1
  30. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  31. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  32. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  33. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  34. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  35. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  36. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  37. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  38. package/system/dist/builtins/keychain/index.js +17 -10
  39. package/system/dist/builtins/keychain/index.mjs +17 -10
  40. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  41. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  42. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  43. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  44. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  45. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  46. package/system/dist/builtins/loki-logging/index.js +1 -1
  47. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  48. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  49. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  50. package/system/dist/builtins/platform-probe/index.js +1 -1
  51. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  52. package/system/dist/builtins/record-entries/index.js +1 -1
  53. package/system/dist/builtins/record-entries/index.mjs +1 -1
  54. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  55. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  56. package/system/dist/builtins/snapshot/index.js +1 -1
  57. package/system/dist/builtins/snapshot/index.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  61. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  62. package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +3 -10
  63. package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +1 -11
  64. package/system/dist/builtins/sqlite-storage/integration-rows-ports.d.ts +13 -15
  65. package/system/dist/builtins/sqlite-storage/migrations/legacy-integration-rows-door.d.ts +31 -0
  66. package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +39 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +48 -5
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +48 -5
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  73. package/system/dist/builtins/winston-logging/index.js +1 -1
  74. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  75. package/system/dist/{capture-engine-BpoL1zQ0.js → capture-engine--FQ8NUHh.js} +1 -1
  76. package/system/dist/{capture-engine-CYmRx0Ce.mjs → capture-engine-Cmx7DIzV.mjs} +1 -1
  77. package/system/dist/{composition-sources-CknQxftO.mjs → composition-sources-Bd09D5f4.mjs} +1 -1
  78. package/system/dist/{composition-sources-B7VyYbEU.js → composition-sources-cvZAN87H.js} +1 -1
  79. package/system/dist/{constants-C9Gxs1jW.mjs → constants-Dce28BAx.mjs} +1 -1
  80. package/system/dist/{constants-DJqUggkW.js → constants-gM9xHjyj.js} +1 -1
  81. package/system/dist/{device-ca-9BTS4o-T.js → device-ca-BmeH6Y9E.js} +1 -1
  82. package/system/dist/{device-ca-D76OqRnW.mjs → device-ca-DcMuT-Yp.mjs} +1 -1
  83. package/system/dist/{dist-BhR34kF8.mjs → dist-C3WXy3Ix.mjs} +185 -84
  84. package/system/dist/{dist-DLVfdGSW.js → dist-Dtw1sIeQ.js} +185 -84
  85. package/system/dist/file-host-worker.js +1 -1
  86. package/system/dist/file-host-worker.mjs +1 -1
  87. package/system/dist/{hub-mdns-ciao-DimaT9WQ.js → hub-mdns-ciao-C49eqyby.js} +2 -2
  88. package/system/dist/{hub-mdns-ciao-i31GIYWP.mjs → hub-mdns-ciao-Dfue_0kR.mjs} +2 -2
  89. package/system/dist/index.d.ts +1 -1
  90. package/system/dist/index.js +49 -231
  91. package/system/dist/index.mjs +58 -240
  92. package/system/dist/legacy-integration-rows-door-B8_XCqUX.js +290 -0
  93. package/system/dist/legacy-integration-rows-door-DK42Bh2Q.mjs +255 -0
  94. package/system/dist/migrations/hub/2026-11-05-drop-integration-settings.d.ts +16 -0
  95. package/system/dist/{restore-archive-nWi73iy0.mjs → restore-archive-C0YDO-qd.mjs} +82 -82
  96. package/system/dist/{restore-archive-BkiXu43U.js → restore-archive-DuktQtye.js} +1 -1
  97. package/system/dist/{wal-maintenance-UQEtPem2.js → wal-maintenance-BEo-y-cQ.js} +0 -0
  98. package/system/dist/{wal-maintenance-DG2bwMif.mjs → wal-maintenance-DhuvKiGK.mjs} +0 -0
  99. package/system/package.json +1 -1
  100. package/dist/api/core/integration-secrets.js +0 -96
package/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.770] - 2026-11-05
11
+
12
+ ### Removed
13
+
14
+ - The hub no longer keeps a second settings store: create writes the instance record, and settings with no instance provider are dropped
15
+
16
+ ## [1.2.769] - 2026-11-05
17
+
18
+ ### Changed
19
+
20
+ - A finished appliance cycle's duration excludes the stop delay, and a short pulse after a cycle no longer extends it
21
+
22
+ ### Fixed
23
+
24
+ - An agent-offline alert resolves when that agent is back online, and a system-restarting alert resolves when the restart completed or the node is back, even if the online event was dropped
25
+
10
26
  ## [1.2.768] - 2026-11-04
11
27
 
12
28
  ### Changed
@@ -72,7 +72,6 @@ exports.dispatchCustomAction = dispatchCustomAction;
72
72
  exports.buildAddonsProvider = buildAddonsProvider;
73
73
  const integration_role_js_1 = require("./integration-role.js");
74
74
  const integration_instances_provider_js_1 = require("../../core/addon/integration-instances-provider.js");
75
- const integration_secrets_1 = require("./integration-secrets");
76
75
  const node_crypto_1 = require("node:crypto");
77
76
  const os = __importStar(require("node:os"));
78
77
  const system_1 = require("@camstack/server/system");
@@ -751,39 +750,6 @@ function buildNodesProvider(agentRegistry, moleculer, addonRegistry, getNodeRoot
751
750
  },
752
751
  };
753
752
  }
754
- /**
755
- * The keychain handle a hub door uses for an integration's addon (D787), or
756
- * `null` when this registry predates the keychain (a test double, an older
757
- * kernel) — the door then stores the settings as it always did.
758
- */
759
- function ownerSecrets(ar, owner) {
760
- return typeof ar.secretsForOwner === 'function' ? ar.secretsForOwner(owner) : null;
761
- }
762
- /**
763
- * The integration settings keys the addon's own form stores in the keychain
764
- * (by schema type, D783) — so the admin read can withhold a plaintext under one
765
- * of them. Empty when the schema cannot be read (logged): markers are still
766
- * withheld, and a coerced marker is caught without a schema.
767
- */
768
- async function integrationSecretKeys(ar, addonId, logger) {
769
- try {
770
- const provider = ar
771
- .getCapabilityRegistry()
772
- .getSingleton('addon-settings');
773
- const schema = await provider?.getGlobalSettings({
774
- addonId,
775
- nodeId: 'hub',
776
- });
777
- return (0, types_1.collectKeychainStoredKeys)(schema ?? null);
778
- }
779
- catch (err) {
780
- logger.warn('integration settings: addon schema unreadable — plaintext secrets not detectable', {
781
- tags: { addonId },
782
- meta: { phase: 'getSettings', error: (0, types_1.errMsg)(err) },
783
- });
784
- return new Set();
785
- }
786
- }
787
753
  function requireIntegrationRegistry(ar) {
788
754
  const reg = ar.getIntegrationRegistry();
789
755
  if (!reg)
@@ -1027,9 +993,7 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
1027
993
  },
1028
994
  getByAddonId: async (input) => requireIntegrationRegistry(ar).getIntegrationByAddonId(input.addonId),
1029
995
  create: async (input) => {
1030
- const { skipRestart, secretKeys, settings, ...rest } = input;
1031
- // Settings are written AFTER the row exists: a secret's ref is scoped
1032
- // to the integration id (D787).
996
+ const { settings, ...rest } = input;
1033
997
  const payload = rest;
1034
998
  const reg = requireIntegrationRegistry(ar);
1035
999
  logger.info('request', {
@@ -1143,40 +1107,15 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
1143
1107
  return integration;
1144
1108
  }
1145
1109
  if (settings !== undefined && Object.keys(settings).length > 0) {
1146
- await (0, integration_secrets_1.writeIntegrationSettings)({
1147
- registry: reg,
1148
- secrets: ownerSecrets(ar, integration.addonId),
1149
- onOrphaned: (refs) => logger.warn('dropped keychain refs could not be deleted', {
1150
- meta: { refs: [...refs] },
1151
- }),
1152
- }, {
1153
- integrationId: integration.id,
1154
- settings,
1155
- secretKeys: secretKeys ?? [],
1156
- operatorWrite: true,
1110
+ logger.warn('settings dropped — the addon has no instance record to store them', {
1111
+ tags: { integrationId: integration.id, addonId: integration.addonId },
1112
+ meta: { phase: 'create', keys: Object.keys(settings) },
1157
1113
  });
1158
1114
  }
1159
1115
  logger.info('persisted', {
1160
1116
  tags: { integrationId: integration.id, addonId: integration.addonId },
1161
1117
  meta: { phase: 'create' },
1162
1118
  });
1163
- const hasSettings = settings != null && Object.keys(settings).length > 0;
1164
- if (!skipRestart && hasSettings) {
1165
- logger.info('settings present — restarting addon', {
1166
- tags: { addonId: input.addonId },
1167
- meta: { phase: 'create' },
1168
- });
1169
- await ar.restartAddon(input.addonId);
1170
- logger.info('addon restart complete', {
1171
- tags: { addonId: input.addonId },
1172
- meta: { phase: 'create' },
1173
- });
1174
- }
1175
- else {
1176
- logger.info('skipping restart (no settings or skipRestart=true)', {
1177
- meta: { phase: 'create' },
1178
- });
1179
- }
1180
1119
  return integration;
1181
1120
  },
1182
1121
  update: async (input) => {
@@ -1363,134 +1302,6 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
1363
1302
  });
1364
1303
  return { success: true, deletedId: input.id };
1365
1304
  },
1366
- getSettings: async (input) => {
1367
- const reg = requireIntegrationRegistry(ar);
1368
- const integration = await reg.getIntegration(input.id);
1369
- if (!integration)
1370
- throw new Error(`Integration "${input.id}" not found`);
1371
- const instances = getInstancesProvider(ar, integration.addonId);
1372
- if (instances !== null) {
1373
- const instance = await instances.getInstance({ id: input.id });
1374
- if (instance !== null && instance !== undefined)
1375
- return instance.formValues;
1376
- // No instance record carries this id: it is a legacy row the addon has not moved yet
1377
- // (its migration reads it here), so answer the row, never an empty object (D1007).
1378
- }
1379
- // The integration's own addon (the caller the transport stamped) reads
1380
- // its secrets resolved; anyone else — the admin form — reads "set"
1381
- // views, never a value (D787, D789).
1382
- const caller = Reflect.get(input, 'callerAddonId');
1383
- const forOwner = typeof caller === 'string' &&
1384
- (caller === integration.addonId || ar.runnerIdFor(integration.addonId) === caller);
1385
- // The schema is asked only for the admin read: the owner reads this at
1386
- // its own boot, and asking it for its schema then would call back into it.
1387
- const secretKeys = forOwner
1388
- ? undefined
1389
- : await integrationSecretKeys(ar, integration.addonId, logger);
1390
- return (0, integration_secrets_1.readIntegrationSettings)({
1391
- registry: reg,
1392
- secrets: forOwner ? ownerSecrets(ar, integration.addonId) : null,
1393
- }, {
1394
- integrationId: input.id,
1395
- forOwner,
1396
- ...(secretKeys !== undefined ? { secretKeys } : {}),
1397
- onSuspectSecret: (suspect) => logger.error(suspect.kind === 'coerced-marker'
1398
- ? 'integration secret is "[object Object]" — a keychain marker was coerced to text; the addon is sending it as the credential; re-type it'
1399
- : 'integration secret stored as PLAINTEXT under a keychain-declared key — withheld from the form; re-type it to move it into the keychain', {
1400
- tags: { integrationId: input.id, addonId: integration.addonId },
1401
- meta: {
1402
- phase: 'getSettings',
1403
- key: suspect.key,
1404
- kind: suspect.kind,
1405
- forOwner,
1406
- },
1407
- }),
1408
- });
1409
- },
1410
- setSettings: async (input) => {
1411
- const reg = requireIntegrationRegistry(ar);
1412
- const integration = await reg.getIntegration(input.id);
1413
- if (!integration) {
1414
- logger.warn('not found', {
1415
- tags: { integrationId: input.id },
1416
- meta: { phase: 'setSettings' },
1417
- });
1418
- throw new Error(`Integration "${input.id}" not found`);
1419
- }
1420
- const settingsKeys = Object.keys(input.settings);
1421
- logger.info('request', {
1422
- tags: { integrationId: input.id, addonId: integration.addonId },
1423
- meta: { phase: 'setSettings', keys: settingsKeys },
1424
- });
1425
- const instances = getInstancesProvider(ar, integration.addonId);
1426
- if (instances !== null) {
1427
- // The addon re-applies the change itself (its `onChanged`): no respawn.
1428
- await instances.updateInstance({
1429
- id: input.id,
1430
- values: input.settings,
1431
- });
1432
- logger.info('persisted as an instance record (no restart)', {
1433
- tags: { integrationId: input.id, addonId: integration.addonId },
1434
- meta: { phase: 'setSettings' },
1435
- });
1436
- return { success: true };
1437
- }
1438
- await (0, integration_secrets_1.writeIntegrationSettings)({
1439
- registry: reg,
1440
- secrets: ownerSecrets(ar, integration.addonId),
1441
- onOrphaned: (refs) => logger.warn('dropped keychain refs could not be deleted', {
1442
- meta: { refs: [...refs] },
1443
- }),
1444
- }, {
1445
- integrationId: input.id,
1446
- settings: input.settings,
1447
- secretKeys: input.secretKeys ?? [],
1448
- // The integration's own addon writing back is not the operator.
1449
- operatorWrite: typeof Reflect.get(input, 'callerAddonId') !== 'string',
1450
- });
1451
- // Only the integration's own addon may skip the respawn: it reconciles
1452
- // the change in-process, so an unrelated caller cannot leave an addon
1453
- // running on settings it never reloaded.
1454
- const callerAddon = Reflect.get(input, 'callerAddonId');
1455
- if (input.skipRestart === true &&
1456
- typeof callerAddon === 'string' &&
1457
- (callerAddon === integration.addonId || ar.runnerIdFor(integration.addonId) === callerAddon)) {
1458
- logger.info('persisted — the owner applies it in-process, no restart', {
1459
- tags: { addonId: integration.addonId },
1460
- meta: { phase: 'setSettings' },
1461
- });
1462
- return { success: true };
1463
- }
1464
- logger.info('persisted — restarting addon', {
1465
- tags: { addonId: integration.addonId },
1466
- meta: { phase: 'setSettings' },
1467
- });
1468
- await ar.restartAddon(integration.addonId);
1469
- logger.info('addon restart complete', {
1470
- tags: { addonId: integration.addonId },
1471
- meta: { phase: 'setSettings' },
1472
- });
1473
- return { success: true };
1474
- },
1475
- clearSettings: async (input) => {
1476
- const reg = requireIntegrationRegistry(ar);
1477
- const integration = await reg.getIntegration(input.id);
1478
- if (!integration)
1479
- throw new Error(`Integration "${input.id}" not found`);
1480
- // Only the integration's own addon clears its rows, after it moved them (D1007).
1481
- const caller = Reflect.get(input, 'callerAddonId');
1482
- const isOwner = typeof caller === 'string' &&
1483
- (caller === integration.addonId || ar.runnerIdFor(integration.addonId) === caller);
1484
- if (!isOwner) {
1485
- throw new Error(`Integration "${input.id}" settings can be cleared only by its own addon (${integration.addonId})`);
1486
- }
1487
- const cleared = await (0, system_1.clearIntegrationRows)({ registry: reg, secrets: ownerSecrets(ar, integration.addonId) }, input.id);
1488
- logger.info('legacy settings cleared', {
1489
- tags: { integrationId: input.id, addonId: integration.addonId },
1490
- meta: { phase: 'clearSettings', ...cleared },
1491
- });
1492
- return cleared;
1493
- },
1494
1305
  getAvailableTypes: async () => {
1495
1306
  const reg = requireIntegrationRegistry(ar);
1496
1307
  const addons = ar.listAddons();
@@ -5576,36 +5576,6 @@ function createCapRouter_integrations(getProvider, createRemoteProxy) {
5576
5576
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5577
5577
  return p.delete(methodInput);
5578
5578
  }),
5579
- getSettings: trpc_middleware_js_1.adminProcedure
5580
- .input(types_72.integrationsCapability.methods.getSettings.input.loose())
5581
- .output(types_72.integrationsCapability.methods.getSettings.output)
5582
- .query(async ({ input, ctx }) => {
5583
- const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
5584
- const { nodeId, ...methodInput } = parsedInput;
5585
- const p = resolveProvider('integrations', nodeId, () => getProvider(ctx), createRemoteProxy);
5586
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5587
- return p.getSettings(methodInput);
5588
- }),
5589
- setSettings: trpc_middleware_js_1.adminProcedure
5590
- .input(types_72.integrationsCapability.methods.setSettings.input.loose())
5591
- .output(types_72.integrationsCapability.methods.setSettings.output)
5592
- .mutation(async ({ input, ctx }) => {
5593
- const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
5594
- const { nodeId, ...methodInput } = parsedInput;
5595
- const p = resolveProvider('integrations', nodeId, () => getProvider(ctx), createRemoteProxy);
5596
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5597
- return p.setSettings(methodInput);
5598
- }),
5599
- clearSettings: trpc_middleware_js_1.adminProcedure
5600
- .input(types_72.integrationsCapability.methods.clearSettings.input.loose())
5601
- .output(types_72.integrationsCapability.methods.clearSettings.output)
5602
- .mutation(async ({ input, ctx }) => {
5603
- const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
5604
- const { nodeId, ...methodInput } = parsedInput;
5605
- const p = resolveProvider('integrations', nodeId, () => getProvider(ctx), createRemoteProxy);
5606
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5607
- return p.clearSettings(methodInput);
5608
- }),
5609
5579
  getAvailableTypes: trpc_middleware_js_1.adminProcedure
5610
5580
  .input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
5611
5581
  .output(types_72.integrationsCapability.methods.getAvailableTypes.output)
@@ -6997,6 +6967,46 @@ function createCapRouter_migrations(getProvider, createRemoteProxy) {
6997
6967
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
6998
6968
  return p.finishMigration(methodInput);
6999
6969
  }),
6970
+ readLegacyIntegrationRows: trpc_middleware_js_1.adminProcedure
6971
+ .input(types_89.migrationsCapability.methods.readLegacyIntegrationRows.input.loose())
6972
+ .output(types_89.migrationsCapability.methods.readLegacyIntegrationRows.output)
6973
+ .query(async ({ input, ctx }) => {
6974
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
6975
+ const { nodeId, ...methodInput } = parsedInput;
6976
+ const p = resolveProvider('migrations', nodeId, () => getProvider(ctx), createRemoteProxy);
6977
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
6978
+ return p.readLegacyIntegrationRows(methodInput);
6979
+ }),
6980
+ clearLegacyIntegrationRows: trpc_middleware_js_1.adminProcedure
6981
+ .input(types_89.migrationsCapability.methods.clearLegacyIntegrationRows.input.loose())
6982
+ .output(types_89.migrationsCapability.methods.clearLegacyIntegrationRows.output)
6983
+ .mutation(async ({ input, ctx }) => {
6984
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
6985
+ const { nodeId, ...methodInput } = parsedInput;
6986
+ const p = resolveProvider('migrations', nodeId, () => getProvider(ctx), createRemoteProxy);
6987
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
6988
+ return p.clearLegacyIntegrationRows(methodInput);
6989
+ }),
6990
+ patchLegacyIntegrationRows: trpc_middleware_js_1.adminProcedure
6991
+ .input(types_89.migrationsCapability.methods.patchLegacyIntegrationRows.input.loose())
6992
+ .output(types_89.migrationsCapability.methods.patchLegacyIntegrationRows.output)
6993
+ .mutation(async ({ input, ctx }) => {
6994
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
6995
+ const { nodeId, ...methodInput } = parsedInput;
6996
+ const p = resolveProvider('migrations', nodeId, () => getProvider(ctx), createRemoteProxy);
6997
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
6998
+ return p.patchLegacyIntegrationRows(methodInput);
6999
+ }),
7000
+ deleteLegacyIntegrationRowKeys: trpc_middleware_js_1.adminProcedure
7001
+ .input(types_89.migrationsCapability.methods.deleteLegacyIntegrationRowKeys.input.loose())
7002
+ .output(types_89.migrationsCapability.methods.deleteLegacyIntegrationRowKeys.output)
7003
+ .mutation(async ({ input, ctx }) => {
7004
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
7005
+ const { nodeId, ...methodInput } = parsedInput;
7006
+ const p = resolveProvider('migrations', nodeId, () => getProvider(ctx), createRemoteProxy);
7007
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
7008
+ return p.deleteLegacyIntegrationRowKeys(methodInput);
7009
+ }),
7000
7010
  });
7001
7011
  }
7002
7012
  function createCapRouter_modelConvert(getProvider, createRemoteProxy) {
@@ -91,10 +91,5 @@ function createFilteredIntegrationRegistry(deps) {
91
91
  },
92
92
  updateIntegration: (id, updates) => raw.updateIntegration(id, updates),
93
93
  deleteIntegration: (id) => raw.deleteIntegration(id),
94
- // Integration settings: passthrough (already gated by getIntegration)
95
- getIntegrationSettings: (id) => raw.getIntegrationSettings(id),
96
- setIntegrationSetting: (id, key, value) => raw.setIntegrationSetting(id, key, value),
97
- setIntegrationSettings: (id, settings) => raw.setIntegrationSettings(id, settings),
98
- clearIntegrationSettings: (id) => raw.clearIntegrationSettings(id),
99
94
  };
100
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.768",
3
+ "version": "1.2.770",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,10 +66,34 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-admin-ui": ">=1.2.585",
70
- "@camstack/addon-agent-ui": ">=1.2.325",
71
- "@camstack/addon-export-google": ">=0.1.126",
72
- "@camstack/addon-provider-homeassistant": ">=1.2.659"
69
+ "@camstack/addon-admin-ui": ">=1.2.587",
70
+ "@camstack/addon-agent-ui": ">=1.2.327",
71
+ "@camstack/addon-import-alexa": ">=0.2.186",
72
+ "@camstack/addon-matter-broker": ">=0.2.157",
73
+ "@camstack/addon-pipeline-orchestrator": ">=1.2.660",
74
+ "@camstack/addon-provider-amcrest": ">=0.2.166",
75
+ "@camstack/addon-provider-bosch": ">=0.1.37",
76
+ "@camstack/addon-provider-dreame": ">=0.2.165",
77
+ "@camstack/addon-provider-dreo": ">=0.2.155",
78
+ "@camstack/addon-provider-ecowitt": ">=0.2.156",
79
+ "@camstack/addon-provider-enpal": ">=0.1.9",
80
+ "@camstack/addon-provider-esphome": ">=0.1.12",
81
+ "@camstack/addon-provider-gree": ">=0.2.150",
82
+ "@camstack/addon-provider-hikvision": ">=1.2.182",
83
+ "@camstack/addon-provider-homeassistant": ">=1.2.661",
84
+ "@camstack/addon-provider-homematic": ">=1.2.183",
85
+ "@camstack/addon-provider-mqtt-ha": ">=0.1.37",
86
+ "@camstack/addon-provider-onvif": ">=1.2.155",
87
+ "@camstack/addon-provider-petkit": ">=0.2.160",
88
+ "@camstack/addon-provider-rademacher": ">=0.2.159",
89
+ "@camstack/addon-provider-reolink": ">=1.2.225",
90
+ "@camstack/addon-provider-rtsp": ">=1.2.151",
91
+ "@camstack/addon-provider-tuya": ">=0.2.151",
92
+ "@camstack/addon-provider-unifi": ">=0.2.156",
93
+ "@camstack/addon-provider-unraid": ">=0.2.157",
94
+ "@camstack/addon-provider-velux": ">=0.2.159",
95
+ "@camstack/addon-provider-vesync": ">=0.2.151",
96
+ "@camstack/addon-provider-wyze": ">=0.2.163"
73
97
  },
74
98
  "wrapper": {
75
99
  "desktop": ">=0.0.1",
@@ -78,19 +102,19 @@
78
102
  }
79
103
  },
80
104
  "dependencies": {
81
- "@camstack/addon-admin-ui": "1.2.585",
82
- "@camstack/addon-agent-ui": "1.2.325",
105
+ "@camstack/addon-admin-ui": "1.2.587",
106
+ "@camstack/addon-agent-ui": "1.2.327",
83
107
  "@camstack/addon-auth": "1.2.175",
84
108
  "@camstack/addon-benchmark": "1.2.311",
85
109
  "@camstack/addon-decoder-nodeav": "1.2.145",
86
110
  "@camstack/addon-notifiers": "1.2.628",
87
111
  "@camstack/addon-pipeline": "1.2.640",
88
- "@camstack/addon-pipeline-orchestrator": "1.2.659",
89
- "@camstack/addon-post-analysis": "1.2.667",
90
- "@camstack/develop": "0.1.44",
112
+ "@camstack/addon-pipeline-orchestrator": "1.2.660",
113
+ "@camstack/addon-post-analysis": "1.2.668",
114
+ "@camstack/develop": "0.1.45",
91
115
  "@camstack/sdk": "1.2.155",
92
- "@camstack/types": "1.2.499",
93
- "@camstack/ui-library": "1.2.383",
116
+ "@camstack/types": "1.2.501",
117
+ "@camstack/ui-library": "1.2.385",
94
118
  "@fastify/compress": "^9.0.0",
95
119
  "@fastify/cookie": "^11.0.2",
96
120
  "@fastify/cors": "^11.2.0",
@@ -6485,7 +6485,7 @@ function createBrokerDeviceManagerApi(opts) {
6485
6485
  }
6486
6486
  const lifecycleHost = device;
6487
6487
  const shrinkGate = new AccessoryShrinkGate();
6488
- const runReconcile = async () => {
6488
+ const runReconcileNow = async () => {
6489
6489
  try {
6490
6490
  await callDeviceManager(api, "registerDevice", {
6491
6491
  addonId,
@@ -6595,6 +6595,12 @@ function createBrokerDeviceManagerApi(opts) {
6595
6595
  });
6596
6596
  }
6597
6597
  };
6598
+ let reconcileChain = Promise.resolve();
6599
+ const runReconcile = () => {
6600
+ const run = reconcileChain.then(runReconcileNow, runReconcileNow);
6601
+ reconcileChain = run.then(() => void 0, () => void 0);
6602
+ return run;
6603
+ };
6598
6604
  const PROBE_TIMEOUT_MS = 3e4;
6599
6605
  const runProbe = async () => {
6600
6606
  if (typeof lifecycleHost.onProbe !== "function") return;
@@ -6430,7 +6430,7 @@ function createBrokerDeviceManagerApi(opts) {
6430
6430
  }
6431
6431
  const lifecycleHost = device;
6432
6432
  const shrinkGate = new AccessoryShrinkGate();
6433
- const runReconcile = async () => {
6433
+ const runReconcileNow = async () => {
6434
6434
  try {
6435
6435
  await callDeviceManager(api, "registerDevice", {
6436
6436
  addonId,
@@ -6540,6 +6540,12 @@ function createBrokerDeviceManagerApi(opts) {
6540
6540
  });
6541
6541
  }
6542
6542
  };
6543
+ let reconcileChain = Promise.resolve();
6544
+ const runReconcile = () => {
6545
+ const run = reconcileChain.then(runReconcileNow, runReconcileNow);
6546
+ reconcileChain = run.then(() => void 0, () => void 0);
6547
+ return run;
6548
+ };
6543
6549
  const PROBE_TIMEOUT_MS = 3e4;
6544
6550
  const runProbe = async () => {
6545
6551
  if (typeof lifecycleHost.onProbe !== "function") return;
@@ -1,4 +1,4 @@
1
- import { ys as defineRecordKinds } from "./dist-BhR34kF8.mjs";
1
+ import { ys as defineRecordKinds } from "./dist-C3WXy3Ix.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-DLVfdGSW.js");
2
+ const require_dist = require("./dist-Dtw1sIeQ.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");
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { cn as addonPagesCapability, dc as EventCategory, uc as errMsg, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { cn as addonPagesCapability, dc as EventCategory, uc as errMsg, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -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-DLVfdGSW.js");
6
+ const require_dist = require("../../dist-Dtw1sIeQ.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { dc as EventCategory, uc as errMsg, un as addonWidgetsCapability, wo as BaseAddon } from "../../dist-BhR34kF8.mjs";
1
+ import { dc as EventCategory, uc as errMsg, un as addonWidgetsCapability, wo as BaseAddon } from "../../dist-C3WXy3Ix.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -31,6 +31,10 @@ export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
31
31
  * alert yet" and open two episodes for it.
32
32
  */
33
33
  private eventChain;
34
+ /** Restarts this process has heard completed. The node list covers a dropped one. */
35
+ private restartCompletions;
36
+ private clusterReconcileTimer;
37
+ private enqueue;
34
38
  private handleEvent;
35
39
  private processEvent;
36
40
  private readRunnerRecord;
@@ -106,6 +110,17 @@ export declare class AlertCenterAddon extends BaseAddon<AlertCenterConfig> {
106
110
  * rule listens for `rule-broken`. One card per RULE; a new reason updates it.
107
111
  */
108
112
  private handleRuleBroken;
113
+ /** A heard completion. An older one must not close a restart announced after it. */
114
+ private noteRestartCompleted;
115
+ /**
116
+ * The node list says who is back (D49). A read that fails changes nothing.
117
+ * Not called from the handler that opens `system.restarting` — that event
118
+ * is emitted while the node is still up. The next read dismisses it once
119
+ * the list says the node is online. A heard `system.restart-completed`
120
+ * dismisses the matching alert even when the list has not flipped yet.
121
+ */
122
+ private reconcileClusterAlerts;
123
+ private readClusterNodes;
109
124
  /**
110
125
  * One card per faulted migration, from the ledger (D987, D11): the RPC read is
111
126
  * the authority and an event only says it may have changed. A read that fails