@camstack/server 1.2.818 → 1.2.820

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 +28 -0
  2. package/dist/api/core/cap-providers.js +32 -40
  3. package/dist/api/trpc/cap-route-error-formatter.js +19 -1
  4. package/dist/api/trpc/cap-router-runtime.js +23 -0
  5. package/dist/api/trpc/device-config-secret-redaction.js +1 -2
  6. package/dist/api/trpc/generated-cap-routers.js +13 -27
  7. package/dist/api/trpc/localized-schema-paths.js +1 -1
  8. package/dist/api/trpc/trpc.router.js +1 -1
  9. package/dist/core/addon/addon-registry.service.js +2 -2
  10. package/dist/core/addon/addon-settings-provider.js +0 -23
  11. package/dist/core/addon/instance-lifecycle.js +44 -7
  12. package/package.json +27 -14
  13. package/system/dist/addon-runner.js +0 -1
  14. package/system/dist/addon-runner.mjs +0 -1
  15. package/system/dist/{agent-https-ChriyNA8.js → agent-https-CbysxRlV.js} +1 -1
  16. package/system/dist/{agent-https-rhOY61af.mjs → agent-https-XHjvcSEq.mjs} +1 -1
  17. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  18. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  19. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  20. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  21. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  22. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  23. package/system/dist/builtins/autotrack/index.js +1 -1
  24. package/system/dist/builtins/autotrack/index.mjs +1 -1
  25. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  26. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  27. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  28. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  29. package/system/dist/builtins/camera-grid/index.js +1 -1
  30. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  31. package/system/dist/builtins/composer/composer.addon.js +3 -3
  32. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  33. package/system/dist/builtins/console-logging/index.js +1 -1
  34. package/system/dist/builtins/console-logging/index.mjs +1 -1
  35. package/system/dist/builtins/core-blocks/blocks-instances.d.ts +2 -2
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.js +5 -5
  37. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  38. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  39. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  40. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  41. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  42. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  43. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  44. package/system/dist/builtins/keychain/index.js +4 -4
  45. package/system/dist/builtins/keychain/index.mjs +4 -4
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  47. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  48. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  49. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  50. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  51. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  52. package/system/dist/builtins/loki-logging/index.js +1 -1
  53. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  55. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  56. package/system/dist/builtins/platform-probe/index.js +1 -1
  57. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  58. package/system/dist/builtins/record-entries/index.js +1 -1
  59. package/system/dist/builtins/record-entries/index.mjs +1 -1
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  61. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  62. package/system/dist/builtins/snapshot/index.js +1 -1
  63. package/system/dist/builtins/snapshot/index.mjs +1 -1
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  65. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  69. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  71. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  72. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  73. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  74. package/system/dist/builtins/winston-logging/index.js +1 -1
  75. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  76. package/system/dist/{capture-engine-Cgt1r0h5.js → capture-engine-CKtkENOg.js} +1 -1
  77. package/system/dist/{capture-engine-CoK1n1F1.mjs → capture-engine-WSpdP-gE.mjs} +1 -1
  78. package/system/dist/{composition-sources-TkHq8DdF.js → composition-sources-6Qx72gmK.js} +1 -1
  79. package/system/dist/{composition-sources-DSU28FFP.mjs → composition-sources-Dr6uwBGw.mjs} +1 -1
  80. package/system/dist/{constants-D3mNibfv.js → constants-BchSDmTD.js} +1 -1
  81. package/system/dist/{constants-CCezBXPq.mjs → constants-URzk8siY.mjs} +1 -1
  82. package/system/dist/{device-ca-CjX1tQP7.mjs → device-ca-Bu1E5Vgr.mjs} +1 -1
  83. package/system/dist/{device-ca-CEzeY_zI.js → device-ca-kANxsBE5.js} +1 -1
  84. package/system/dist/{dist-BNBgsEk0.mjs → dist-C0Df8iJl.mjs} +91 -126
  85. package/system/dist/{dist-DX1gyM8o.js → dist-R_mOSFtH.js} +91 -126
  86. package/system/dist/file-host-worker.js +1 -1
  87. package/system/dist/file-host-worker.mjs +1 -1
  88. package/system/dist/{hub-mdns-ciao-DBHvpWvv.js → hub-mdns-ciao-2AZ3ucDO.js} +2 -2
  89. package/system/dist/{hub-mdns-ciao-BCfG7mv3.mjs → hub-mdns-ciao-pxgLcmqO.mjs} +2 -2
  90. package/system/dist/index.js +40 -11
  91. package/system/dist/index.mjs +40 -11
  92. package/system/dist/kernel/cap-router-builder.d.ts +9 -0
  93. package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
  94. package/system/dist/{legacy-integration-rows-door-C0X4Ijcr.mjs → legacy-integration-rows-door-Cj58BS60.mjs} +1 -1
  95. package/system/dist/{legacy-integration-rows-door-7K4_MoAP.js → legacy-integration-rows-door-g4CeLJ9g.js} +1 -1
  96. package/system/dist/{restore-archive-WBDJlios.mjs → restore-archive-Bd7fgVo8.mjs} +1 -1
  97. package/system/dist/{restore-archive-DXlN0NYx.js → restore-archive-CAh7u-rY.js} +1 -1
  98. package/system/dist/{wal-maintenance-BPmo2JzY.js → wal-maintenance--0liHBxL.js} +0 -0
  99. package/system/dist/{wal-maintenance-BJ0vDek1.mjs → wal-maintenance-DMf2oEQ-.mjs} +0 -0
  100. package/system/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,11 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.820] - 2026-11-09
