@camstack/server 1.2.592 → 1.2.594

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 (256) hide show
  1. package/dist/addon-root-inventory.js +11 -50
  2. package/dist/agent/addon-scan.js +6 -44
  3. package/dist/agent/agent-addon-runtime.js +3 -8
  4. package/dist/agent/agent-addon-updates.js +12 -52
  5. package/dist/agent/agent-cap-dispatch-service.js +3 -5
  6. package/dist/agent/agent-config.js +7 -42
  7. package/dist/agent/agent-deploy-swap.js +5 -41
  8. package/dist/agent/agent-group-runner.js +8 -47
  9. package/dist/agent/agent-http-auth.js +10 -22
  10. package/dist/agent/agent-http.js +69 -115
  11. package/dist/agent/agent-hub-addon-update.js +10 -16
  12. package/dist/agent/agent-hub-registration.js +4 -7
  13. package/dist/agent/agent-infra-capabilities.js +5 -9
  14. package/dist/agent/agent-json-file.js +5 -42
  15. package/dist/agent/agent-mesh-gate.js +5 -8
  16. package/dist/agent/agent-node-certificates.js +25 -28
  17. package/dist/agent/agent-pairing-local.js +10 -47
  18. package/dist/agent/agent-pairing-routes.js +16 -20
  19. package/dist/agent/agent-pairing-store.js +18 -58
  20. package/dist/agent/agent-reconnect.js +1 -4
  21. package/dist/agent/agent-service.js +42 -78
  22. package/dist/agent/agent-sniffing-listener.js +11 -48
  23. package/dist/agent/agent-undeploy.js +5 -41
  24. package/dist/agent/agent-update-routes.js +14 -19
  25. package/dist/agent/agent-update-service.js +38 -80
  26. package/dist/agent/apply-model-distribution.js +1 -4
  27. package/dist/agent/apply-stage-dev-uploads.js +6 -9
  28. package/dist/agent/derive-hub-url.js +3 -8
  29. package/dist/agent/fetch-bundle-from-hub.js +6 -9
  30. package/dist/agent/hubs-found.js +6 -43
  31. package/dist/agent/infra-boot-guard.js +1 -4
  32. package/dist/agent/infra-boot-plan.js +2 -6
  33. package/dist/agent/main.js +158 -186
  34. package/dist/agent/register-agent-cap-dispatch.js +3 -6
  35. package/dist/agent/serial-queue.js +2 -7
  36. package/dist/agent-status-page.js +1 -4
  37. package/dist/api/addon-upload.js +22 -61
  38. package/dist/api/agent-addon-delivery.js +6 -11
  39. package/dist/api/auth-whoami.js +1 -4
  40. package/dist/api/backup-download-pump.js +5 -9
  41. package/dist/api/backup-download.js +7 -10
  42. package/dist/api/core/addon-settings.router.js +16 -19
  43. package/dist/api/core/agent-pairing.router.js +76 -79
  44. package/dist/api/core/agents.router.js +21 -24
  45. package/dist/api/core/auth-admin-tokens.procedures.js +48 -52
  46. package/dist/api/core/auth-device-cert.procedures.js +62 -67
  47. package/dist/api/core/auth-limits.js +16 -25
  48. package/dist/api/core/auth-reauth.procedures.js +32 -37
  49. package/dist/api/core/auth-revoke-credentials.procedures.js +22 -26
  50. package/dist/api/core/auth-sessions.procedures.js +52 -56
  51. package/dist/api/core/auth.router.js +300 -304
  52. package/dist/api/core/cap-providers.js +74 -121
  53. package/dist/api/core/capabilities.router.js +34 -37
  54. package/dist/api/core/capability-preference-writes.js +10 -17
  55. package/dist/api/core/certificates.router.js +106 -109
  56. package/dist/api/core/cluster-nodes.router.js +15 -18
  57. package/dist/api/core/collection-preference.js +2 -6
  58. package/dist/api/core/event-bus-proxy.router.js +34 -37
  59. package/dist/api/core/failure-contributions.js +4 -8
  60. package/dist/api/core/hwaccel.router.js +17 -20
  61. package/dist/api/core/integration-secrets.js +8 -12
  62. package/dist/api/core/lifecycle-job-runner.js +13 -49
  63. package/dist/api/core/live-events.router.js +29 -32
  64. package/dist/api/core/load-contributions.js +4 -8
  65. package/dist/api/core/logging-settings.js +30 -43
  66. package/dist/api/core/logs.router.js +40 -43
  67. package/dist/api/core/notifications.router.js +15 -18
  68. package/dist/api/core/public-event-filter.js +4 -8
  69. package/dist/api/core/repl.router.js +18 -21
  70. package/dist/api/core/request-census-settings.js +11 -16
  71. package/dist/api/core/server-management.provider.js +1 -4
  72. package/dist/api/core/server-name.js +9 -17
  73. package/dist/api/core/site-location.js +16 -24
  74. package/dist/api/core/stream-probe.router.js +21 -24
  75. package/dist/api/core/system-events.router.js +23 -26
  76. package/dist/api/cors/cors-policy.js +20 -29
  77. package/dist/api/cors/register-cors-policy.js +9 -14
  78. package/dist/api/deploy-stage-registry.js +6 -10
  79. package/dist/api/dev-uploads-bundle.js +12 -50
  80. package/dist/api/health/adaptive-probe.routes.js +9 -13
  81. package/dist/api/health/health.routes.js +8 -13
  82. package/dist/api/hub-cluster-url.js +3 -9
  83. package/dist/api/model-distributor.js +12 -50
  84. package/dist/api/oauth2/consent-page.js +10 -13
  85. package/dist/api/oauth2/oauth2-routes.js +17 -25
  86. package/dist/api/oauth2/private-host.js +1 -4
  87. package/dist/api/server-upload-propagate.js +15 -51
  88. package/dist/api/server-upload.js +13 -50
  89. package/dist/api/sse-no-compression.js +1 -4
  90. package/dist/api/static/frame-policy.js +4 -9
  91. package/dist/api/static/precompressed-asset.js +15 -57
  92. package/dist/api/static/spa-mount.js +8 -47
  93. package/dist/api/static/spa-static.js +5 -12
  94. package/dist/api/tarball-manifest.js +7 -44
  95. package/dist/api/trpc/cap-mount-helpers.js +7 -12
  96. package/dist/api/trpc/cap-route-error-formatter.js +10 -13
  97. package/dist/api/trpc/cap-router-runtime.js +40 -51
  98. package/dist/api/trpc/client-ip.js +9 -20
  99. package/dist/api/trpc/core-cap-bridge.js +32 -42
  100. package/dist/api/trpc/device-collection-dispatch.js +23 -27
  101. package/dist/api/trpc/device-config-secret-redaction.js +24 -40
  102. package/dist/api/trpc/generated-cap-mounts.js +219 -221
  103. package/dist/api/trpc/generated-cap-routers.js +4878 -4726
  104. package/dist/api/trpc/http-request-census-hook.js +8 -11
  105. package/dist/api/trpc/http-request-census.js +34 -41
  106. package/dist/api/trpc/http-request-census.singleton.js +4 -8
  107. package/dist/api/trpc/localized-schema-paths.js +1 -4
  108. package/dist/api/trpc/principal-visibility.js +14 -22
  109. package/dist/api/trpc/remote-addon-update-grant.js +1 -4
  110. package/dist/api/trpc/scope-access.js +10 -15
  111. package/dist/api/trpc/server-provided-caps.js +3 -7
  112. package/dist/api/trpc/share-view-access.js +6 -14
  113. package/dist/api/trpc/trpc-error-device-tags.js +3 -6
  114. package/dist/api/trpc/trpc-error-principal.js +2 -6
  115. package/dist/api/trpc/trpc.context.js +20 -25
  116. package/dist/api/trpc/trpc.middleware.js +38 -46
  117. package/dist/api/trpc/trpc.router.js +58 -99
  118. package/dist/api/trpc/user-error.js +5 -8
  119. package/dist/api/trpc/ws-request-census.js +17 -24
  120. package/dist/api/trpc/ws-slow-consumer-guard.js +11 -16
  121. package/dist/api/upload-auth.js +5 -9
  122. package/dist/auth/addon-route-jwt-gate.js +4 -7
  123. package/dist/auth/addon-route-share-gate.js +7 -12
  124. package/dist/auth/app-confirm-page.js +17 -22
  125. package/dist/auth/app-confirm-routes.js +26 -31
  126. package/dist/auth/app-confirmations.js +7 -44
  127. package/dist/auth/app-page-shell.js +17 -30
  128. package/dist/auth/app-page-strings.js +11 -17
  129. package/dist/auth/app-passkey-page.js +16 -21
  130. package/dist/auth/app-passkey-routes.js +37 -41
  131. package/dist/auth/app-refused-route.js +13 -18
  132. package/dist/auth/auth-network-policy.js +11 -15
  133. package/dist/auth/auth-provider-gate.js +4 -9
  134. package/dist/auth/auth-rate-limit.js +3 -7
  135. package/dist/auth/client-address.js +6 -9
  136. package/dist/auth/device-enroll-proofs.js +6 -43
  137. package/dist/auth/external-link-intents.js +3 -7
  138. package/dist/auth/hub-sessions.js +6 -12
  139. package/dist/auth/native-link-completions.js +7 -11
  140. package/dist/auth/native-return.js +9 -13
  141. package/dist/auth/passkey-provider.js +26 -32
  142. package/dist/auth/second-factors.js +6 -10
  143. package/dist/auth/session-connections.js +6 -12
  144. package/dist/auth/session-cookie.js +12 -23
  145. package/dist/auth/session-lifetimes.js +8 -12
  146. package/dist/auth/session-mint.js +4 -11
  147. package/dist/auth/sso-finish-app.js +13 -16
  148. package/dist/auth/sso-finish-deps.js +21 -27
  149. package/dist/auth/sso-finish.js +28 -38
  150. package/dist/auth/sso-routes.js +22 -25
  151. package/dist/auth/used-bridge-ids.js +1 -5
  152. package/dist/boot/boot-config.js +16 -55
  153. package/dist/boot/init-sequence.js +1 -4
  154. package/dist/boot/integration-id-backfill.js +3 -8
  155. package/dist/boot/platform-keychain-key.js +5 -42
  156. package/dist/boot/post-boot.service.js +14 -18
  157. package/dist/boot/reconcile-lifecycle-jobs.js +3 -6
  158. package/dist/boot/retired-public-url-env.js +4 -8
  159. package/dist/bootstrap-packages.js +1 -4
  160. package/dist/closure-node-modules.js +2 -38
  161. package/dist/closure-patches/patch-reach.json +6 -2
  162. package/dist/core/addon/addon-call-gateway.js +1 -5
  163. package/dist/core/addon/addon-package.service.js +83 -123
  164. package/dist/core/addon/addon-process-view.js +2 -6
  165. package/dist/core/addon/addon-realign-plan.js +1 -4
  166. package/dist/core/addon/addon-registry.service.js +254 -197
  167. package/dist/core/addon/addon-row-manifest.js +1 -4
  168. package/dist/core/addon/addon-search.service.js +3 -7
  169. package/dist/core/addon/addon-settings-provider.js +1 -3
  170. package/dist/core/addon/addon-uninstall.js +4 -11
  171. package/dist/core/addon/addon.tokens.js +2 -5
  172. package/dist/core/addon/device-meta-mirror.js +8 -13
  173. package/dist/core/addon/forked-custom-actions.js +6 -11
  174. package/dist/core/addon/integration-visibility.js +3 -6
  175. package/dist/core/addon/materialize-route-path.js +1 -4
  176. package/dist/core/addon/package-dir-utils.js +8 -45
  177. package/dist/core/addon/prune-misplaced-addons.js +5 -43
  178. package/dist/core/addon/runner-convergence.js +1 -4
  179. package/dist/core/addon/runner-serialization.js +1 -4
  180. package/dist/core/addon/runner-spawn-fanout.js +3 -8
  181. package/dist/core/addon/settings-door-wiring.js +5 -8
  182. package/dist/core/addon/single-flight-refresh.js +1 -4
  183. package/dist/core/addon-bridge/addon-bridge.service.js +7 -44
  184. package/dist/core/addon-pages/addon-pages.service.js +3 -40
  185. package/dist/core/addon-widgets/addon-widgets.service.js +4 -42
  186. package/dist/core/agent/agent-addon-backfill.js +9 -17
  187. package/dist/core/agent/agent-delivery-ledger.js +3 -7
  188. package/dist/core/agent/agent-liveness-event.js +2 -6
  189. package/dist/core/agent/agent-pairing-http.js +41 -45
  190. package/dist/core/agent/agent-registry.service.js +53 -92
  191. package/dist/core/agent/cluster-node-history-mirror.js +3 -7
  192. package/dist/core/agent/cluster-node-history-store.js +113 -58
  193. package/dist/core/agent/hub-agent-pairing.js +1 -5
  194. package/dist/core/agent/node-certificates-client.js +3 -6
  195. package/dist/core/agent/node-directory.js +1 -4
  196. package/dist/core/app-links/well-known-app-links.js +2 -6
  197. package/dist/core/auth/auth.service.js +3 -8
  198. package/dist/core/auth/handoff-code.service.js +11 -49
  199. package/dist/core/auth/record-kinds.js +35 -0
  200. package/dist/core/auth/share-token.service.js +174 -122
  201. package/dist/core/capability/capability.service.js +1 -5
  202. package/dist/core/config/config.schema.js +1 -6
  203. package/dist/core/config/config.service.js +2 -6
  204. package/dist/core/events/event-bus.service.js +3 -7
  205. package/dist/core/feature/feature.service.js +2 -6
  206. package/dist/core/lifecycle/lifecycle-runner.singleton.js +5 -10
  207. package/dist/core/lifecycle/lifecycle-state-machine.js +1 -5
  208. package/dist/core/logging/log-ring-buffer.js +1 -5
  209. package/dist/core/logging/logging.service.js +5 -9
  210. package/dist/core/logging/scoped-logger.js +1 -5
  211. package/dist/core/moleculer/agent-readiness-pull.js +1 -4
  212. package/dist/core/moleculer/agent-registration-request.js +3 -7
  213. package/dist/core/moleculer/cap-call-fn.js +39 -5
  214. package/dist/core/moleculer/cap-route-authority.js +3 -8
  215. package/dist/core/moleculer/hub-mesh-guard.js +5 -9
  216. package/dist/core/moleculer/moleculer.service.js +108 -119
  217. package/dist/core/network/network-quality.service.js +2 -6
  218. package/dist/core/notification/notification-wrapper.service.js +3 -7
  219. package/dist/core/notification/toast-wrapper.service.js +3 -7
  220. package/dist/core/provider/provider.tokens.js +1 -4
  221. package/dist/core/repl/repl-engine.service.js +4 -8
  222. package/dist/core/runner-health/runner-boot-check.js +7 -15
  223. package/dist/core/runner-health/update-preflight.js +9 -14
  224. package/dist/core/server-update/server-update.service.js +12 -49
  225. package/dist/core/server-update/system-apply-closure-patches.js +6 -42
  226. package/dist/core/server-update/system-ensure-prebuilds.js +3 -6
  227. package/dist/core/server-update/system-exec-npm.js +2 -5
  228. package/dist/core/storage/fs-storage-backend.js +1 -5
  229. package/dist/core/storage/storage-location-manager.js +1 -5
  230. package/dist/core/storage/storage.service.js +2 -6
  231. package/dist/core/streaming/ffmpeg-stream-info.js +3 -8
  232. package/dist/core/streaming/stream-probe.service.js +12 -16
  233. package/dist/core/streaming/ttl-cache.js +1 -5
  234. package/dist/core/topology/topology-emitter.service.js +19 -23
  235. package/dist/core/update-availability-emitter.js +3 -7
  236. package/dist/core/update-availability-store.js +8 -45
  237. package/dist/core/updates/agent-installed-packages.js +5 -9
  238. package/dist/core/updates/restart-marker.js +3 -8
  239. package/dist/core/updates/update-check-scheduler.js +13 -18
  240. package/dist/core/updates/wrapper-update-checker.js +3 -7
  241. package/dist/first-boot-addon-plan.js +2 -6
  242. package/dist/framework-nodepath.js +2 -38
  243. package/dist/i18n/request-lang.js +7 -11
  244. package/dist/launcher.js +30 -65
  245. package/dist/lifecycle-journal-path.js +2 -38
  246. package/dist/main.js +287 -324
  247. package/dist/manual-boot.js +120 -157
  248. package/dist/node-role.js +1 -4
  249. package/dist/package-inventory.js +7 -48
  250. package/dist/pending-restore.js +7 -43
  251. package/dist/single-copy-cleanup-runner.js +9 -45
  252. package/dist/single-copy-cleanup.js +7 -15
  253. package/dist/sqlite-restore.js +9 -48
  254. package/dist/starter.js +4 -39
  255. package/dist/ui-serving/lazy-ui-serving.js +3 -39
  256. package/package.json +13 -13
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * The hub asks a (re)connected agent for its capability set.
4
3
  *
