@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,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildCapCallFn = buildCapCallFn;
|
|
1
4
|
/**
|
|
2
5
|
* cap-call-fn — the per-(cap, node) dispatcher behind every CapabilityRegistry
|
|
3
6
|
* provider proxy the hub builds in `applyNodeManifest`.
|
|
@@ -14,7 +17,7 @@
|
|
|
14
17
|
* (hub → agent over Moleculer → agent's UDS child) and a direct remote as
|
|
15
18
|
* `remote-moleculer`.
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
const types_1 = require("@camstack/types");
|
|
18
21
|
/** Extract a numeric `deviceId` routing hint out of arbitrary method args. */
|
|
19
22
|
function extractDeviceId(params) {
|
|
20
23
|
if (params === null || typeof params !== 'object')
|
|
@@ -39,7 +42,7 @@ function extractStatedCallerAddonId(params) {
|
|
|
39
42
|
* Build the `CallFn` (`(method, params, targetNodeId?) => Promise`) for one
|
|
40
43
|
* registered provider. See module docs for the routing rationale.
|
|
41
44
|
*/
|
|
42
|
-
|
|
45
|
+
function buildCapCallFn(deps) {
|
|
43
46
|
return async (method, params, targetNodeId) => {
|
|
44
47
|
const deviceId = extractDeviceId(params);
|
|
45
48
|
// ── Hub-local child: route per-child over UDS (collection-safe — keyed by
|
|
@@ -52,7 +55,7 @@ export function buildCapCallFn(deps) {
|
|
|
52
55
|
const registry = deps.getLocalChildRegistry();
|
|
53
56
|
if (registry !== null && registry.childProvides(deps.udsChildId, deps.capName, deviceId)) {
|
|
54
57
|
deps.onUdsRoute?.(deps.capName);
|
|
55
|
-
const statedCaller = CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
|
|
58
|
+
const statedCaller = types_1.CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
|
|
56
59
|
? extractStatedCallerAddonId(params)
|
|
57
60
|
: undefined;
|
|
58
61
|
const input = {
|
|
@@ -76,7 +79,7 @@ export function buildCapCallFn(deps) {
|
|
|
76
79
|
// there is a harmless no-op.
|
|
77
80
|
const resolver = deps.getResolver();
|
|
78
81
|
if (resolver !== null) {
|
|
79
|
-
const statedCaller = CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
|
|
82
|
+
const statedCaller = types_1.CALLER_STAMPED_CAPABILITIES.includes(deps.capName)
|
|
80
83
|
? extractStatedCallerAddonId(params)
|
|
81
84
|
: undefined;
|
|
82
85
|
const route = resolver.resolveCapRoute(deps.capName, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Adapter factories that bridge the server-side registry/service state into the
|
|
3
4
|
* narrow interfaces that CapRouteResolver (in @camstack/system) requires.
|
|
@@ -12,6 +13,10 @@
|
|
|
12
13
|
* hub child → 'hub/<runnerId>' → not an agent
|
|
13
14
|
* agent → bare id with no '/' → agent
|
|
14
15
|
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.createNodeCapAuthority = createNodeCapAuthority;
|
|
18
|
+
exports.createInProcessProviderLookup = createInProcessProviderLookup;
|
|
19
|
+
exports.createHubResidentProviderLookup = createHubResidentProviderLookup;
|
|
15
20
|
/**
|
|
16
21
|
* Build a NodeCapAuthority backed by a HubNodeRegistry.
|
|
17
22
|
*
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
* child under an agent provides a cap (the agent flattens its subtree into
|
|
28
33
|
* one merged manifest). The agent resolves its own child locally (Task 6).
|
|
29
34
|
*/
|
|
30
|
-
|
|
35
|
+
function createNodeCapAuthority(nodeRegistry, resolver) {
|
|
31
36
|
return {
|
|
32
37
|
nodeKnowsCap(nodeId, capName) {
|
|
33
38
|
// Check system (manifest) caps first
|
|
@@ -97,7 +102,7 @@ export function createNodeCapAuthority(nodeRegistry, resolver) {
|
|
|
97
102
|
* Function (implicit `any` return); calling via `fn.call(provider, args)` is
|
|
98
103
|
* then safe and the result is captured as `unknown`. No `as` casts anywhere.
|
|
99
104
|
*/
|
|
100
|
-
|
|
105
|
+
function createInProcessProviderLookup(capabilityService) {
|
|
101
106
|
return (capName) => {
|
|
102
107
|
const provider = capabilityService.getSingletonForNode?.(capName, 'hub') ??
|
|
103
108
|
capabilityService.getSingleton(capName);
|
|
@@ -121,7 +126,7 @@ export function createInProcessProviderLookup(capabilityService) {
|
|
|
121
126
|
* the hub landed on a remote agent whenever the hub's decoder runner was
|
|
122
127
|
* circuit-broken). Wired into `CapRouteResolver.hubResidentProviders`.
|
|
123
128
|
*/
|
|
124
|
-
|
|
129
|
+
function createHubResidentProviderLookup(capabilityService) {
|
|
125
130
|
return (capName) => {
|
|
126
131
|
const provider = capabilityService.getSingletonForNode?.(capName, 'hub');
|
|
127
132
|
if (provider === null || provider === undefined)
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HubMeshGuard = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* The hub's mesh guard (D802, D857) — the one object that decides whether
|
|
3
6
|
* another node may talk to the hub.
|
|
@@ -11,20 +14,20 @@
|
|
|
11
14
|
*
|
|
12
15
|
* Kept out of `moleculer.service.ts` so that file only wires it.
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
const system_1 = require("@camstack/system");
|
|
15
18
|
/** At most one "refused" line per node per this long. */
|
|
16
19
|
const REFUSED_LOG_INTERVAL_MS = 60_000;
|
|
17
|
-
|
|
20
|
+
class HubMeshGuard {
|
|
18
21
|
ownNodeId;
|
|
19
22
|
logger;
|
|
20
23
|
now;
|
|
21
24
|
gate;
|
|
22
25
|
lastLoggedAt = new Map();
|
|
23
|
-
constructor(ownNodeId, logger, now = Date.now, isVerifiedPeer = isProcessVerifiedMeshPeer) {
|
|
26
|
+
constructor(ownNodeId, logger, now = Date.now, isVerifiedPeer = system_1.isProcessVerifiedMeshPeer) {
|
|
24
27
|
this.ownNodeId = ownNodeId;
|
|
25
28
|
this.logger = logger;
|
|
26
29
|
this.now = now;
|
|
27
|
-
this.gate = new MeshIdentityGate({
|
|
30
|
+
this.gate = new system_1.MeshIdentityGate({
|
|
28
31
|
ownNodeId,
|
|
29
32
|
isVerifiedPeer,
|
|
30
33
|
onRefused: (nodeId, what) => this.noteRefused(nodeId, what),
|
|
@@ -32,7 +35,7 @@ export class HubMeshGuard {
|
|
|
32
35
|
}
|
|
33
36
|
/** The middleware the hub broker must be constructed with. */
|
|
34
37
|
middleware() {
|
|
35
|
-
return createMeshAccessMiddleware({
|
|
38
|
+
return (0, system_1.createMeshAccessMiddleware)({
|
|
36
39
|
ownNodeId: this.ownNodeId,
|
|
37
40
|
gate: this.gate,
|
|
38
41
|
logger: {
|
|
@@ -56,3 +59,4 @@ export class HubMeshGuard {
|
|
|
56
59
|
'System → Cluster → Agents', { tags: { nodeId }, meta: { firstCall: what } });
|
|
57
60
|
}
|
|
58
61
|
}
|
|
62
|
+
exports.HubMeshGuard = HubMeshGuard;
|