11
+
12
+ ### Changed
13
+
14
+ - A viewer user manages only their own notification targets through integration-instances
15
+ - A fixed builtin whose addon is down reads as an unknown switch; the enabled / disabled event follows the instance record, not the registry flag
16
+ - A fixed builtin can be switched back on while its addon is down, and every switch emits the enabled / disabled event again
17
+ - Integrations: integrations.update refuses enabled for every row; the integration list reports an unanswered switch as unknown
18
+ - integrations.delete is back for an addon that is installed but not running; a fixed builtin can be switched while its addon is down.
19
+ - A provider's refusal of a caller answers FORBIDDEN (403) instead of a server error.
20
+
21
+ ### Removed
22
+
23
+ - addonSettings.getIntegrationFormSchema is removed; the create form is integrationInstances.instanceFormSchema with no id
24
+
25
+ ## [1.2.819] - 2026-11-09
26
+
27
+ ### Changed
28
+
29
+ - Rebuilt against updated dependencies.
30
+ ### Changed
31
+
32
+
10
33
  ## [1.2.818] - 2026-11-09
11
34
 
12
35
  ### Changed
13
36
 
14
37
  - Rebuilt against updated dependencies.
38
+ ### Changed
39
+
40
+
41
+ ### Removed
42
+
15
43
 
16
44
  ## [1.2.817] - 2026-11-08
17
45
 
@@ -79,7 +79,6 @@ const system_1 = require("@camstack/server/system");
79
79
  const types_1 = require("@camstack/types");
80
80
  const server_1 = require("@trpc/server");
81
81
  const instance_lifecycle_1 = require("../../core/addon/instance-lifecycle");
82
- const instance_links_service_1 = require("../../core/addon/instance-links.service");
83
82
  const addon_package_service_js_1 = require("../../core/addon/addon-package.service.js");
84
83
  const addon_uninstall_js_1 = require("../../core/addon/addon-uninstall.js");
85
84
  const agent_desired_set_1 = require("../../core/agent/agent-desired-set");
@@ -827,13 +826,16 @@ function getInstancesProvider(ar, addonId) {
827
826
  /**
828
827
  * An integration's `enabled` is a projection of its instance body (epic #440, step 3): the one
829
828
  * switch is `setInstanceEnabled`, stored in the addon's record. One `listInstances` call per
830
- * addon answers every row of it. An addon whose provider is not up, that keeps no instance for the
831
- * row, or that fails to answer keeps the registry's stored flag for that row, and a failure is
832
- * logged: a listing never fails because one addon did not answer.
829
+ * addon answers every row of it. A row the addon cannot speak for (its provider is not up, it
830
+ * keeps no instance for the row, it fails to answer) keeps the registry's stored flag but is
831
+ * marked `switchUnknown`: that flag is stale, not the state, and a reader must not draw it as on or
832
+ * off (D315). A failure is logged: a listing never fails because one addon did not answer.
833
833
  *
834
- * A FIXED builtin is the exception: its switch is the registry flag, the one store
835
- * (`integrations.update`), and the name-only record it is seeded with carries no flag, which a
836
- * body reads as "on". Its row is never projected.
834
+ * A FIXED builtin is the exception: its switch is the registry flag, the hub's own, written by
835
+ * `setFixedBuiltinEnabled` (`instance-lifecycle.ts`) from `setInstanceEnabled` or from
836
+ * `integrations.update({ enabled })`, and the name-only record it is seeded with carries no flag,
837
+ * which a body reads as "on". Its row is never projected and the flag is the answer, whether or
838
+ * not its addon is up.
837
839
  */
838
840
  async function projectSwitches(ar, logger, integrations) {
839
841
  const byAddon = new Map();
@@ -853,23 +855,15 @@ async function projectSwitches(ar, logger, integrations) {
853
855
  }
854
856
  }
855
857
  return integrations.map((i) => {
858
+ // A fixed builtin's switch is the registry flag: the hub owns it, the addon does not answer for it.
856
859
  if ((0, instance_lifecycle_1.isFixedBuiltin)(i))
857
860
  return i;
858
861
  const enabled = byAddon.get(i.addonId)?.get(i.id);
859
- return enabled === undefined ? i : { ...i, enabled };
862
+ return enabled === undefined ? { ...i, switchUnknown: true } : { ...i, enabled };
860
863
  });
861
864
  }
862
- function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
865
+ function buildIntegrationsProvider(ar, loggingService) {
863
866
  const logger = loggingService.createLogger('integrations');
864
- const lifecycleDeps = {
865
- logger,
866
- integrations: () => requireIntegrationRegistry(ar),
867
- deviceManager: () => capabilityRegistry?.getSingleton('device-manager') ?? null,
868
- eventBus: eb,
869
- providerFor: (addonId) => getInstancesProvider(ar, addonId),
870
- holders: () => (0, instance_links_service_1.holdersOf)(ar.getCapabilityRegistry()),
871
- manifestRole: () => undefined,
872
- };
873
867
  const withProcessState = (i) => ({
874
868
  ...i,
875
869
  processState: ar.listAddons().find((a) => a.manifest.id === i.addonId)?.process?.state ?? 'unknown',
@@ -908,10 +902,21 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
908
902
  });
909
903
  throw new Error(`Integration "${input.id}" not found`);
910
904
  }