@@ -18,10 +17,7 @@
18
17
  * be asked: that is said, with whether the hub holds its registration, so an
19
18
  * online-but-capless node is never silent.
20
19
  */
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.AGENT_REQUEST_REGISTRATION_ACTION = void 0;
23
- exports.requestAgentRegistration = requestAgentRegistration;
24
- exports.AGENT_REQUEST_REGISTRATION_ACTION = '$agent.requestRegistration';
20
+ export const AGENT_REQUEST_REGISTRATION_ACTION = '$agent.requestRegistration';
25
21
  function errorType(err) {
26
22
  if (typeof err !== 'object' || err === null)
27
23
  return null;
@@ -32,9 +28,9 @@ function errorText(err) {
32
28
  return err instanceof Error ? err.message : String(err);
33
29
  }
34
30
  /** Ask `nodeId` to re-send its complete capability manifest. Never throws. */
35
- async function requestAgentRegistration(deps, nodeId) {
31
+ export async function requestAgentRegistration(deps, nodeId) {
36
32
  try {
37
- await deps.call(exports.AGENT_REQUEST_REGISTRATION_ACTION, {}, { nodeID: nodeId });
33
+ await deps.call(AGENT_REQUEST_REGISTRATION_ACTION, {}, { nodeID: nodeId });
38
34
  return 'requested';
39
35
  }
40
36
  catch (err) {
@@ -1,6 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildCapCallFn = buildCapCallFn;
1
+ /**
2
+ * cap-call-fn — the per-(cap, node) dispatcher behind every CapabilityRegistry
3
+ * provider proxy the hub builds in `applyNodeManifest`.
4
+ *
5
+ * Extracted from `MoleculerService` so its routing branches are unit-testable
6
+ * in isolation (the closure that lived inline could only be exercised by
7
+ * standing up a full broker). It closes a UDS-migration gap: the inline
8
+ * version hand-rolled a `broker.call` for any non-hub-local provider, so an
9
+ * AGENT-hosted addon cap (a UDS child of the agent, NOT a Moleculer service)
10
+ * resolved to a Moleculer node that does not exist → `waitForServices` waited
11
+ * its full 30s discovery timeout → "Services waiting is timed out". The fix
12
+ * routes everything that isn't a hub-local child through the unified
13
+ * `CapRouteResolver`, which classifies an agent node as `agent-child-forward`
14
+ * (hub → agent over Moleculer → agent's UDS child) and a direct remote as
15
+ * `remote-moleculer`.
16
+ */
17
+ import { CALLER_STAMPED_CAPABILITIES } from '@camstack/types';
4
18
  /** Extract a numeric `deviceId` routing hint out of arbitrary method args. */
5
19
  function extractDeviceId(params) {
6
20
  if (params === null || typeof params !== 'object')
@@ -8,11 +22,24 @@ function extractDeviceId(params) {
8
22
  const raw = Reflect.get(params, 'deviceId');
9
23
  return typeof raw === 'number' ? raw : undefined;
10
24
  }
25
+ /**
26
+ * Hub in-process builtins state `callerAddonId` in args (see
27
+ * `AddonRegistryService.inProcessRecordsTransport`). A registry proxy routes
28
+ * over UDS; without lifting this to {@link CapCallInput.callerAddonId} the
29
+ * child strips the claim (`stampCallerAddonId` with no wire stamp) and records
30
+ * refuses `no-caller`.
31
+ */
32
+ function extractStatedCallerAddonId(params) {
33
+ if (params === null || typeof params !== 'object' || Array.isArray(params))
34
+ return undefined;
35
+ const raw = Reflect.get(params, 'callerAddonId');
36
+ return typeof raw === 'string' && raw.length > 0 ? raw : undefined;
37
+ }
11
38
  /**
12
39
  * Build the `CallFn` (`(method, params, targetNodeId?) => Promise`) for one
13
40
  * registered provider. See module docs for the routing rationale.
14
41
  */
15
- function buildCapCallFn(deps) {
42
+ export function buildCapCallFn(deps) {
16
43
  return async (method, params, targetNodeId) => {
17
44
  const deviceId = extractDeviceId(params);
18
45
  // ── Hub-local child: route per-child over UDS (collection-safe — keyed by
@@ -25,12 +52,16 @@ function buildCapCallFn(deps) {
25
52
  const registry = deps.getLocalChildRegistry();
26
53
  if (registry !== null && registry.childProvides(deps.udsChildId, deps.capName, deviceId)) {
27
54
  deps.onUdsRoute?.(deps.capName);
55
+ const statedCaller = CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
56
+ ? extractStatedCallerAddonId(params)
57
+ : undefined;
28
58
  const input = {
29
59
  capName: deps.capName,
30
60
  method,
31
61
  args: params,
32
62
  ...(deviceId !== undefined ? { deviceId } : {}),
33
63
  ...(deps.addonId !== undefined ? { addonId: deps.addonId } : {}),
64
+ ...(statedCaller !== undefined ? { callerAddonId: statedCaller } : {}),
34
65
  };
35
66
  return registry.callCapOnChild(deps.udsChildId, input);
36
67
  }
@@ -45,11 +76,14 @@ function buildCapCallFn(deps) {
45
76
  // there is a harmless no-op.
46
77
  const resolver = deps.getResolver();
47
78
  if (resolver !== null) {
79
+ const statedCaller = CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
80
+ ? extractStatedCallerAddonId(params)
81
+ : undefined;
48
82
  const route = resolver.resolveCapRoute(deps.capName, {
49
83
  nodeId: targetNodeId ?? deps.nodeId,
50
84
  ...(deviceId !== undefined ? { deviceId } : {}),
51
85
  });
52
- return resolver.dispatch(route, method, params, deps.addonId);
86
+ return resolver.dispatch(route, method, params, deps.addonId, statedCaller);
53
87
  }
54
88
  // ── Pre-init window (resolver not yet constructed): legacy Moleculer call.
55
89
  return deps.legacyBrokerCall(method, params, targetNodeId ?? deps.nodeId);
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Adapter factories that bridge the server-side registry/service state into the
4
3
  * narrow interfaces that CapRouteResolver (in @camstack/system) requires.
@@ -13,10 +12,6 @@
13
12
  * hub child → 'hub/<runnerId>' → not an agent
14
13
  * agent → bare id with no '/' → agent
15
14
  */
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.createNodeCapAuthority = createNodeCapAuthority;
18
- exports.createInProcessProviderLookup = createInProcessProviderLookup;
19
- exports.createHubResidentProviderLookup = createHubResidentProviderLookup;
20
15
  /**
21
16
  * Build a NodeCapAuthority backed by a HubNodeRegistry.
22
17
  *
@@ -32,7 +27,7 @@ exports.createHubResidentProviderLookup = createHubResidentProviderLookup;
32
27
  * child under an agent provides a cap (the agent flattens its subtree into
33
28
  * one merged manifest). The agent resolves its own child locally (Task 6).
34
29
  */
35
- function createNodeCapAuthority(nodeRegistry, resolver) {
30
+ export function createNodeCapAuthority(nodeRegistry, resolver) {
36
31
  return {
37
32
  nodeKnowsCap(nodeId, capName) {
38
33
  // Check system (manifest) caps first
@@ -102,7 +97,7 @@ function createNodeCapAuthority(nodeRegistry, resolver) {
102
97
  * Function (implicit `any` return); calling via `fn.call(provider, args)` is
103
98
  * then safe and the result is captured as `unknown`. No `as` casts anywhere.
104
99
  */
105
- function createInProcessProviderLookup(capabilityService) {
100
+ export function createInProcessProviderLookup(capabilityService) {
106
101
  return (capName) => {
107
102
  const provider = capabilityService.getSingletonForNode?.(capName, 'hub') ??
108
103
  capabilityService.getSingleton(capName);
@@ -126,7 +121,7 @@ function createInProcessProviderLookup(capabilityService) {
126
121
  * the hub landed on a remote agent whenever the hub's decoder runner was
127
122
  * circuit-broken). Wired into `CapRouteResolver.hubResidentProviders`.
128
123
  */
129
- function createHubResidentProviderLookup(capabilityService) {
124
+ export function createHubResidentProviderLookup(capabilityService) {
130
125
  return (capName) => {
131
126
  const provider = capabilityService.getSingletonForNode?.(capName, 'hub');
132
127
  if (provider === null || provider === undefined)
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HubMeshGuard = void 0;
4
1
  /**
5
2
  * The hub's mesh guard (D802, D857) — the one object that decides whether
6
3
  * another node may talk to the hub.
@@ -14,20 +11,20 @@ exports.HubMeshGuard = void 0;
14
11
  *
15
12
  * Kept out of `moleculer.service.ts` so that file only wires it.
16
13
  */
17
- const system_1 = require("@camstack/system");
14
+ import { createMeshAccessMiddleware, isProcessVerifiedMeshPeer, MeshIdentityGate, } from '@camstack/system';
18
15
  /** At most one "refused" line per node per this long. */
19
16
  const REFUSED_LOG_INTERVAL_MS = 60_000;
20
- class HubMeshGuard {
17
+ export class HubMeshGuard {
21
18
  ownNodeId;
22
19
  logger;
23
20
  now;
24
21
  gate;
25
22
  lastLoggedAt = new Map();
26
- constructor(ownNodeId, logger, now = Date.now, isVerifiedPeer = system_1.isProcessVerifiedMeshPeer) {
23
+ constructor(ownNodeId, logger, now = Date.now, isVerifiedPeer = isProcessVerifiedMeshPeer) {
27
24
  this.ownNodeId = ownNodeId;
28
25
  this.logger = logger;
29
26
  this.now = now;
30
- this.gate = new system_1.MeshIdentityGate({
27
+ this.gate = new MeshIdentityGate({
31
28
  ownNodeId,
32
29
  isVerifiedPeer,
33
30
  onRefused: (nodeId, what) => this.noteRefused(nodeId, what),
@@ -35,7 +32,7 @@ class HubMeshGuard {
35
32
  }
36
33
  /** The middleware the hub broker must be constructed with. */
37
34
  middleware() {
38
- return (0, system_1.createMeshAccessMiddleware)({
35
+ return createMeshAccessMiddleware({
39
36
  ownNodeId: this.ownNodeId,
40
37
  gate: this.gate,
41
38
  logger: {
@@ -59,4 +56,3 @@ class HubMeshGuard {
59
56
  'System → Cluster → Agents', { tags: { nodeId }, meta: { firstCall: what } });
60
57
  }
61
58
  }
62
- exports.HubMeshGuard = HubMeshGuard;