@camstack/server 1.2.594 → 1.2.596
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.
- package/dist/addon-root-inventory.js +50 -11
- package/dist/agent/addon-scan.js +44 -6
- package/dist/agent/agent-addon-runtime.js +8 -3
- package/dist/agent/agent-addon-updates.js +52 -12
- package/dist/agent/agent-cap-dispatch-service.js +5 -3
- package/dist/agent/agent-config.js +42 -7
- package/dist/agent/agent-deploy-swap.js +41 -5
- package/dist/agent/agent-group-runner.js +47 -8
- package/dist/agent/agent-http-auth.js +22 -10
- package/dist/agent/agent-http.js +113 -64
- package/dist/agent/agent-hub-addon-update.js +16 -10
- package/dist/agent/agent-hub-registration.js +7 -4
- package/dist/agent/agent-infra-capabilities.js +9 -5
- package/dist/agent/agent-json-file.js +42 -5
- package/dist/agent/agent-mesh-gate.js +8 -5
- package/dist/agent/agent-node-certificates.js +28 -25
- package/dist/agent/agent-pairing-local.js +47 -10
- package/dist/agent/agent-pairing-routes.js +20 -16
- package/dist/agent/agent-pairing-store.js +58 -18
- package/dist/agent/agent-reconnect.js +4 -1
- package/dist/agent/agent-service.js +71 -35
- package/dist/agent/agent-sniffing-listener.js +48 -11
- package/dist/agent/agent-undeploy.js +41 -5
- package/dist/agent/agent-update-routes.js +19 -14
- package/dist/agent/agent-update-service.js +80 -38
- package/dist/agent/apply-model-distribution.js +4 -1
- package/dist/agent/apply-stage-dev-uploads.js +9 -6
- package/dist/agent/derive-hub-url.js +8 -3
- package/dist/agent/fetch-bundle-from-hub.js +9 -6
- package/dist/agent/hubs-found.js +43 -6
- package/dist/agent/infra-boot-guard.js +4 -1
- package/dist/agent/infra-boot-plan.js +6 -2
- package/dist/agent/main.js +183 -148
- package/dist/agent/register-agent-cap-dispatch.js +6 -3
- package/dist/agent/serial-queue.js +7 -2
- package/dist/agent-status-page.js +4 -1
- package/dist/api/addon-upload.js +61 -22
- package/dist/api/agent-addon-delivery.js +11 -6
- package/dist/api/auth-whoami.js +4 -1
- package/dist/api/backup-download-pump.js +9 -5
- package/dist/api/backup-download.js +10 -7
- package/dist/api/core/addon-settings.router.js +19 -16
- package/dist/api/core/agent-pairing.router.js +79 -76
- package/dist/api/core/agents.router.js +24 -21
- package/dist/api/core/auth-admin-tokens.procedures.js +52 -48
- package/dist/api/core/auth-device-cert.procedures.js +67 -62
- package/dist/api/core/auth-limits.js +25 -16
- package/dist/api/core/auth-reauth.procedures.js +37 -32
- package/dist/api/core/auth-revoke-credentials.procedures.js +26 -22
- package/dist/api/core/auth-sessions.procedures.js +56 -52
- package/dist/api/core/auth.router.js +304 -300
- package/dist/api/core/cap-providers.js +121 -74
- package/dist/api/core/capabilities.router.js +37 -34
- package/dist/api/core/capability-preference-writes.js +17 -10
- package/dist/api/core/certificates.router.js +109 -106
- package/dist/api/core/cluster-nodes.router.js +18 -15
- package/dist/api/core/collection-preference.js +6 -2
- package/dist/api/core/event-bus-proxy.router.js +37 -34
- package/dist/api/core/failure-contributions.js +8 -4
- package/dist/api/core/hwaccel.router.js +20 -17
- package/dist/api/core/integration-secrets.js +12 -8
- package/dist/api/core/lifecycle-job-runner.js +49 -13
- package/dist/api/core/live-events.router.js +32 -29
- package/dist/api/core/load-contributions.js +8 -4
- package/dist/api/core/logging-settings.js +43 -30
- package/dist/api/core/logs.router.js +43 -40
- package/dist/api/core/notifications.router.js +18 -15
- package/dist/api/core/public-event-filter.js +8 -4
- package/dist/api/core/repl.router.js +21 -18
- package/dist/api/core/request-census-settings.js +16 -11
- package/dist/api/core/server-management.provider.js +4 -1
- package/dist/api/core/server-name.js +17 -9
- package/dist/api/core/site-location.js +24 -16
- package/dist/api/core/stream-probe.router.js +24 -21
- package/dist/api/core/system-events.router.js +26 -23
- package/dist/api/cors/cors-policy.js +29 -20
- package/dist/api/cors/register-cors-policy.js +14 -9
- package/dist/api/deploy-stage-registry.js +10 -6
- package/dist/api/dev-uploads-bundle.js +50 -12
- package/dist/api/health/adaptive-probe.routes.js +13 -9
- package/dist/api/health/health.routes.js +13 -8
- package/dist/api/hub-cluster-url.js +9 -3
- package/dist/api/model-distributor.js +50 -12
- package/dist/api/oauth2/consent-page.js +13 -10
- package/dist/api/oauth2/oauth2-routes.js +25 -17
- package/dist/api/oauth2/private-host.js +4 -1
- package/dist/api/server-upload-propagate.js +51 -15
- package/dist/api/server-upload.js +50 -13
- package/dist/api/sse-no-compression.js +4 -1
- package/dist/api/static/frame-policy.js +9 -4
- package/dist/api/static/precompressed-asset.js +57 -15
- package/dist/api/static/spa-mount.js +47 -8
- package/dist/api/static/spa-static.js +12 -5
- package/dist/api/tarball-manifest.js +44 -7
- package/dist/api/trpc/cap-mount-helpers.js +12 -7
- package/dist/api/trpc/cap-route-error-formatter.js +13 -10
- package/dist/api/trpc/cap-router-runtime.js +51 -40
- package/dist/api/trpc/client-ip.js +20 -9
- package/dist/api/trpc/core-cap-bridge.js +42 -32
- package/dist/api/trpc/device-collection-dispatch.js +27 -23
- package/dist/api/trpc/device-config-secret-redaction.js +40 -24
- package/dist/api/trpc/generated-cap-mounts.js +225 -219
- package/dist/api/trpc/generated-cap-routers.js +5167 -4852
- package/dist/api/trpc/http-request-census-hook.js +11 -8
- package/dist/api/trpc/http-request-census.js +41 -34
- package/dist/api/trpc/http-request-census.singleton.js +8 -4
- package/dist/api/trpc/localized-schema-paths.js +4 -1
- package/dist/api/trpc/principal-visibility.js +22 -14
- package/dist/api/trpc/remote-addon-update-grant.js +4 -1
- package/dist/api/trpc/scope-access.js +15 -10
- package/dist/api/trpc/server-provided-caps.js +7 -3
- package/dist/api/trpc/share-view-access.js +14 -6
- package/dist/api/trpc/trpc-error-device-tags.js +6 -3
- package/dist/api/trpc/trpc-error-principal.js +6 -2
- package/dist/api/trpc/trpc.context.js +25 -20
- package/dist/api/trpc/trpc.middleware.js +46 -38
- package/dist/api/trpc/trpc.router.js +99 -58
- package/dist/api/trpc/user-error.js +8 -5
- package/dist/api/trpc/ws-request-census.js +24 -17
- package/dist/api/trpc/ws-slow-consumer-guard.js +16 -11
- package/dist/api/upload-auth.js +9 -5
- package/dist/auth/addon-route-jwt-gate.js +7 -4
- package/dist/auth/addon-route-share-gate.js +12 -7
- package/dist/auth/app-confirm-page.js +22 -17
- package/dist/auth/app-confirm-routes.js +31 -26
- package/dist/auth/app-confirmations.js +44 -7
- package/dist/auth/app-page-shell.js +30 -17
- package/dist/auth/app-page-strings.js +17 -11
- package/dist/auth/app-passkey-page.js +21 -16
- package/dist/auth/app-passkey-routes.js +41 -37
- package/dist/auth/app-refused-route.js +18 -13
- package/dist/auth/auth-network-policy.js +15 -11
- package/dist/auth/auth-provider-gate.js +9 -4
- package/dist/auth/auth-rate-limit.js +7 -3
- package/dist/auth/client-address.js +9 -6
- package/dist/auth/device-enroll-proofs.js +43 -6
- package/dist/auth/external-link-intents.js +7 -3
- package/dist/auth/hub-sessions.js +12 -6
- package/dist/auth/native-link-completions.js +11 -7
- package/dist/auth/native-return.js +13 -9
- package/dist/auth/passkey-provider.js +32 -26
- package/dist/auth/second-factors.js +10 -6
- package/dist/auth/session-connections.js +12 -6
- package/dist/auth/session-cookie.js +23 -12
- package/dist/auth/session-lifetimes.js +12 -8
- package/dist/auth/session-mint.js +11 -4
- package/dist/auth/sso-finish-app.js +16 -13
- package/dist/auth/sso-finish-deps.js +27 -21
- package/dist/auth/sso-finish.js +38 -28
- package/dist/auth/sso-routes.js +25 -22
- package/dist/auth/used-bridge-ids.js +5 -1
- package/dist/boot/boot-config.js +55 -16
- package/dist/boot/init-sequence.js +4 -1
- package/dist/boot/integration-id-backfill.js +8 -3
- package/dist/boot/platform-keychain-key.js +42 -5
- package/dist/boot/post-boot.service.js +18 -14
- package/dist/boot/reconcile-lifecycle-jobs.js +6 -3
- package/dist/boot/retired-public-url-env.js +8 -4
- package/dist/bootstrap-packages.js +4 -1
- package/dist/closure-node-modules.js +38 -2
- package/dist/core/addon/addon-call-gateway.js +5 -1
- package/dist/core/addon/addon-package.service.js +123 -83
- package/dist/core/addon/addon-process-view.js +6 -2
- package/dist/core/addon/addon-realign-plan.js +4 -1
- package/dist/core/addon/addon-registry.service.js +187 -146
- package/dist/core/addon/addon-row-manifest.js +4 -1
- package/dist/core/addon/addon-search.service.js +7 -3
- package/dist/core/addon/addon-settings-provider.js +3 -1
- package/dist/core/addon/addon-uninstall.js +11 -4
- package/dist/core/addon/addon.tokens.js +5 -2
- package/dist/core/addon/device-meta-mirror.js +13 -8
- package/dist/core/addon/forked-custom-actions.js +11 -6
- package/dist/core/addon/integration-visibility.js +6 -3
- package/dist/core/addon/materialize-route-path.js +4 -1
- package/dist/core/addon/package-dir-utils.js +45 -8
- package/dist/core/addon/prune-misplaced-addons.js +43 -5
- package/dist/core/addon/runner-convergence.js +4 -1
- package/dist/core/addon/runner-serialization.js +4 -1
- package/dist/core/addon/runner-spawn-fanout.js +8 -3
- package/dist/core/addon/settings-door-wiring.js +8 -5
- package/dist/core/addon/single-flight-refresh.js +4 -1
- package/dist/core/addon-bridge/addon-bridge.service.js +44 -7
- package/dist/core/addon-pages/addon-pages.service.js +40 -3
- package/dist/core/addon-widgets/addon-widgets.service.js +42 -4
- package/dist/core/agent/agent-addon-backfill.js +17 -9
- package/dist/core/agent/agent-delivery-ledger.js +7 -3
- package/dist/core/agent/agent-liveness-event.js +6 -2
- package/dist/core/agent/agent-pairing-http.js +45 -41
- package/dist/core/agent/agent-registry.service.js +89 -50
- package/dist/core/agent/cluster-node-history-mirror.js +7 -3
- package/dist/core/agent/cluster-node-history-store.js +35 -31
- package/dist/core/agent/hub-agent-pairing.js +5 -1
- package/dist/core/agent/node-certificates-client.js +6 -3
- package/dist/core/agent/node-directory.js +4 -1
- package/dist/core/app-links/well-known-app-links.js +6 -2
- package/dist/core/auth/auth.service.js +8 -3
- package/dist/core/auth/handoff-code.service.js +49 -11
- package/dist/core/auth/record-kinds.js +19 -16
- package/dist/core/auth/share-token.service.js +79 -42
- package/dist/core/capability/capability.service.js +5 -1
- package/dist/core/config/config.schema.js +6 -1
- package/dist/core/config/config.service.js +6 -2
- package/dist/core/events/event-bus.service.js +7 -3
- package/dist/core/feature/feature.service.js +6 -2
- package/dist/core/lifecycle/lifecycle-runner.singleton.js +10 -5
- package/dist/core/lifecycle/lifecycle-state-machine.js +5 -1
- package/dist/core/logging/log-ring-buffer.js +5 -1
- package/dist/core/logging/logging.service.js +9 -5
- package/dist/core/logging/scoped-logger.js +5 -1
- package/dist/core/moleculer/agent-readiness-pull.js +4 -1
- package/dist/core/moleculer/agent-registration-request.js +7 -3
- package/dist/core/moleculer/cap-call-fn.js +7 -4
- package/dist/core/moleculer/cap-route-authority.js +8 -3
- package/dist/core/moleculer/hub-mesh-guard.js +9 -5
- package/dist/core/moleculer/moleculer.service.js +86 -79
- package/dist/core/network/network-quality.service.js +6 -2
- package/dist/core/notification/notification-wrapper.service.js +7 -3
- package/dist/core/notification/toast-wrapper.service.js +7 -3
- package/dist/core/provider/provider.tokens.js +4 -1
- package/dist/core/repl/repl-engine.service.js +8 -4
- package/dist/core/runner-health/runner-boot-check.js +15 -7
- package/dist/core/runner-health/update-preflight.js +14 -9
- package/dist/core/server-update/server-update.service.js +49 -12
- package/dist/core/server-update/system-apply-closure-patches.js +42 -6
- package/dist/core/server-update/system-ensure-prebuilds.js +6 -3
- package/dist/core/server-update/system-exec-npm.js +5 -2
- package/dist/core/storage/fs-storage-backend.js +5 -1
- package/dist/core/storage/storage-location-manager.js +5 -1
- package/dist/core/storage/storage.service.js +6 -2
- package/dist/core/streaming/ffmpeg-stream-info.js +8 -3
- package/dist/core/streaming/stream-probe.service.js +16 -12
- package/dist/core/streaming/ttl-cache.js +5 -1
- package/dist/core/topology/topology-emitter.service.js +23 -19
- package/dist/core/update-availability-emitter.js +7 -3
- package/dist/core/update-availability-store.js +45 -8
- package/dist/core/updates/agent-installed-packages.js +9 -5
- package/dist/core/updates/restart-marker.js +8 -3
- package/dist/core/updates/update-check-scheduler.js +18 -13
- package/dist/core/updates/wrapper-update-checker.js +7 -3
- package/dist/first-boot-addon-plan.js +6 -2
- package/dist/framework-nodepath.js +38 -2
- package/dist/i18n/request-lang.js +11 -7
- package/dist/launcher.js +65 -30
- package/dist/lifecycle-journal-path.js +38 -2
- package/dist/main.js +324 -286
- package/dist/manual-boot.js +156 -117
- package/dist/node-role.js +4 -1
- package/dist/package-inventory.js +48 -7
- package/dist/pending-restore.js +43 -7
- package/dist/single-copy-cleanup-runner.js +45 -9
- package/dist/single-copy-cleanup.js +15 -7
- package/dist/sqlite-restore.js +48 -9
- package/dist/starter.js +39 -4
- package/dist/ui-serving/lazy-ui-serving.js +39 -3
- package/package.json +7 -7
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChildManifestGate = exports.CHILD_MANIFEST_SKIP_SAMPLE = exports.MoleculerService = void 0;
|
|
4
|
+
exports.childOwnerToken = childOwnerToken;
|
|
5
|
+
exports.buildChildUdsManifest = buildChildUdsManifest;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
const system_1 = require("@camstack/system");
|
|
8
|
+
const types_1 = require("@camstack/types");
|
|
9
|
+
const cap_router_runtime_js_1 = require("../../api/trpc/cap-router-runtime.js");
|
|
10
|
+
const core_cap_bridge_js_1 = require("../../api/trpc/core-cap-bridge.js");
|
|
11
|
+
const agent_readiness_pull_js_1 = require("./agent-readiness-pull.js");
|
|
12
|
+
const agent_registration_request_js_1 = require("./agent-registration-request.js");
|
|
13
|
+
const hub_mesh_guard_js_1 = require("./hub-mesh-guard.js");
|
|
14
|
+
const cap_call_fn_js_1 = require("./cap-call-fn.js");
|
|
15
|
+
const cap_route_authority_js_1 = require("./cap-route-authority.js");
|
|
16
|
+
class MoleculerService {
|
|
12
17
|
eventBus;
|
|
13
18
|
config;
|
|
14
19
|
logging;
|
|
@@ -26,7 +31,7 @@ export class MoleculerService {
|
|
|
26
31
|
* D3 authority: union of every node's manifest delivered via
|
|
27
32
|
* `$hub.registerNode`. Populated by `onRegisterNode` in `hubDeps`.
|
|
28
33
|
*/
|
|
29
|
-
nodeRegistry = new HubNodeRegistry();
|
|
34
|
+
nodeRegistry = new system_1.HubNodeRegistry();
|
|
30
35
|
/**
|
|
31
36
|
* nodeId → the owner token of the INCARNATION whose manifest currently backs
|
|
32
37
|
* that node's capability registrations.
|
|
@@ -184,8 +189,8 @@ export class MoleculerService {
|
|
|
184
189
|
// `no-unsafe-assignment`. Going via `unknown` documents the boundary.
|
|
185
190
|
// No shared secret (D857): the Moleculer namespace was never authentication (TCP
|
|
186
191
|
// ignores it); a node is admitted by the certificate it presented at the TLS handshake.
|
|
187
|
-
this.meshGuard = new HubMeshGuard('hub', this.logging.createLogger('mesh-auth'));
|
|
188
|
-
const broker = createBroker({
|
|
192
|
+
this.meshGuard = new hub_mesh_guard_js_1.HubMeshGuard('hub', this.logging.createLogger('mesh-auth'));
|
|
193
|
+
const broker = (0, system_1.createBroker)({
|
|
189
194
|
nodeID: 'hub',
|
|
190
195
|
mode: 'hub',
|
|
191
196
|
// D802, D857: every action and event another node sends passes the certificate gate.
|
|
@@ -197,7 +202,7 @@ export class MoleculerService {
|
|
|
197
202
|
// (eventemitter2 chain unresolvable). Documented + single-site cast.
|
|
198
203
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
199
204
|
this.broker = broker;
|
|
200
|
-
this.readinessRegistry = new ReadinessRegistry({
|
|
205
|
+
this.readinessRegistry = new types_1.ReadinessRegistry({
|
|
201
206
|
eventBus: this.eventBus,
|
|
202
207
|
sourceNodeId: this.broker.nodeID,
|
|
203
208
|
logger: this.logging.createLogger('readiness'),
|
|
@@ -268,7 +273,7 @@ export class MoleculerService {
|
|
|
268
273
|
// D857: a node registers only itself, and only with a certificate identity.
|
|
269
274
|
meshIdentity: this.meshGuard.gate,
|
|
270
275
|
};
|
|
271
|
-
const hubService = createHubService(hubDeps);
|
|
276
|
+
const hubService = (0, system_1.createHubService)(hubDeps);
|
|
272
277
|
this.broker.createService(hubService);
|
|
273
278
|
// Forked addon-runner children must root their storage (addons-data,
|
|
274
279
|
// the sqlite settings DB) under the SAME data path as the hub's main
|
|
@@ -296,7 +301,7 @@ export class MoleculerService {
|
|
|
296
301
|
// capabilities the resolver can see. Before F0 this fell through
|
|
297
302
|
// UDS_NO_ROUTE → the child's own brokerTransportLink; F1+F2 removes that
|
|
298
303
|
// child broker, so the parent must own this path.
|
|
299
|
-
const onUnownedCall = createParentUnownedCallHandler({
|
|
304
|
+
const onUnownedCall = (0, system_1.createParentUnownedCallHandler)({
|
|
300
305
|
getResolver: () => this.resolver,
|
|
301
306
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- moleculer types unresolvable; see `broker` getter docstring
|
|
302
307
|
broker: this.broker,
|
|
@@ -354,7 +359,7 @@ export class MoleculerService {
|
|
|
354
359
|
return null;
|
|
355
360
|
if (reg.getDefinition(capName)?.mode !== 'collection')
|
|
356
361
|
return null;
|
|
357
|
-
if (!COLLECTION_ARRAY_METHODS.get(capName)?.includes(method))
|
|
362
|
+
if (!cap_router_runtime_js_1.COLLECTION_ARRAY_METHODS.get(capName)?.includes(method))
|
|
358
363
|
return null;
|
|
359
364
|
if (reg.getCollectionEntries(capName).length > 0)
|
|
360
365
|
return null;
|
|
@@ -368,7 +373,7 @@ export class MoleculerService {
|
|
|
368
373
|
// never disagree again). Routing alone picks ONE provider, which is
|
|
369
374
|
// how the Notification Center saw an empty `notification-output`
|
|
370
375
|
// catalog and dead-lettered every notification (2026-07-30).
|
|
371
|
-
callCollectionAggregate: (capName, method, args) => aggregateCollectionCall(this.capabilityService.getRegistry(), capName, method, args),
|
|
376
|
+
callCollectionAggregate: (capName, method, args) => (0, cap_router_runtime_js_1.aggregateCollectionCall)(this.capabilityService.getRegistry(), capName, method, args),
|
|
372
377
|
// `{ addonId }` PIN for the same child→parent path — the scalar twin of
|
|
373
378
|
// the fan-out above, sharing this server's provider resolution so the
|
|
374
379
|
// two paths cannot disagree. Routing takes only `nodeId`/`deviceId`, so
|
|
@@ -383,7 +388,7 @@ export class MoleculerService {
|
|
|
383
388
|
// addon's clip byte read named `provider-reolink` and was answered by
|
|
384
389
|
// whichever child registered first — the recorder, then export-hap
|
|
385
390
|
// after a redeploy in a different order (2026-09-22, D594).
|
|
386
|
-
callPinnedCollection: async (capName, method, args) => (await pinnedDeviceCollectionCall(this.capabilityService.getRegistry(), capName, method, args)) ?? pinnedCollectionCall(this.capabilityService.getRegistry(), capName, method, args),
|
|
391
|
+
callPinnedCollection: async (capName, method, args) => (await (0, cap_router_runtime_js_1.pinnedDeviceCollectionCall)(this.capabilityService.getRegistry(), capName, method, args)) ?? (0, cap_router_runtime_js_1.pinnedCollectionCall)(this.capabilityService.getRegistry(), capName, method, args),
|
|
387
392
|
// Hub-core `$`-service discriminant for the general
|
|
388
393
|
// provider-not-yet-registered recovery. A resolver miss on a NON-core
|
|
389
394
|
// cap (any addon-provided system/singleton cap, e.g.
|
|
@@ -393,7 +398,7 @@ export class MoleculerService {
|
|
|
393
398
|
// predicate lets it retry the resolver + throw a precise error instead.
|
|
394
399
|
// Derived from the already-maintained core-router list, so a new
|
|
395
400
|
// multi-node addon cap is covered with no change here.
|
|
396
|
-
isCoreServiceCap: (capName) => isCoreServiceCapName(capName),
|
|
401
|
+
isCoreServiceCap: (capName) => (0, core_cap_bridge_js_1.isCoreServiceCapName)(capName),
|
|
397
402
|
logger: {
|
|
398
403
|
debug: (msg, meta) => logger.debug(msg, meta !== null && meta !== undefined
|
|
399
404
|
? { meta: meta }
|
|
@@ -411,7 +416,7 @@ export class MoleculerService {
|
|
|
411
416
|
// `broker.call('$hub-cap-fwd.forward', …)` discovers it here. Without it a
|
|
412
417
|
// remote agent's raw `${cap}.*` discovery 30s-deadlines (hub-local addon
|
|
413
418
|
// runners expose no Moleculer service). See hub-cap-forward.ts.
|
|
414
|
-
this.broker.createService(createHubCapForwardService(onUnownedCall, {
|
|
419
|
+
this.broker.createService((0, system_1.createHubCapForwardService)(onUnownedCall, {
|
|
415
420
|
// The agent stamps WHO is calling (its child's runner id) into the
|
|
416
421
|
// envelope (D787). Believe it only when that runner is on the agent
|
|
417
422
|
// the request came from — a node's registered manifest lists the
|
|
@@ -421,8 +426,8 @@ export class MoleculerService {
|
|
|
421
426
|
meta: { senderNodeId, callerRunnerId },
|
|
422
427
|
}),
|
|
423
428
|
}));
|
|
424
|
-
const registry = new LocalChildRegistry({
|
|
425
|
-
server: createLocalTransport().createServer(nodeId),
|
|
429
|
+
const registry = new system_1.LocalChildRegistry({
|
|
430
|
+
server: (0, system_1.createLocalTransport)().createServer(nodeId),
|
|
426
431
|
// This node's own id — lets the cap-call-out router serve a pin-to-self
|
|
427
432
|
// from the co-resident sibling instead of bouncing it through
|
|
428
433
|
// onUnownedCall (a pin to ANOTHER node still bypasses the sibling).
|
|
@@ -448,7 +453,7 @@ export class MoleculerService {
|
|
|
448
453
|
return false;
|
|
449
454
|
if (reg.getDefinition(capName)?.mode !== 'collection')
|
|
450
455
|
return false;
|
|
451
|
-
return COLLECTION_ARRAY_METHODS.get(capName)?.includes(method) === true;
|
|
456
|
+
return cap_router_runtime_js_1.COLLECTION_ARRAY_METHODS.get(capName)?.includes(method) === true;
|
|
452
457
|
},
|
|
453
458
|
// Same story for an explicit `{ addonId }` selector: the sibling
|
|
454
459
|
// short-circuit picks the FIRST-registered child, which is precisely
|
|
@@ -464,8 +469,8 @@ export class MoleculerService {
|
|
|
464
469
|
// routing that would honour it — "honoured only there is honoured
|
|
465
470
|
// never", which is how the first attempt at the `addonId` fix failed
|
|
466
471
|
// live, and how the `provider` pin failed twice more (D592, D593).
|
|
467
|
-
isAddonPinnedCall: (capName, method, args) => addonPinOf(this.capabilityService.getRegistry(), capName, method, args) !== null ||
|
|
468
|
-
devicePinOf(this.capabilityService.getRegistry(), capName, args) !== null,
|
|
472
|
+
isAddonPinnedCall: (capName, method, args) => (0, cap_router_runtime_js_1.addonPinOf)(this.capabilityService.getRegistry(), capName, method, args) !== null ||
|
|
473
|
+
(0, cap_router_runtime_js_1.devicePinOf)(this.capabilityService.getRegistry(), capName, args) !== null,
|
|
469
474
|
// Bound every UDS cap call by the cap's own declared timeout, falling
|
|
470
475
|
// back to the channel default. Same resolver the REMOTE plane uses
|
|
471
476
|
// below, so a method that survives 16 minutes across nodes survives it
|
|
@@ -479,7 +484,7 @@ export class MoleculerService {
|
|
|
479
484
|
// RUNNER's own module singleton, which hub-main never sees — which is
|
|
480
485
|
// why the graph answered `[]` on a hub running 64 addons. Blind spots
|
|
481
486
|
// that remain are listed on `LocalChildRegistryOptions.capUsageObserver`.
|
|
482
|
-
capUsageObserver: (obs) => getCapUsageRegistry().recordCall(obs),
|
|
487
|
+
capUsageObserver: (obs) => (0, system_1.getCapUsageRegistry)().recordCall(obs),
|
|
483
488
|
logger: {
|
|
484
489
|
info: (msg, meta) => logger.info(msg, meta !== null && meta !== undefined
|
|
485
490
|
? { meta: meta }
|
|
@@ -520,7 +525,7 @@ export class MoleculerService {
|
|
|
520
525
|
}
|
|
521
526
|
catch (err) {
|
|
522
527
|
logger.warn('UDS child custom-action catalogs could not be applied', {
|
|
523
|
-
meta: { nodeId: childNodeId, incarnation: child.incarnation, error: errMsg(err) },
|
|
528
|
+
meta: { nodeId: childNodeId, incarnation: child.incarnation, error: (0, types_1.errMsg)(err) },
|
|
524
529
|
});
|
|
525
530
|
}
|
|
526
531
|
}
|
|
@@ -543,7 +548,7 @@ export class MoleculerService {
|
|
|
543
548
|
nodeId: childNodeId,
|
|
544
549
|
incarnation: child.incarnation,
|
|
545
550
|
skipped: this.childManifestGate.skippedSince(),
|
|
546
|
-
sampleEvery: CHILD_MANIFEST_SKIP_SAMPLE,
|
|
551
|
+
sampleEvery: exports.CHILD_MANIFEST_SKIP_SAMPLE,
|
|
547
552
|
},
|
|
548
553
|
});
|
|
549
554
|
}
|
|
@@ -577,7 +582,7 @@ export class MoleculerService {
|
|
|
577
582
|
// This runs in PARALLEL with the existing $hub.log / onLog broker path —
|
|
578
583
|
// both stay active until Phase F removes the broker path.
|
|
579
584
|
registry.onChildLog((childId, entry) => {
|
|
580
|
-
this.logging.writeFromWorker(udsChildLogToWorkerEntry(childId, entry));
|
|
585
|
+
this.logging.writeFromWorker((0, system_1.udsChildLogToWorkerEntry)(childId, entry));
|
|
581
586
|
});
|
|
582
587
|
// D1: answer readiness-snapshot requests from UDS children so they can
|
|
583
588
|
// hydrate without a `$readiness.getSnapshot` Moleculer call.
|
|
@@ -588,7 +593,7 @@ export class MoleculerService {
|
|
|
588
593
|
// Keep `$readiness.getSnapshot` intact — Phase F removes it.
|
|
589
594
|
registry.onReadinessSnapshotRequest(() => this.readinessRegistry.getSnapshotForTransport());
|
|
590
595
|
this.localChildRegistry = registry;
|
|
591
|
-
parentUdsPath = localEndpointPath(nodeId);
|
|
596
|
+
parentUdsPath = (0, system_1.localEndpointPath)(nodeId);
|
|
592
597
|
logger.info('UDS child registry listening', { meta: { path: parentUdsPath } });
|
|
593
598
|
}
|
|
594
599
|
catch (err) {
|
|
@@ -596,7 +601,7 @@ export class MoleculerService {
|
|
|
596
601
|
meta: { err: err instanceof Error ? err.message : String(err) },
|
|
597
602
|
});
|
|
598
603
|
}
|
|
599
|
-
const processService = createProcessService(this.broker.nodeID, dataDir, undefined, undefined, parentUdsPath);
|
|
604
|
+
const processService = (0, system_1.createProcessService)(this.broker.nodeID, dataDir, undefined, undefined, parentUdsPath);
|
|
600
605
|
this.broker.createService(processService);
|
|
601
606
|
// $addonHost — REMOVED (Sprint 6). Three-level settings are now
|
|
602
607
|
// served by the `addon-settings` singleton capability. Per-addon
|
|
@@ -611,7 +616,7 @@ export class MoleculerService {
|
|
|
611
616
|
this.removeNodeFromRegistry(node.id);
|
|
612
617
|
this.meshGuard.forget(node.id);
|
|
613
618
|
// Release A: its next connection decides again whether it is `tls` or `clear`.
|
|
614
|
-
getBrokerTlsTransporter(this.broker)?.forgetPeer(node.id);
|
|
619
|
+
(0, system_1.getBrokerTlsTransporter)(this.broker)?.forgetPeer(node.id);
|
|
615
620
|
});
|
|
616
621
|
// D8 reverse-leg snapshot-reconcile: on every agent (re)connect, pull
|
|
617
622
|
// the agent's own readiness snapshot (`$agent-readiness.getSnapshot`)
|
|
@@ -629,7 +634,7 @@ export class MoleculerService {
|
|
|
629
634
|
// The hub may have dropped this agent's registration on a disconnect
|
|
630
635
|
// only the hub saw (gossip, a failed write): ask it for its full set
|
|
631
636
|
// (`agent-registration-request.ts`, 2026-10-14).
|
|
632
|
-
void requestAgentRegistration({
|
|
637
|
+
void (0, agent_registration_request_js_1.requestAgentRegistration)({
|
|
633
638
|
call: (action, params, opts) => this.broker.call(action, params, opts),
|
|
634
639
|
isRegistered: (id) => this.isNodeRegistered(id),
|
|
635
640
|
warn: (message, id, meta) => this.logger.warn(message, { tags: { nodeId: id }, meta }),
|
|
@@ -651,26 +656,26 @@ export class MoleculerService {
|
|
|
651
656
|
// handshake, not dynamically after post-start `createService()`.
|
|
652
657
|
// Without this, cross-node broadcasts (camstack.evt.<category>) would
|
|
653
658
|
// arrive unreliably for the first ~10s after each node joins.
|
|
654
|
-
registerEventBusService(this.broker);
|
|
659
|
+
(0, system_1.registerEventBusService)(this.broker);
|
|
655
660
|
// Register the hub-authoritative `$readiness.getSnapshot` service
|
|
656
661
|
// BEFORE broker.start() so workers / agents see it in their initial
|
|
657
662
|
// INFO packet — post-start `createService` calls propagate via
|
|
658
663
|
// heartbeat (several seconds) and would force workers to poll.
|
|
659
|
-
this.broker.createService(createReadinessServiceForRegistry(this.readinessRegistry));
|
|
664
|
+
this.broker.createService((0, system_1.createReadinessServiceForRegistry)(this.readinessRegistry));
|
|
660
665
|
// Register the hub-authoritative `$stream-probe` service —
|
|
661
666
|
// workers route RTSP probe + field-probe through this action when
|
|
662
667
|
// the tRPC WSS link isn't available (default path for forked
|
|
663
668
|
// workers). Keeps ffprobe + HTTP-reachability as a single
|
|
664
669
|
// hub-side implementation; see `createStreamProbeBrokerService`
|
|
665
670
|
// for the shape.
|
|
666
|
-
this.broker.createService(createStreamProbeBrokerService({
|
|
671
|
+
this.broker.createService((0, system_1.createStreamProbeBrokerService)({
|
|
667
672
|
probe: (url, options) => this.streamProbe.probe(url, options),
|
|
668
673
|
probeField: (key, value) => this.streamProbe.probeField(key, value),
|
|
669
674
|
}));
|
|
670
675
|
// D826: when system-config's MeshCaKeeper becomes ready it offers hub leaf
|
|
671
676
|
// material here; the transporter listens on mutual TLS only (:6443).
|
|
672
|
-
setProcessMeshTlsEnabler(async (material) => {
|
|
673
|
-
const tx = getBrokerTlsTransporter(this.broker);
|
|
677
|
+
(0, system_1.setProcessMeshTlsEnabler)(async (material) => {
|
|
678
|
+
const tx = (0, system_1.getBrokerTlsTransporter)(this.broker);
|
|
674
679
|
if (tx === null) {
|
|
675
680
|
logger.warn('Mesh TLS material ready but broker transporter is not TlsTcpTransporter');
|
|
676
681
|
return;
|
|
@@ -678,11 +683,11 @@ export class MoleculerService {
|
|
|
678
683
|
await tx.enableMeshTls(material);
|
|
679
684
|
logger.info('Mesh mTLS listener enabled (TLS-only hub mesh)');
|
|
680
685
|
});
|
|
681
|
-
setProcessMeshPeerTransportLookup({
|
|
682
|
-
transportOf: (nodeId) => getBrokerTlsTransporter(this.broker)?.peerTransport(nodeId),
|
|
683
|
-
isVerifiedPeer: (nodeId) => getBrokerTlsTransporter(this.broker)?.verifiedPeer(nodeId) !== undefined,
|
|
684
|
-
peerLeaf: (nodeId) => getBrokerTlsTransporter(this.broker)?.peerLeaf(nodeId),
|
|
685
|
-
dropPeer: (nodeId) => getBrokerTlsTransporter(this.broker)?.dropPeer(nodeId) ?? 0,
|
|
686
|
+
(0, system_1.setProcessMeshPeerTransportLookup)({
|
|
687
|
+
transportOf: (nodeId) => (0, system_1.getBrokerTlsTransporter)(this.broker)?.peerTransport(nodeId),
|
|
688
|
+
isVerifiedPeer: (nodeId) => (0, system_1.getBrokerTlsTransporter)(this.broker)?.verifiedPeer(nodeId) !== undefined,
|
|
689
|
+
peerLeaf: (nodeId) => (0, system_1.getBrokerTlsTransporter)(this.broker)?.peerLeaf(nodeId),
|
|
690
|
+
dropPeer: (nodeId) => (0, system_1.getBrokerTlsTransporter)(this.broker)?.dropPeer(nodeId) ?? 0,
|
|
686
691
|
});
|
|
687
692
|
await this.broker.start();
|
|
688
693
|
logger.info('Moleculer broker started (TCP transport)');
|
|
@@ -692,21 +697,21 @@ export class MoleculerService {
|
|
|
692
697
|
// children connecting/disconnecting after this point are picked up
|
|
693
698
|
// correctly. The localChildRegistry reference is captured and may be
|
|
694
699
|
// null if UDS failed to start.
|
|
695
|
-
this.resolver = new CapRouteResolver({
|
|
700
|
+
this.resolver = new system_1.CapRouteResolver({
|
|
696
701
|
hubNodeId: this.broker.nodeID,
|
|
697
702
|
broker: this.broker,
|
|
698
703
|
hubLocalRegistry: this.localChildRegistry,
|
|
699
|
-
nodeAuthority: createNodeCapAuthority(this.nodeRegistry, {
|
|
704
|
+
nodeAuthority: (0, cap_route_authority_js_1.createNodeCapAuthority)(this.nodeRegistry, {
|
|
700
705
|
resolveSingleton: (capName, nodeId) => this.capabilityService.getRegistry()?.resolveSingletonAddonIdForNode(capName, nodeId) ??
|
|
701
706
|
null,
|
|
702
707
|
}),
|
|
703
|
-
inProcessProviders: createInProcessProviderLookup(this.capabilityService),
|
|
708
|
+
inProcessProviders: (0, cap_route_authority_js_1.createInProcessProviderLookup)(this.capabilityService),
|
|
704
709
|
// Node-accurate lookup for EXPLICITLY hub-pinned calls: unlike the
|
|
705
710
|
// lookup above (which falls back to the cluster-elected ACTIVE
|
|
706
711
|
// singleton — possibly a remote proxy), this resolves only providers
|
|
707
712
|
// physically resident on the hub, so a `nodePin('hub')` fails precisely
|
|
708
713
|
// instead of silently executing on another node.
|
|
709
|
-
hubResidentProviders: createHubResidentProviderLookup(this.capabilityService),
|
|
714
|
+
hubResidentProviders: (0, cap_route_authority_js_1.createHubResidentProviderLookup)(this.capabilityService),
|
|
710
715
|
// Per-cap-method RPC timeout override (e.g. model-convert.convert, which
|
|
711
716
|
// runs for minutes) — read from the cap definition's declared timeoutMs.
|
|
712
717
|
capTimeoutMs: (capName, method) => this.capabilityService.getRegistry()?.getDefinition(capName)?.methods?.[method]?.timeoutMs,
|
|
@@ -728,14 +733,14 @@ export class MoleculerService {
|
|
|
728
733
|
// shared broker bus and broker.broadcast is live.
|
|
729
734
|
if (this.localChildRegistry !== null) {
|
|
730
735
|
const hubNodeId = this.broker.nodeID;
|
|
731
|
-
this.udsEventBridgeDispose = createUdsEventBridge({
|
|
736
|
+
this.udsEventBridgeDispose = (0, system_1.createUdsEventBridge)({
|
|
732
737
|
registry: this.localChildRegistry,
|
|
733
738
|
parentBus: this.eventBus,
|
|
734
739
|
parentNodeId: hubNodeId,
|
|
735
740
|
// D2: relay via pass-through so the bridge's wildcard is not counted as
|
|
736
741
|
// local interest (uniform with the agent; harmless here since the hub
|
|
737
742
|
// retains and always accepts inbound cross-node events anyway).
|
|
738
|
-
subscribePassthrough: (handler) => subscribePassthrough(this.broker, handler),
|
|
743
|
+
subscribePassthrough: (handler) => (0, system_1.subscribePassthrough)(this.broker, handler),
|
|
739
744
|
});
|
|
740
745
|
// D2: expose the hub's aggregate child interest to its `$event-bus`
|
|
741
746
|
// inbound gate for uniformity with the agent. NOTE: the hub main process
|
|
@@ -745,7 +750,7 @@ export class MoleculerService {
|
|
|
745
750
|
// wiring is therefore harmless-but-uniform; the real efficiency win is on
|
|
746
751
|
// agents (non-retaining nodes).
|
|
747
752
|
const hubChildRegistry = this.localChildRegistry;
|
|
748
|
-
setNodeEventInterest(this.broker, () => hubChildRegistry.aggregateEventInterest());
|
|
753
|
+
(0, system_1.setNodeEventInterest)(this.broker, () => hubChildRegistry.aggregateEventInterest());
|
|
749
754
|
}
|
|
750
755
|
}
|
|
751
756
|
/**
|
|
@@ -797,7 +802,7 @@ export class MoleculerService {
|
|
|
797
802
|
const registry = this.capabilityService.getRegistry();
|
|
798
803
|
return registry !== null
|
|
799
804
|
? registry.resolveClaimedStatus(capName, deviceId)
|
|
800
|
-
: Promise.resolve(UNCLAIMED);
|
|
805
|
+
: Promise.resolve(system_1.UNCLAIMED);
|
|
801
806
|
}
|
|
802
807
|
/**
|
|
803
808
|
* Call a capability method on a specific node.
|
|
@@ -822,7 +827,7 @@ export class MoleculerService {
|
|
|
822
827
|
// a `nodeId` pin — the generated DeviceProxy always sends one — and every
|
|
823
828
|
// hub in-process addon's `ctx.api` through `deviceCapResolverLink`); a pin
|
|
824
829
|
// does not bypass the claim authority. Same shared function as the other two.
|
|
825
|
-
const claimed = await answerClaimedGetStatus((capName, deviceId) => this.resolveClaimedStatus(capName, deviceId), { capName: capabilityName, method: methodName, args: params });
|
|
830
|
+
const claimed = await (0, system_1.answerClaimedGetStatus)((capName, deviceId) => this.resolveClaimedStatus(capName, deviceId), { capName: capabilityName, method: methodName, args: params });
|
|
826
831
|
if (claimed !== null)
|
|
827
832
|
return claimed.slice;
|
|
828
833
|
const resolver = this.resolver;
|
|
@@ -837,7 +842,7 @@ export class MoleculerService {
|
|
|
837
842
|
return await resolver.dispatch(route, methodName, params);
|
|
838
843
|
}
|
|
839
844
|
catch (err) {
|
|
840
|
-
if (err instanceof CapRouteError &&
|
|
845
|
+
if (err instanceof system_1.CapRouteError &&
|
|
841
846
|
(err.reason === 'no-provider' || err.reason === 'node-offline')) {
|
|
842
847
|
// Resolver couldn't find the cap — try the legacy callFn store as a
|
|
843
848
|
// fallback. This covers caps registered in nodeCallFns (e.g. agent
|
|
@@ -872,7 +877,7 @@ export class MoleculerService {
|
|
|
872
877
|
if (callFn) {
|
|
873
878
|
return callFn(methodName, params);
|
|
874
879
|
}
|
|
875
|
-
throw new CapRouteError(capabilityName, methodName, {
|
|
880
|
+
throw new system_1.CapRouteError(capabilityName, methodName, {
|
|
876
881
|
reason: 'no-provider',
|
|
877
882
|
nodeId,
|
|
878
883
|
rejected: [
|
|
@@ -903,7 +908,7 @@ export class MoleculerService {
|
|
|
903
908
|
this.observePresentedMeshLeaf(params.nodeId);
|
|
904
909
|
// The node's capabilities are routable now: whoever waits for this registration (a mesh
|
|
905
910
|
// leaf renewal confirming the node came back WITH the new leaf) is told, with no polling.
|
|
906
|
-
emitProcessNodeRegistered(params.nodeId, params.addons.map((addon) => addon.addonId));
|
|
911
|
+
(0, system_1.emitProcessNodeRegistered)(params.nodeId, params.addons.map((addon) => addon.addonId));
|
|
907
912
|
// Notify AgentRegistryService to reconcile placement for bare-ID
|
|
908
913
|
// agent nodes (no '/' = not a hub child worker, not the hub itself).
|
|
909
914
|
// The handshake is the authoritative completeness signal — the full
|
|
@@ -966,7 +971,7 @@ export class MoleculerService {
|
|
|
966
971
|
// isolate (D231) IS this node's engine, and skipping it leaves
|
|
967
972
|
// `getCollection` empty. Hub-local children are proxied; remote nodes
|
|
968
973
|
// are not (D233).
|
|
969
|
-
const skipInfraFromRemote = (capName) => isInfraCapability(capName) && !isLocalChild;
|
|
974
|
+
const skipInfraFromRemote = (capName) => (0, system_1.isInfraCapability)(capName) && !isLocalChild;
|
|
970
975
|
const appliedKeys = (manifest) => {
|
|
971
976
|
const keys = new Map();
|
|
972
977
|
for (const addon of manifest) {
|
|
@@ -1032,14 +1037,14 @@ export class MoleculerService {
|
|
|
1032
1037
|
// UDS-migration gap where this dispatcher hand-rolled a `broker.call`
|
|
1033
1038
|
// to an agent that exposes no Moleculer service for the cap.
|
|
1034
1039
|
// - resolver not yet built (pre-init) → legacy Moleculer call.
|
|
1035
|
-
const callFn = buildCapCallFn({
|
|
1040
|
+
const callFn = (0, cap_call_fn_js_1.buildCapCallFn)({
|
|
1036
1041
|
capName,
|
|
1037
1042
|
addonId,
|
|
1038
1043
|
nodeId,
|
|
1039
1044
|
udsChildId,
|
|
1040
1045
|
getLocalChildRegistry: () => this.localChildRegistry,
|
|
1041
1046
|
getResolver: () => this.resolver,
|
|
1042
|
-
legacyBrokerCall: (method, methodParams, targetNode) => callWithServiceDiscovery(this.broker, addonId, capActionName(addonId, capName, method, false), serializeTypedArrays(methodParams), { nodeID: targetNode, timeout: 60_000 }),
|
|
1047
|
+
legacyBrokerCall: (method, methodParams, targetNode) => (0, system_1.callWithServiceDiscovery)(this.broker, addonId, (0, system_1.capActionName)(addonId, capName, method, false), (0, system_1.serializeTypedArrays)(methodParams), { nodeID: targetNode, timeout: 60_000 }),
|
|
1043
1048
|
onUdsRoute: (cap) => {
|
|
1044
1049
|
if (!this.udsRoutedCaps.has(cap)) {
|
|
1045
1050
|
this.udsRoutedCaps.add(cap);
|
|
@@ -1048,7 +1053,7 @@ export class MoleculerService {
|
|
|
1048
1053
|
},
|
|
1049
1054
|
});
|
|
1050
1055
|
const proxy = { id: addonId, nodeId };
|
|
1051
|
-
for (const methodName of Object.keys(expandCapMethods(capDef))) {
|
|
1056
|
+
for (const methodName of Object.keys((0, system_1.expandCapMethods)(capDef))) {
|
|
1052
1057
|
proxy[methodName] = (methodParams) => callFn(methodName, methodParams);
|
|
1053
1058
|
}
|
|
1054
1059
|
registry.registerProvider(capName, registryKey, proxy, owner);
|
|
@@ -1072,19 +1077,19 @@ export class MoleculerService {
|
|
|
1072
1077
|
// refreshes its page/widget registry for cross-process addons.
|
|
1073
1078
|
if (capName === 'addon-pages-source') {
|
|
1074
1079
|
this.eventBus.emit({
|
|
1075
|
-
id: randomUUID(),
|
|
1080
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
1076
1081
|
timestamp: new Date(),
|
|
1077
1082
|
source: { type: 'addon', id: addonId },
|
|
1078
|
-
category: EventCategory.AddonPageReady,
|
|
1083
|
+
category: types_1.EventCategory.AddonPageReady,
|
|
1079
1084
|
data: { addonId, nodeId },
|
|
1080
1085
|
});
|
|
1081
1086
|
}
|
|
1082
1087
|
if (capName === 'addon-widgets-source') {
|
|
1083
1088
|
this.eventBus.emit({
|
|
1084
|
-
id: randomUUID(),
|
|
1089
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
1085
1090
|
timestamp: new Date(),
|
|
1086
1091
|
source: { type: 'addon', id: addonId },
|
|
1087
|
-
category: EventCategory.AddonWidgetReady,
|
|
1092
|
+
category: types_1.EventCategory.AddonWidgetReady,
|
|
1088
1093
|
data: { addonId, nodeId },
|
|
1089
1094
|
});
|
|
1090
1095
|
}
|
|
@@ -1114,7 +1119,7 @@ export class MoleculerService {
|
|
|
1114
1119
|
return; // node never sent a handshake — nothing to do
|
|
1115
1120
|
const hubNodeId = this.broker.nodeID;
|
|
1116
1121
|
const isLocalChild = nodeId.startsWith(hubNodeId + '/');
|
|
1117
|
-
const disconnectGen = `disconnect-${nodeId}-${randomUUID()}`;
|
|
1122
|
+
const disconnectGen = `disconnect-${nodeId}-${(0, node_crypto_1.randomUUID)()}`;
|
|
1118
1123
|
const agentNodeId = nodeId.includes('/') ? nodeId.split('/')[0] : nodeId;
|
|
1119
1124
|
const registry = this.capabilityService.getRegistry();
|
|
1120
1125
|
for (const addon of manifest) {
|
|
@@ -1128,7 +1133,7 @@ export class MoleculerService {
|
|
|
1128
1133
|
for (const capName of capabilities) {
|
|
1129
1134
|
this.nodeCallFns.delete(`${nodeId}::${capName}`);
|
|
1130
1135
|
try {
|
|
1131
|
-
emitReadiness(this.eventBus, {
|
|
1136
|
+
(0, types_1.emitReadiness)(this.eventBus, {
|
|
1132
1137
|
capName,
|
|
1133
1138
|
scope: { type: 'node', nodeId: agentNodeId },
|
|
1134
1139
|
state: 'down',
|
|
@@ -1214,7 +1219,7 @@ export class MoleculerService {
|
|
|
1214
1219
|
// Resolver found a route — proxy is reachable.
|
|
1215
1220
|
}
|
|
1216
1221
|
catch (err) {
|
|
1217
|
-
if (err instanceof CapRouteError &&
|
|
1222
|
+
if (err instanceof system_1.CapRouteError &&
|
|
1218
1223
|
(err.reason === 'no-provider' || err.reason === 'node-offline')) {
|
|
1219
1224
|
// Check legacy callFn store and hub-local child fallbacks.
|
|
1220
1225
|
if (!this.isReachableViaLegacy(nodeId, capabilityName))
|
|
@@ -1276,8 +1281,8 @@ export class MoleculerService {
|
|
|
1276
1281
|
* registry that is not up, or a write that fails, must not fail the node's registration.
|
|
1277
1282
|
*/
|
|
1278
1283
|
observePresentedMeshLeaf(nodeId) {
|
|
1279
|
-
const registry = getProcessMeshCertificateRegistry();
|
|
1280
|
-
const leaf = getProcessPeerLeaf(nodeId);
|
|
1284
|
+
const registry = (0, system_1.getProcessMeshCertificateRegistry)();
|
|
1285
|
+
const leaf = (0, system_1.getProcessPeerLeaf)(nodeId);
|
|
1281
1286
|
if (registry === null || leaf === undefined)
|
|
1282
1287
|
return;
|
|
1283
1288
|
registry
|
|
@@ -1339,10 +1344,10 @@ export class MoleculerService {
|
|
|
1339
1344
|
*/
|
|
1340
1345
|
async pullAgentReadinessSnapshot(nodeId) {
|
|
1341
1346
|
try {
|
|
1342
|
-
const snapshot = await this.broker.call(`${AGENT_READINESS_SERVICE_NAME}.getSnapshot`, {}, { nodeID: nodeId });
|
|
1347
|
+
const snapshot = await this.broker.call(`${system_1.AGENT_READINESS_SERVICE_NAME}.getSnapshot`, {}, { nodeID: nodeId });
|
|
1343
1348
|
if (!Array.isArray(snapshot) || snapshot.length === 0)
|
|
1344
1349
|
return;
|
|
1345
|
-
const records = filterAgentAuthoritativeRecords(snapshot, nodeId);
|
|
1350
|
+
const records = (0, agent_readiness_pull_js_1.filterAgentAuthoritativeRecords)(snapshot, nodeId);
|
|
1346
1351
|
if (records.length === 0)
|
|
1347
1352
|
return;
|
|
1348
1353
|
this.readinessRegistry.hydrate(records);
|
|
@@ -1358,8 +1363,8 @@ export class MoleculerService {
|
|
|
1358
1363
|
}
|
|
1359
1364
|
}
|
|
1360
1365
|
async onModuleDestroy() {
|
|
1361
|
-
setProcessMeshTlsEnabler(null);
|
|
1362
|
-
setProcessMeshPeerTransportLookup(null);
|
|
1366
|
+
(0, system_1.setProcessMeshTlsEnabler)(null);
|
|
1367
|
+
(0, system_1.setProcessMeshPeerTransportLookup)(null);
|
|
1363
1368
|
if (this.agentReadinessPullTimer !== null) {
|
|
1364
1369
|
clearInterval(this.agentReadinessPullTimer);
|
|
1365
1370
|
this.agentReadinessPullTimer = null;
|
|
@@ -1370,6 +1375,7 @@ export class MoleculerService {
|
|
|
1370
1375
|
await this.localChildRegistry?.close();
|
|
1371
1376
|
}
|
|
1372
1377
|
}
|
|
1378
|
+
exports.MoleculerService = MoleculerService;
|
|
1373
1379
|
// ---------------------------------------------------------------------------
|
|
1374
1380
|
// Module-level helpers
|
|
1375
1381
|
// ---------------------------------------------------------------------------
|
|
@@ -1382,7 +1388,7 @@ export class MoleculerService {
|
|
|
1382
1388
|
* regression suite: the rule is only worth anything if register and unregister
|
|
1383
1389
|
* derive the token the SAME way.
|
|
1384
1390
|
*/
|
|
1385
|
-
|
|
1391
|
+
function childOwnerToken(childNodeId, incarnation) {
|
|
1386
1392
|
return `${childNodeId}#${incarnation}`;
|
|
1387
1393
|
}
|
|
1388
1394
|
/**
|
|
@@ -1392,7 +1398,7 @@ export function childOwnerToken(childNodeId, incarnation) {
|
|
|
1392
1398
|
* re-registering, and those two want opposite investigations. A line per skip
|
|
1393
1399
|
* would reproduce exactly the volume the gate exists to remove.
|
|
1394
1400
|
*/
|
|
1395
|
-
|
|
1401
|
+
exports.CHILD_MANIFEST_SKIP_SAMPLE = 25;
|
|
1396
1402
|
/** Canonical, order-insensitive text for a child manifest. */
|
|
1397
1403
|
function childManifestFingerprint(params) {
|
|
1398
1404
|
const addons = params.addons
|
|
@@ -1426,7 +1432,7 @@ function childManifestFingerprint(params) {
|
|
|
1426
1432
|
* every provider owned by the dead generation and the successor's disconnect
|
|
1427
1433
|
* would unregister nothing.
|
|
1428
1434
|
*/
|
|
1429
|
-
|
|
1435
|
+
class ChildManifestGate {
|
|
1430
1436
|
applied = new Map();
|
|
1431
1437
|
skipped = 0;
|
|
1432
1438
|
sinceSample = 0;
|
|
@@ -1456,12 +1462,13 @@ export class ChildManifestGate {
|
|
|
1456
1462
|
}
|
|
1457
1463
|
/** True once every {@link CHILD_MANIFEST_SKIP_SAMPLE} skips. */
|
|
1458
1464
|
sampleDue() {
|
|
1459
|
-
if (this.sinceSample < CHILD_MANIFEST_SKIP_SAMPLE)
|
|
1465
|
+
if (this.sinceSample < exports.CHILD_MANIFEST_SKIP_SAMPLE)
|
|
1460
1466
|
return false;
|
|
1461
1467
|
this.sinceSample = 0;
|
|
1462
1468
|
return true;
|
|
1463
1469
|
}
|
|
1464
1470
|
}
|
|
1471
|
+
exports.ChildManifestGate = ChildManifestGate;
|
|
1465
1472
|
/**
|
|
1466
1473
|
* E1: Adapt a child's UDS `ChildCapDescriptor[]` into a `RegisterNodeParams`
|
|
1467
1474
|
* that `onRegisterNode` / `applyNodeManifest` can consume.
|
|
@@ -1483,7 +1490,7 @@ export class ChildManifestGate {
|
|
|
1483
1490
|
* cap names; device-scoped native caps are handled separately via `nativeCaps` in the
|
|
1484
1491
|
* full `RegisterNodeParams`.
|
|
1485
1492
|
*/
|
|
1486
|
-
|
|
1493
|
+
function buildChildUdsManifest(nodeId, childId, caps) {
|
|
1487
1494
|
// Group unique system (non-device-scoped) cap names per hosted addon.
|
|
1488
1495
|
// Insertion order preserves the child's registration order.
|
|
1489
1496
|
const capsByAddon = new Map();
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NetworkQualityService = void 0;
|
|
4
|
+
const system_1 = require("@camstack/system");
|
|
5
|
+
class NetworkQualityService extends system_1.NetworkQualityTracker {
|
|
3
6
|
}
|
|
7
|
+
exports.NetworkQualityService = NetworkQualityService;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationServiceWrapper = void 0;
|
|
4
|
+
const system_1 = require("@camstack/system");
|
|
2
5
|
/**
|
|
3
6
|
* NestJS-injectable wrapper around the core NotificationService.
|
|
4
7
|
*
|
|
5
8
|
* Lazily creates the NotificationService on first use, wiring in the
|
|
6
9
|
* CapabilityRegistry for proxy-based output resolution.
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
class NotificationServiceWrapper {
|
|
9
12
|
caps;
|
|
10
13
|
logging;
|
|
11
14
|
_service = null;
|
|
@@ -15,7 +18,7 @@ export class NotificationServiceWrapper {
|
|
|
15
18
|
}
|
|
16
19
|
get service() {
|
|
17
20
|
if (!this._service) {
|
|
18
|
-
this._service = new NotificationService(this.logging.createLogger('notifications'));
|
|
21
|
+
this._service = new system_1.NotificationService(this.logging.createLogger('notifications'));
|
|
19
22
|
const registry = this.caps.getRegistry();
|
|
20
23
|
if (registry) {
|
|
21
24
|
this._service.setRegistry(registry);
|
|
@@ -27,3 +30,4 @@ export class NotificationServiceWrapper {
|
|
|
27
30
|
return this.service.notify(notification);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
exports.NotificationServiceWrapper = NotificationServiceWrapper;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToastServiceWrapper = void 0;
|
|
4
|
+
const system_1 = require("@camstack/system");
|
|
2
5
|
/**
|
|
3
6
|
* NestJS-injectable wrapper around the core ToastService.
|
|
4
7
|
*
|
|
5
8
|
* Provides toast broadcasting to connected UI clients.
|
|
6
9
|
*/
|
|
7
|
-
|
|
8
|
-
_service = new ToastService();
|
|
10
|
+
class ToastServiceWrapper {
|
|
11
|
+
_service = new system_1.ToastService();
|
|
9
12
|
get service() {
|
|
10
13
|
return this._service;
|
|
11
14
|
}
|
|
@@ -19,3 +22,4 @@ export class ToastServiceWrapper {
|
|
|
19
22
|
return this._service.subscribe(connectionId, userId, callback);
|
|
20
23
|
}
|
|
21
24
|
}
|
|
25
|
+
exports.ToastServiceWrapper = ToastServiceWrapper;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReplEngineService = void 0;
|
|
4
|
+
const system_1 = require("@camstack/system");
|
|
5
|
+
const types_1 = require("@camstack/types");
|
|
6
|
+
class ReplEngineService extends system_1.ReplEngine {
|
|
4
7
|
/**
|
|
5
8
|
* Lazily-instantiated `SystemMirror` shared across REPL sessions.
|
|
6
9
|
* Holds a single warm-boot mirror that every `sm.getDeviceById(id)`
|
|
@@ -45,7 +48,7 @@ export class ReplEngineService extends ReplEngine {
|
|
|
45
48
|
return Promise.resolve(this.systemMirror);
|
|
46
49
|
if (!this.systemMirrorInit) {
|
|
47
50
|
const api = this.buildInProcessApi(addonRegistry, eventBus);
|
|
48
|
-
const sm = new SystemMirror(api);
|
|
51
|
+
const sm = new types_1.SystemMirror(api);
|
|
49
52
|
this.systemMirrorInit = sm.init().then(() => {
|
|
50
53
|
this.systemMirror = sm;
|
|
51
54
|
return sm;
|
|
@@ -134,3 +137,4 @@ export class ReplEngineService extends ReplEngine {
|
|
|
134
137
|
super(contextProvider);
|
|
135
138
|
}
|
|
136
139
|
}
|
|
140
|
+
exports.ReplEngineService = ReplEngineService;
|