911
- if (input.enabled !== undefined && previous.info['fixed'] !== true) {
912
- throw new Error(`Integration "${input.id}" is switched through integration-instances.setInstanceEnabled, not integrations.update`);
905
+ if (input.enabled !== undefined && (0, instance_lifecycle_1.isFixedBuiltin)(previous)) {
906
+ // The hub owns a fixed builtin's switch (the registry flag): it works while the addon is down.
907
+ await (0, instance_lifecycle_1.setFixedBuiltinEnabled)(ar.instanceLifecycleDeps(), previous, input.enabled);
913
908
  }
914
- const { id, ...updates } = input;
909
+ else if (input.enabled !== undefined) {
910
+ logger.warn('refused: integrations.update does not switch', {
911
+ tags: { integrationId: input.id, addonId: previous.addonId },
912
+ meta: { phase: 'update', reason: 'switch-through-set-instance-enabled' },
913
+ });
914
+ throw new server_1.TRPCError({
915
+ code: 'BAD_REQUEST',
916
+ message: `Integration "${input.id}" is switched through integration-instances.setInstanceEnabled, not integrations.update`,
917
+ });
918
+ }
919
+ const { id, enabled: _switched, ...updates } = input;
915
920
  const changedFields = Object.keys(updates).filter((k) => updates[k] !== undefined);
916
921
  logger.info('request', {
917
922
  tags: { integrationId: input.id, addonId: previous.addonId },
@@ -920,21 +925,6 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
920
925
  const result = await reg.updateIntegration(id, updates);
921
926
  if (!result)
922
927
  throw new Error(`Integration "${id}" not found`);
923
- const enabledChanged = input.enabled !== undefined && input.enabled !== previous.enabled;
924
- if (enabledChanged) {
925
- const category = input.enabled ? 'integration.enabled' : 'integration.disabled';
926
- logger.info('enabled state changed', {
927
- tags: { integrationId: result.id, addonId: result.addonId },
928
- meta: { phase: 'update', enabled: input.enabled },
929
- });
930
- eb.emit({
931
- id: `integration-${category}-${Date.now()}`,
932
- timestamp: new Date(),
933
- source: { type: 'integration', id: result.id },
934
- category,
935
- data: { integrationId: result.id, addonId: result.addonId },
936
- });
937
- }
938
928
  if (input.name !== undefined && input.name !== previous.name) {
939
929
  logger.info('renamed', {
940
930
  tags: { integrationId: result.id },
@@ -978,11 +968,13 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
978
968
  });
979
969
  throw new Error(`Integration "${input.id}" not found`);
980
970
  }
981
- // The hub half is shared with the registered `integration-instances` provider
982
- // (`instance-lifecycle.ts`): a fixed builtin and a linked instance are refused BEFORE the
983
- // first mutation, then the devices, the record, the row and the event.
971
+ // The hub half shared with the registered `integration-instances` provider
972
+ // (`instance-lifecycle.ts`), reachable WITHOUT that provider: an addon that is installed but
973
+ // crashed keeps its integration deletable. A fixed builtin and a linked instance are refused
974
+ // BEFORE the first mutation, then the devices, the record (when the provider is up), the row
975
+ // and the event.
984
976
  const instances = getInstancesProvider(ar, integration.addonId);
985
- await (0, instance_lifecycle_1.deleteRegisteredInstance)(lifecycleDeps, instances === null ? null : (0, instance_lifecycle_1.rawInstancesProvider)(instances), integration);
977
+ await (0, instance_lifecycle_1.deleteRegisteredInstance)(ar.instanceLifecycleDeps(), instances === null ? null : (0, instance_lifecycle_1.rawInstancesProvider)(instances), integration);
986
978
  return { success: true, deletedId: input.id };
987
979
  },
988
980
  getAvailableTypes: async () => {
@@ -111,7 +111,25 @@ function extractCapRouteError(err) {
111
111
  * Returns the shape unchanged for all other errors.
112
112
  */
113
113
  function formatTrpcError(opts) {
114
- return withErrorI18n(opts, withCapRouteData(opts));
114
+ return withErrorI18n(opts, withProviderRefusal(opts, withCapRouteData(opts)));
115
+ }
116
+ /** JSON-RPC code tRPC uses for FORBIDDEN. */
117
+ const FORBIDDEN_RPC_CODE = -32003;
118
+ /**
119
+ * A provider's refusal of a caller (`forbiddenError`) reaches the hub as a plain Error, often
120
+ * through the UDS hop to a forked addon, so tRPC calls it a 500. The message prefix survives
121
+ * the hop: answer FORBIDDEN for it.
122
+ */
123
+ function withProviderRefusal(opts, shape) {
124
+ if (opts.error.code !== 'INTERNAL_SERVER_ERROR')
125
+ return shape;
126
+ if (!opts.error.message.startsWith(types_1.FORBIDDEN_MESSAGE_PREFIX))
127
+ return shape;
128
+ return {
129
+ ...shape,
130
+ code: FORBIDDEN_RPC_CODE,
131
+ data: { ...shape.data, code: 'FORBIDDEN', httpStatus: 403 },
132
+ };
115
133
  }
116
134
  /**
117
135
  * A coded error (`userError(...)`, D863) gets its response `message` in the
@@ -402,6 +402,23 @@ async function inferDeviceAdoptionCollectionAddonPin(methodName, input, deps) {
402
402
  message: `deviceAdoption.${methodName} requires addonId (top-level pin) or integrationId to resolve the owning provider.`,
403
403
  });
404
404
  }
405
+ /**
406
+ * May a NON-admin session call a `caller: 'scoped'` method on this provider? Only an
407
+ * `integration-instances` provider that declares `describe().userScoped`: the provider is asked,
408
+ * through the same call the Integrations page uses, so a forked addon answers like a resident one.
409
+ */
410
+ async function userScopedAdmission(capName, provider) {
411
+ if (capName !== 'integration-instances')
412
+ return false;
413
+ const describe = provider['describe'];
414
+ if (typeof describe !== 'function')
415
+ return false;
416
+ const description = await describe.call(provider);
417
+ return (description !== null &&
418
+ typeof description === 'object' &&
419
+ 'userScoped' in description &&
420
+ description.userScoped === true);
421
+ }
405
422
  /** Build the `services` half of `buildCapRouters(primitives, services)`. */
406
423
  function createCapRouterServices(deps) {
407
424
  const reg = deps.capabilityRegistry;
@@ -513,6 +530,12 @@ function createCapRouterServices(deps) {
513
530
  unauthorized: (message) => {
514
531
  throw new server_1.TRPCError({ code: 'UNAUTHORIZED', message });
515
532
  },
533
+ forbidden: (message) => {
534
+ throw new server_1.TRPCError({ code: 'FORBIDDEN', message });
535
+ },
536
+ // `caller: 'scoped'` default-deny (epic #440): a non-admin session reaches an
537
+ // `integration-instances` provider only when that provider says its rows belong to users.
538
+ admitsUserCaller: userScopedAdmission,
516
539
  // Task 7.5d: a resolved provider that does not implement `method` must
517
540
  // fail, not answer `undefined` (200). NOT_IMPLEMENTED mirrors what
518
541
  // `child-cap-dispatch.ts` does on the identical condition on the UDS
@@ -323,7 +323,7 @@ function redactFormField(field) {
323
323
  }
324
324
  /**
325
325
  * Project an ADDON settings form (`addonSettings.getScopedSettings` /
326
- * `getIntegrationFormSchema` / `getDeviceSettings`, a `SettingsSchemaWithValues`).
326
+ * `getDeviceSettings`, a `SettingsSchemaWithValues`).
327
327
  *
328
328
  * Unlike {@link redactSettingsSections} (device forms, whose secrets are named
329
329
  * by key convention) this decides by the FIELD: an addon's credential is often
@@ -495,7 +495,6 @@ exports.NON_ADMIN_SECRET_FREE_BY_CONTRACT = new Set([
495
495
  exports.NON_ADMIN_CONFIG_REDACTED_METHODS = new Map([
496
496
  // ── Addon settings forms (D634) — hydrated with the STORED secret ──
497
497
  ['addonSettings.getScopedSettings', redactSettingsForm],
498
- ['addonSettings.getIntegrationFormSchema', redactSettingsForm],
499
498
  ['addonSettings.getDeviceSettings', redactSettingsForm],
500
499
  ['deviceExport.getStatus', redactExportSetup],
501
500
  // ── Round-3 sweep: the per-device device-ops twins and the listings ──
@@ -676,14 +676,6 @@ function createCapRouter_addonSettings(getProvider, _createRemoteProxy) {
676
676
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
677
677
  return p.readScopedValues(input);
678
678
  }),
679
- getIntegrationFormSchema: trpc_middleware_js_1.protectedProcedure
680
- .input(types_10.addonSettingsCapability.methods.getIntegrationFormSchema.input.loose())
681
- .output(types_10.addonSettingsCapability.methods.getIntegrationFormSchema.output)
682
- .query(async ({ input, ctx }) => {
683
- const p = requireCapProvider('addon-settings', () => getProvider(ctx));
684
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
685
- return p.getIntegrationFormSchema(input);
686
- }),
687
679
  getDeclaredSettingsKeys: trpc_middleware_js_1.adminProcedure
688
680
  .input(types_10.addonSettingsCapability.methods.getDeclaredSettingsKeys.input.loose())
689
681
  .output(types_10.addonSettingsCapability.methods.getDeclaredSettingsKeys.output)
@@ -5443,14 +5435,17 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5443
5435
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5444
5436
  return p.instanceFormSchema(methodInput);
5445
5437
  }),
5446
- listInstances: trpc_middleware_js_1.adminProcedure
5447
- .input(zod_1.z.object({ nodeId: zod_1.z.string().optional(), addonId: zod_1.z.string().optional() }).optional())
5438
+ listInstances: trpc_middleware_js_1.protectedProcedure
5439
+ .input(types_72.integrationInstancesCapability.methods.listInstances.input.loose())
5448
5440
  .output(types_72.integrationInstancesCapability.methods.listInstances.output)
5449
5441
  .query(async ({ input, ctx }) => {
5450
- const p = resolveProvider('integration-instances', input?.nodeId, () => getProvider(ctx, input?.addonId), createRemoteProxy);
5451
- return p.listInstances();
5442
+ const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
5443
+ const { nodeId, addonId, ...methodInput } = parsedInput;
5444
+ const p = resolveProvider('integration-instances', nodeId, () => getProvider(ctx, addonId), createRemoteProxy);
5445
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5446
+ return p.listInstances(methodInput);
5452
5447
  }),
5453
- getInstance: trpc_middleware_js_1.adminProcedure
5448
+ getInstance: trpc_middleware_js_1.protectedProcedure
5454
5449
  .input(types_72.integrationInstancesCapability.methods.getInstance.input.loose())
5455
5450
  .output(types_72.integrationInstancesCapability.methods.getInstance.output)
5456
5451
  .query(async ({ input, ctx }) => {
@@ -5460,7 +5455,7 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5460
5455
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5461
5456
  return p.getInstance(methodInput);
5462
5457
  }),
5463
- createInstance: trpc_middleware_js_1.adminProcedure
5458
+ createInstance: trpc_middleware_js_1.protectedProcedure
5464
5459
  .input(types_72.integrationInstancesCapability.methods.createInstance.input.loose())
5465
5460
  .output(types_72.integrationInstancesCapability.methods.createInstance.output)
5466
5461
  .mutation(async ({ input, ctx }) => {
@@ -5470,7 +5465,7 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5470
5465
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5471
5466
  return p.createInstance(methodInput);
5472
5467
  }),
5473
- updateInstance: trpc_middleware_js_1.adminProcedure
5468
+ updateInstance: trpc_middleware_js_1.protectedProcedure
5474
5469
  .input(types_72.integrationInstancesCapability.methods.updateInstance.input.loose())
5475
5470
  .output(types_72.integrationInstancesCapability.methods.updateInstance.output)
5476
5471
  .mutation(async ({ input, ctx }) => {
@@ -5480,7 +5475,7 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5480
5475
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5481
5476
  return p.updateInstance(methodInput);
5482
5477
  }),
5483
- setInstanceEnabled: trpc_middleware_js_1.adminProcedure
5478
+ setInstanceEnabled: trpc_middleware_js_1.protectedProcedure
5484
5479
  .input(types_72.integrationInstancesCapability.methods.setInstanceEnabled.input.loose())
5485
5480
  .output(types_72.integrationInstancesCapability.methods.setInstanceEnabled.output)
5486
5481
  .mutation(async ({ input, ctx }) => {
@@ -5490,7 +5485,7 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5490
5485
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5491
5486
  return p.setInstanceEnabled(methodInput);
5492
5487
  }),
5493
- deleteInstance: trpc_middleware_js_1.adminProcedure
5488
+ deleteInstance: trpc_middleware_js_1.protectedProcedure
5494
5489
  .input(types_72.integrationInstancesCapability.methods.deleteInstance.input.loose())
5495
5490
  .output(types_72.integrationInstancesCapability.methods.deleteInstance.output)
5496
5491
  .mutation(async ({ input, ctx }) => {
@@ -5500,7 +5495,7 @@ function createCapRouter_integrationInstances(getProvider, createRemoteProxy) {
5500
5495
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5501
5496
  return p.deleteInstance(methodInput);
5502
5497
  }),
5503
- testInstance: trpc_middleware_js_1.adminProcedure
5498
+ testInstance: trpc_middleware_js_1.protectedProcedure
5504
5499
  .input(types_72.integrationInstancesCapability.methods.testInstance.input.loose())
5505
5500
  .output(types_72.integrationInstancesCapability.methods.testInstance.output)
5506
5501
  .mutation(async ({ input, ctx }) => {
@@ -11764,15 +11759,6 @@ function createCapRouter_smtpProvider(getProvider, createRemoteProxy) {
11764
11759
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
11765
11760
  return p.sendEmail(methodInput);
11766
11761
  }),
11767
- verify: trpc_middleware_js_1.adminProcedure
11768
- .input(types_138.smtpProviderCapability.methods.verify.input.loose())
11769
- .output(types_138.smtpProviderCapability.methods.verify.output)
11770
- .mutation(async ({ input, ctx }) => {
11771
- const { nodeId, addonId, ...methodInput } = input;
11772
- const p = resolveProvider('smtp-provider', nodeId, () => getProvider(ctx, addonId), createRemoteProxy);
11773
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
11774
- return p.verify(methodInput);
11775
- }),
11776
11762
  getStatus: trpc_middleware_js_1.adminProcedure
11777
11763
  .input(types_2.DEVICE_STATUS_METHOD.getStatus.input.loose())
11778
11764
  .output(types_2.DEVICE_STATUS_METHOD.getStatus.output)
@@ -13,7 +13,7 @@ exports.LOCALIZED_SCHEMA_PATHS = void 0;
13
13
  */
14
14
  exports.LOCALIZED_SCHEMA_PATHS = new Set([
15
15
  'addonSettings.getScopedSettings',
16
- 'addonSettings.getIntegrationFormSchema',
16
+ 'integrationInstances.instanceFormSchema',
17
17
  'addonSettings.getDeviceSettings',
18
18
  'deviceManager.getDeviceSettingsAggregate',
19
19
  'deviceManager.getDeviceLiveInfoAggregate',
@@ -251,7 +251,7 @@ function buildServerProviders(services) {
251
251
  'network-quality': wrap(() => (0, cap_providers_js_1.buildNetworkQualityProvider)(services.networkQualityService)),
252
252
  system: wrap(() => (0, cap_providers_js_1.buildSystemProvider)(services.featureService, services.capabilityRegistry, services.loggingService.createLogger('site-location'))),
253
253
  toast: wrap((ctx) => (0, cap_providers_js_1.buildToastProvider)(services.toastService, ctx)),
254
- integrations: wrap(() => (0, cap_providers_js_1.buildIntegrationsProvider)(services.addonRegistry, services.eventBus, services.loggingService, services.capabilityRegistry)),
254
+ integrations: wrap(() => (0, cap_providers_js_1.buildIntegrationsProvider)(services.addonRegistry, services.loggingService)),
255
255
  nodes: wrap(() => (0, cap_providers_js_1.buildNodesProvider)(services.agentRegistry, services.moleculer, services.addonRegistry, (0, cap_providers_js_1.createNodeRootPackageLookup)(services.moleculer, services.serverUpdateService), services.loggingService.createLogger('nodes'))),
256
256
  // server-management — runtime-updatable root package (phase 1: hub only).
257
257
  'server-management': wrap(() => (0, server_management_provider_js_1.buildServerManagementProvider)(services.serverUpdateService, path.resolve(process.env['CAMSTACK_DATA'] ?? 'camstack-data'))),
@@ -576,7 +576,6 @@ class AddonRegistryService {
576
576
  return entry?.addon ?? null;
577
577
  },
578
578
  gateway: this.addonCallGateway,
579
- instancesFor: (addonId) => (0, integration_instances_provider_js_1.findInstancesProvider)(this.capabilityRegistry, addonId),
580
579
  });
581
580
  this.capabilityRegistry.registerProvider('addon-settings', '$hub', settingsProvider);
582
581
  // Wire capability consumer actions via EventBus
@@ -1307,7 +1306,8 @@ class AddonRegistryService {
1307
1306
  }
1308
1307
  /**
1309
1308
  * What the hub half of an `integration-instances` create and delete reads (epic #440, H3).
1310
- * Every member is read when used, so a not-yet-wired registry fails the call, not the boot.
1309
+ * Every member is read when used, so a not-yet-wired registry fails the call, not the boot. Also what
1310
+ * the hub-owned calls that need no addon provider read (`integrations.delete`, the switch of a fixed builtin).
1311
1311
  */
1312
1312
  instanceLifecycleDeps() {
1313
1313
  return {
@@ -152,29 +152,6 @@ function createAddonSettingsProvider(deps) {
152
152
  throw err;
153
153
  }
154
154
  },
155
- async getIntegrationFormSchema(input) {
156
- const instances = deps.instancesFor?.(input.addonId) ?? null;
157
- if (instances !== null) {
158
- return reshapeForOutput(await instances.instanceFormSchema({
159
- id: input.instance.integrationId,
160
- mode: input.instance.mode,
161
- ...(input.instance.candidateStableId !== undefined
162
- ? { candidateStableId: input.instance.candidateStableId }
163
- : {}),
164
- }));
165
- }
166
- if (gateway.isInProcess(input.addonId, input.nodeId)) {
167
- const addon = getAddon(input.addonId);
168
- if (!addon)
169
- return null;
170
- // The per-instance hook when the addon has one; its scoped form otherwise.
171
- const result = typeof addon.getIntegrationFormSchema === 'function'
172
- ? await addon.getIntegrationFormSchema(input.instance, input.nodeId)
173
- : null;
174
- return result ? reshapeForOutput(result) : null;
175
- }
176
- return forkedGet(input.addonId, 'getIntegrationFormSchema', { instance: input.instance, ...(input.nodeId ? { nodeId: input.nodeId } : {}) }, input.nodeId);
177
- },
178
155
  async getDeclaredSettingsKeys(input) {
179
156
  try {
180
157
  if (gateway.isInProcess(input.addonId, input.nodeId)) {
@@ -5,6 +5,7 @@ exports.createRegisteredInstance = createRegisteredInstance;
5
5
  exports.deleteRegisteredInstance = deleteRegisteredInstance;
6
6
  exports.isFixedBuiltin = isFixedBuiltin;
7
7
  exports.rawInstancesProvider = rawInstancesProvider;
8
+ exports.setFixedBuiltinEnabled = setFixedBuiltinEnabled;
8
9
  exports.withInstanceLifecycle = withInstanceLifecycle;
9
10
  exports.deferInstanceLifecycle = deferInstanceLifecycle;
10
11
  /**
@@ -21,9 +22,8 @@ exports.deferInstanceLifecycle = deferInstanceLifecycle;
21
22
  * There is ONE create door: the registered `integration-instances` provider
22
23
  * ({@link withInstanceLifecycle}), which calls {@link createRegisteredInstance}. A seed (an
23
24
  * addon making its own fixed or migrated instance) goes through the same door and is accepted
24
- * only from the addon it names. Delete has two callers of {@link deleteRegisteredInstance}: the
25
- * provider's `deleteInstance` and `integrations.delete`, which stays for registry rows no addon
26
- * provides any more (an orphan).
25
+ * only from the addon it names. Delete has one caller of {@link deleteRegisteredInstance}: the
26
+ * provider's `deleteInstance` (`integrations` has no delete method).
27
27
  */
28
28
  const system_1 = require("@camstack/server/system");
29
29
  const types_1 = require("@camstack/types");
@@ -371,6 +371,33 @@ const RAW_PROVIDERS = new WeakMap();
371
371
  function rawInstancesProvider(provider) {
372
372
  return RAW_PROVIDERS.get(provider) ?? provider;
373
373
  }
374
+ /**
375
+ * The switch of a FIXED builtin: the registry flag, the one store, written here and nowhere else.
376
+ * It needs no addon provider, so a builtin whose addon is down or failed can still be turned back
377
+ * on: `integrations.update({ enabled })` (the hub's own cap, no provider in the path) reaches it
378
+ * directly, and `setInstanceEnabled` reaches it when the provider is up. The enabled / disabled
379
+ * event follows a real change only.
380
+ */
381
+ async function setFixedBuiltinEnabled(deps, integration, enabled) {
382
+ await deps.integrations().updateIntegration(integration.id, { enabled });
383
+ await emitSwitchEvent(deps, integration, enabled);
384
+ }
385
+ /** `integration.enabled` / `integration.disabled`, only when the switch actually moved. */
386
+ async function emitSwitchEvent(deps, integration, enabled) {
387
+ if (integration.enabled === enabled)
388
+ return;
389
+ deps.logger.info('enabled state changed', {
390
+ tags: { integrationId: integration.id, addonId: integration.addonId },
391
+ meta: { phase: 'set-enabled', enabled },
392
+ });
393
+ deps.eventBus.emit({
394
+ id: `integration-enabled-${integration.id}-${Date.now()}`,
395
+ timestamp: new Date(),
396
+ source: { type: 'integration', id: integration.id },
397
+ category: enabled ? types_1.EventCategory.IntegrationEnabled : types_1.EventCategory.IntegrationDisabled,
398
+ data: { integrationId: integration.id, addonId: integration.addonId },
399
+ });
400
+ }
374
401
  /**
375
402
  * `provider` with a `createInstance` / `deleteInstance` that carry the hub half for an instance
376
403
  * that brings devices. An instance of a kind that does not (a notifier, a broker account, a
@@ -453,10 +480,20 @@ function withInstanceLifecycle(addonId, provider, deps) {
453
480
  return instance === null ? null : withRegistryFlag(instance);
454
481
  };
455
482
  const setInstanceEnabled = async (input) => {
456
- if ((await fixedRow(input.id)) === null)
457
- return provider.setInstanceEnabled(input);
458
- await deps.integrations().updateIntegration(input.id, { enabled: input.enabled });
459
- return { ok: true };
483
+ const fixed = await fixedRow(input.id);
484
+ if (fixed !== null) {
485
+ await setFixedBuiltinEnabled(deps, fixed, input.enabled);
486
+ return { ok: true };
487
+ }
488
+ // The switch of an instance lives in its record body: the baseline is what the body said
489
+ // BEFORE the write, never the registry flag (this path does not write it).
490
+ const row = await deps.integrations().getIntegration(input.id);
491
+ const previous = row !== null && row.addonId === bare ? await provider.getInstance({ id: input.id }) : null;
492
+ const result = await provider.setInstanceEnabled(input);
493
+ if (row !== null && previous !== null) {
494
+ await emitSwitchEvent(deps, { ...row, enabled: previous.enabled !== false }, input.enabled);
495
+ }
496
+ return result;
460
497
  };
461
498
  const wrapped = new Proxy(provider, {
462
499
  get(target, prop) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.818",
3
+ "version": "1.2.820",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,11 +66,24 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-admin-ui": ">=1.2.625",
70
- "@camstack/addon-google-services": ">=0.2.45",
71
- "@camstack/addon-pipeline-orchestrator": ">=1.2.674",
72
- "@camstack/addon-provider-homeassistant": ">=1.2.675",
73
- "@camstack/addon-waste-collections": ">=0.1.41"
69
+ "@camstack/addon-admin-ui": ">=1.2.627",
70
+ "@camstack/addon-agent-ui": ">=1.2.352",
71
+ "@camstack/addon-auth": ">=1.2.180",
72
+ "@camstack/addon-google-services": ">=0.2.46",
73
+ "@camstack/addon-import-alexa": ">=0.2.200",
74
+ "@camstack/addon-matter-broker": ">=0.2.165",
75
+ "@camstack/addon-mqtt-broker": ">=1.2.158",
76
+ "@camstack/addon-notifiers": ">=1.2.635",
77
+ "@camstack/addon-pipeline-orchestrator": ">=1.2.675",
78
+ "@camstack/addon-post-analysis": ">=1.2.688",
79
+ "@camstack/addon-provider-dreame": ">=0.2.173",
80
+ "@camstack/addon-provider-dreo": ">=0.2.163",
81
+ "@camstack/addon-provider-homeassistant": ">=1.2.676",
82
+ "@camstack/addon-provider-petkit": ">=0.2.168",
83
+ "@camstack/addon-provider-tuya": ">=0.2.158",
84
+ "@camstack/addon-provider-wyze": ">=0.2.172",
85
+ "@camstack/addon-smtp-nodemailer": ">=1.2.155",
86
+ "@camstack/addon-waste-collections": ">=0.1.42"
74
87
  },
75
88
  "wrapper": {
76
89
  "desktop": ">=0.0.1",
@@ -79,19 +92,19 @@
79
92
  }
80
93
  },
81
94
  "dependencies": {
82
- "@camstack/addon-admin-ui": "1.2.625",
83
- "@camstack/addon-agent-ui": "1.2.350",
84
- "@camstack/addon-auth": "1.2.179",
95
+ "@camstack/addon-admin-ui": "1.2.627",
96
+ "@camstack/addon-agent-ui": "1.2.352",
97
+ "@camstack/addon-auth": "1.2.180",
85
98
  "@camstack/addon-benchmark": "1.2.312",
86
99
  "@camstack/addon-decoder-nodeav": "1.2.149",
87
- "@camstack/addon-notifiers": "1.2.634",
100
+ "@camstack/addon-notifiers": "1.2.635",
88
101
  "@camstack/addon-pipeline": "1.2.648",
89
- "@camstack/addon-pipeline-orchestrator": "1.2.674",
90
- "@camstack/addon-post-analysis": "1.2.687",
102
+ "@camstack/addon-pipeline-orchestrator": "1.2.675",
103
+ "@camstack/addon-post-analysis": "1.2.688",
91
104
  "@camstack/develop": "0.1.51",
92
105
  "@camstack/sdk": "1.2.157",
93
- "@camstack/types": "1.2.532",
94
- "@camstack/ui-library": "1.2.409",
106
+ "@camstack/types": "1.2.534",
107
+ "@camstack/ui-library": "1.2.411",
95
108
  "@fastify/compress": "^9.0.0",
96
109
  "@fastify/cookie": "^11.0.2",
97
110
  "@fastify/cors": "^11.2.0",
@@ -11477,7 +11477,6 @@ async function dispatchSettings(addon, addonId, method, args) {
11477
11477
  const { scope, cap } = requireScopedTarget(addonId, method, args);
11478
11478
  return typeof addon.readScopedValues === "function" ? await addon.readScopedValues(scope, cap, args.nodeId) ?? null : null;
11479
11479
  }
11480
- case "getIntegrationFormSchema": return typeof addon.getIntegrationFormSchema === "function" && args.instance !== void 0 ? await addon.getIntegrationFormSchema(args.instance, args.nodeId) ?? null : null;
11481
11480
  case "getDeviceSettings": return typeof addon.getDeviceSettings === "function" && typeof args.deviceId === "number" ? await addon.getDeviceSettings(args.deviceId) ?? null : null;
11482
11481
  case "updateDeviceSettings":
11483
11482
  if (typeof addon.updateDeviceSettings !== "function") throw new Error(`child-addon-call: addon "${addonId}" does not implement updateDeviceSettings`);
@@ -11422,7 +11422,6 @@ async function dispatchSettings(addon, addonId, method, args) {
11422
11422
  const { scope, cap } = requireScopedTarget(addonId, method, args);
11423
11423
  return typeof addon.readScopedValues === "function" ? await addon.readScopedValues(scope, cap, args.nodeId) ?? null : null;
11424
11424
  }
11425
- case "getIntegrationFormSchema": return typeof addon.getIntegrationFormSchema === "function" && args.instance !== void 0 ? await addon.getIntegrationFormSchema(args.instance, args.nodeId) ?? null : null;
11426
11425
  case "getDeviceSettings": return typeof addon.getDeviceSettings === "function" && typeof args.deviceId === "number" ? await addon.getDeviceSettings(args.deviceId) ?? null : null;
11427
11426
  case "updateDeviceSettings":
11428
11427
  if (typeof addon.updateDeviceSettings !== "function") throw new Error(`child-addon-call: addon "${addonId}" does not implement updateDeviceSettings`);
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-DX1gyM8o.js");
2
+ const require_dist = require("./dist-R_mOSFtH.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,4 +1,4 @@
1
- import { ec as defineRecordKinds } from "./dist-BNBgsEk0.mjs";
1
+ import { ec as defineRecordKinds } from "./dist-C0Df8iJl.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";
@@ -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-DX1gyM8o.js");
6
+ const require_dist = require("../../dist-R_mOSFtH.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { $o as BaseAddon, Yc as errMsg, Zc as EventCategory, pn as addonPagesCapability } from "../../dist-BNBgsEk0.mjs";
1
+ import { $o as BaseAddon, Yc as errMsg, Zc as EventCategory, pn as addonPagesCapability } from "../../dist-C0Df8iJl.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as fs$1 from "node:fs";
@@ -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-DX1gyM8o.js");
6
+ const require_dist = require("../../dist-R_mOSFtH.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { $o as BaseAddon, Yc as errMsg, Zc as EventCategory, hn as addonWidgetsCapability } from "../../dist-BNBgsEk0.mjs";
1
+ import { $o as BaseAddon, Yc as errMsg, Zc as EventCategory, hn as addonWidgetsCapability } from "../../dist-C0Df8iJl.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as fs$1 from "node:fs";