@camstack/server 1.2.593 → 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.
- package/dist/addon-root-inventory.js +11 -50
- package/dist/agent/addon-scan.js +6 -44
- package/dist/agent/agent-addon-runtime.js +3 -8
- package/dist/agent/agent-addon-updates.js +12 -52
- package/dist/agent/agent-cap-dispatch-service.js +3 -5
- package/dist/agent/agent-config.js +7 -42
- package/dist/agent/agent-deploy-swap.js +5 -41
- package/dist/agent/agent-group-runner.js +8 -47
- package/dist/agent/agent-http-auth.js +10 -22
- package/dist/agent/agent-http.js +69 -115
- package/dist/agent/agent-hub-addon-update.js +10 -16
- package/dist/agent/agent-hub-registration.js +4 -7
- package/dist/agent/agent-infra-capabilities.js +5 -9
- package/dist/agent/agent-json-file.js +5 -42
- package/dist/agent/agent-mesh-gate.js +5 -8
- package/dist/agent/agent-node-certificates.js +25 -28
- package/dist/agent/agent-pairing-local.js +10 -47
- package/dist/agent/agent-pairing-routes.js +16 -20
- package/dist/agent/agent-pairing-store.js +18 -58
- package/dist/agent/agent-reconnect.js +1 -4
- package/dist/agent/agent-service.js +42 -78
- package/dist/agent/agent-sniffing-listener.js +11 -48
- package/dist/agent/agent-undeploy.js +5 -41
- package/dist/agent/agent-update-routes.js +14 -19
- package/dist/agent/agent-update-service.js +38 -80
- package/dist/agent/apply-model-distribution.js +1 -4
- package/dist/agent/apply-stage-dev-uploads.js +6 -9
- package/dist/agent/derive-hub-url.js +3 -8
- package/dist/agent/fetch-bundle-from-hub.js +6 -9
- package/dist/agent/hubs-found.js +6 -43
- package/dist/agent/infra-boot-guard.js +1 -4
- package/dist/agent/infra-boot-plan.js +2 -6
- package/dist/agent/main.js +158 -186
- package/dist/agent/register-agent-cap-dispatch.js +3 -6
- package/dist/agent/serial-queue.js +2 -7
- package/dist/agent-status-page.js +1 -4
- package/dist/api/addon-upload.js +22 -61
- package/dist/api/agent-addon-delivery.js +6 -11
- package/dist/api/auth-whoami.js +1 -4
- package/dist/api/backup-download-pump.js +5 -9
- package/dist/api/backup-download.js +7 -10
- package/dist/api/core/addon-settings.router.js +16 -19
- package/dist/api/core/agent-pairing.router.js +76 -79
- package/dist/api/core/agents.router.js +21 -24
- package/dist/api/core/auth-admin-tokens.procedures.js +48 -52
- package/dist/api/core/auth-device-cert.procedures.js +62 -67
- package/dist/api/core/auth-limits.js +16 -25
- package/dist/api/core/auth-reauth.procedures.js +32 -37
- package/dist/api/core/auth-revoke-credentials.procedures.js +22 -26
- package/dist/api/core/auth-sessions.procedures.js +52 -56
- package/dist/api/core/auth.router.js +300 -304
- package/dist/api/core/cap-providers.js +74 -121
- package/dist/api/core/capabilities.router.js +34 -37
- package/dist/api/core/capability-preference-writes.js +10 -17
- package/dist/api/core/certificates.router.js +106 -109
- package/dist/api/core/cluster-nodes.router.js +15 -18
- package/dist/api/core/collection-preference.js +2 -6
- package/dist/api/core/event-bus-proxy.router.js +34 -37
- package/dist/api/core/failure-contributions.js +4 -8
- package/dist/api/core/hwaccel.router.js +17 -20
- package/dist/api/core/integration-secrets.js +8 -12
- package/dist/api/core/lifecycle-job-runner.js +13 -49
- package/dist/api/core/live-events.router.js +29 -32
- package/dist/api/core/load-contributions.js +4 -8
- package/dist/api/core/logging-settings.js +30 -43
- package/dist/api/core/logs.router.js +40 -43
- package/dist/api/core/notifications.router.js +15 -18
- package/dist/api/core/public-event-filter.js +4 -8
- package/dist/api/core/repl.router.js +18 -21
- package/dist/api/core/request-census-settings.js +11 -16
- package/dist/api/core/server-management.provider.js +1 -4
- package/dist/api/core/server-name.js +9 -17
- package/dist/api/core/site-location.js +16 -24
- package/dist/api/core/stream-probe.router.js +21 -24
- package/dist/api/core/system-events.router.js +23 -26
- package/dist/api/cors/cors-policy.js +20 -29
- package/dist/api/cors/register-cors-policy.js +9 -14
- package/dist/api/deploy-stage-registry.js +6 -10
- package/dist/api/dev-uploads-bundle.js +12 -50
- package/dist/api/health/adaptive-probe.routes.js +9 -13
- package/dist/api/health/health.routes.js +8 -13
- package/dist/api/hub-cluster-url.js +3 -9
- package/dist/api/model-distributor.js +12 -50
- package/dist/api/oauth2/consent-page.js +10 -13
- package/dist/api/oauth2/oauth2-routes.js +17 -25
- package/dist/api/oauth2/private-host.js +1 -4
- package/dist/api/server-upload-propagate.js +15 -51
- package/dist/api/server-upload.js +13 -50
- package/dist/api/sse-no-compression.js +1 -4
- package/dist/api/static/frame-policy.js +4 -9
- package/dist/api/static/precompressed-asset.js +15 -57
- package/dist/api/static/spa-mount.js +8 -47
- package/dist/api/static/spa-static.js +5 -12
- package/dist/api/tarball-manifest.js +7 -44
- package/dist/api/trpc/cap-mount-helpers.js +7 -12
- package/dist/api/trpc/cap-route-error-formatter.js +10 -13
- package/dist/api/trpc/cap-router-runtime.js +40 -51
- package/dist/api/trpc/client-ip.js +9 -20
- package/dist/api/trpc/core-cap-bridge.js +32 -42
- package/dist/api/trpc/device-collection-dispatch.js +23 -27
- package/dist/api/trpc/device-config-secret-redaction.js +24 -40
- package/dist/api/trpc/generated-cap-mounts.js +218 -222
- package/dist/api/trpc/generated-cap-routers.js +4688 -4850
- package/dist/api/trpc/http-request-census-hook.js +8 -11
- package/dist/api/trpc/http-request-census.js +34 -41
- package/dist/api/trpc/http-request-census.singleton.js +4 -8
- package/dist/api/trpc/localized-schema-paths.js +1 -4
- package/dist/api/trpc/principal-visibility.js +14 -22
- package/dist/api/trpc/remote-addon-update-grant.js +1 -4
- package/dist/api/trpc/scope-access.js +10 -15
- package/dist/api/trpc/server-provided-caps.js +3 -7
- package/dist/api/trpc/share-view-access.js +6 -14
- package/dist/api/trpc/trpc-error-device-tags.js +3 -6
- package/dist/api/trpc/trpc-error-principal.js +2 -6
- package/dist/api/trpc/trpc.context.js +20 -25
- package/dist/api/trpc/trpc.middleware.js +38 -46
- package/dist/api/trpc/trpc.router.js +58 -99
- package/dist/api/trpc/user-error.js +5 -8
- package/dist/api/trpc/ws-request-census.js +17 -24
- package/dist/api/trpc/ws-slow-consumer-guard.js +11 -16
- package/dist/api/upload-auth.js +5 -9
- package/dist/auth/addon-route-jwt-gate.js +4 -7
- package/dist/auth/addon-route-share-gate.js +7 -12
- package/dist/auth/app-confirm-page.js +17 -22
- package/dist/auth/app-confirm-routes.js +26 -31
- package/dist/auth/app-confirmations.js +7 -44
- package/dist/auth/app-page-shell.js +17 -30
- package/dist/auth/app-page-strings.js +11 -17
- package/dist/auth/app-passkey-page.js +16 -21
- package/dist/auth/app-passkey-routes.js +37 -41
- package/dist/auth/app-refused-route.js +13 -18
- package/dist/auth/auth-network-policy.js +11 -15
- package/dist/auth/auth-provider-gate.js +4 -9
- package/dist/auth/auth-rate-limit.js +3 -7
- package/dist/auth/client-address.js +6 -9
- package/dist/auth/device-enroll-proofs.js +6 -43
- package/dist/auth/external-link-intents.js +3 -7
- package/dist/auth/hub-sessions.js +6 -12
- package/dist/auth/native-link-completions.js +7 -11
- package/dist/auth/native-return.js +9 -13
- package/dist/auth/passkey-provider.js +26 -32
- package/dist/auth/second-factors.js +6 -10
- package/dist/auth/session-connections.js +6 -12
- package/dist/auth/session-cookie.js +12 -23
- package/dist/auth/session-lifetimes.js +8 -12
- package/dist/auth/session-mint.js +4 -11
- package/dist/auth/sso-finish-app.js +13 -16
- package/dist/auth/sso-finish-deps.js +21 -27
- package/dist/auth/sso-finish.js +28 -38
- package/dist/auth/sso-routes.js +22 -25
- package/dist/auth/used-bridge-ids.js +1 -5
- package/dist/boot/boot-config.js +16 -55
- package/dist/boot/init-sequence.js +1 -4
- package/dist/boot/integration-id-backfill.js +3 -8
- package/dist/boot/platform-keychain-key.js +5 -42
- package/dist/boot/post-boot.service.js +14 -18
- package/dist/boot/reconcile-lifecycle-jobs.js +3 -6
- package/dist/boot/retired-public-url-env.js +4 -8
- package/dist/bootstrap-packages.js +1 -4
- package/dist/closure-node-modules.js +2 -38
- package/dist/closure-patches/patch-reach.json +6 -2
- package/dist/core/addon/addon-call-gateway.js +1 -5
- package/dist/core/addon/addon-package.service.js +83 -123
- package/dist/core/addon/addon-process-view.js +2 -6
- package/dist/core/addon/addon-realign-plan.js +1 -4
- package/dist/core/addon/addon-registry.service.js +199 -185
- package/dist/core/addon/addon-row-manifest.js +1 -4
- package/dist/core/addon/addon-search.service.js +3 -7
- package/dist/core/addon/addon-settings-provider.js +1 -3
- package/dist/core/addon/addon-uninstall.js +4 -11
- package/dist/core/addon/addon.tokens.js +2 -5
- package/dist/core/addon/device-meta-mirror.js +8 -13
- package/dist/core/addon/forked-custom-actions.js +6 -11
- package/dist/core/addon/integration-visibility.js +3 -6
- package/dist/core/addon/materialize-route-path.js +1 -4
- package/dist/core/addon/package-dir-utils.js +8 -45
- package/dist/core/addon/prune-misplaced-addons.js +5 -43
- package/dist/core/addon/runner-convergence.js +1 -4
- package/dist/core/addon/runner-serialization.js +1 -4
- package/dist/core/addon/runner-spawn-fanout.js +3 -8
- package/dist/core/addon/settings-door-wiring.js +5 -8
- package/dist/core/addon/single-flight-refresh.js +1 -4
- package/dist/core/addon-bridge/addon-bridge.service.js +7 -44
- package/dist/core/addon-pages/addon-pages.service.js +3 -40
- package/dist/core/addon-widgets/addon-widgets.service.js +4 -42
- package/dist/core/agent/agent-addon-backfill.js +9 -17
- package/dist/core/agent/agent-delivery-ledger.js +3 -7
- package/dist/core/agent/agent-liveness-event.js +2 -6
- package/dist/core/agent/agent-pairing-http.js +41 -45
- package/dist/core/agent/agent-registry.service.js +53 -92
- package/dist/core/agent/cluster-node-history-mirror.js +3 -7
- package/dist/core/agent/cluster-node-history-store.js +113 -58
- package/dist/core/agent/hub-agent-pairing.js +1 -5
- package/dist/core/agent/node-certificates-client.js +3 -6
- package/dist/core/agent/node-directory.js +1 -4
- package/dist/core/app-links/well-known-app-links.js +2 -6
- package/dist/core/auth/auth.service.js +3 -8
- package/dist/core/auth/handoff-code.service.js +11 -49
- package/dist/core/auth/record-kinds.js +35 -0
- package/dist/core/auth/share-token.service.js +174 -122
- package/dist/core/capability/capability.service.js +1 -5
- package/dist/core/config/config.schema.js +1 -6
- package/dist/core/config/config.service.js +2 -6
- package/dist/core/events/event-bus.service.js +3 -7
- package/dist/core/feature/feature.service.js +2 -6
- package/dist/core/lifecycle/lifecycle-runner.singleton.js +5 -10
- package/dist/core/lifecycle/lifecycle-state-machine.js +1 -5
- package/dist/core/logging/log-ring-buffer.js +1 -5
- package/dist/core/logging/logging.service.js +5 -9
- package/dist/core/logging/scoped-logger.js +1 -5
- package/dist/core/moleculer/agent-readiness-pull.js +1 -4
- package/dist/core/moleculer/agent-registration-request.js +3 -7
- package/dist/core/moleculer/cap-call-fn.js +39 -5
- package/dist/core/moleculer/cap-route-authority.js +3 -8
- package/dist/core/moleculer/hub-mesh-guard.js +5 -9
- package/dist/core/moleculer/moleculer.service.js +108 -119
- package/dist/core/network/network-quality.service.js +2 -6
- package/dist/core/notification/notification-wrapper.service.js +3 -7
- package/dist/core/notification/toast-wrapper.service.js +3 -7
- package/dist/core/provider/provider.tokens.js +1 -4
- package/dist/core/repl/repl-engine.service.js +4 -8
- package/dist/core/runner-health/runner-boot-check.js +7 -15
- package/dist/core/runner-health/update-preflight.js +9 -14
- package/dist/core/server-update/server-update.service.js +12 -49
- package/dist/core/server-update/system-apply-closure-patches.js +6 -42
- package/dist/core/server-update/system-ensure-prebuilds.js +3 -6
- package/dist/core/server-update/system-exec-npm.js +2 -5
- package/dist/core/storage/fs-storage-backend.js +1 -5
- package/dist/core/storage/storage-location-manager.js +1 -5
- package/dist/core/storage/storage.service.js +2 -6
- package/dist/core/streaming/ffmpeg-stream-info.js +3 -8
- package/dist/core/streaming/stream-probe.service.js +12 -16
- package/dist/core/streaming/ttl-cache.js +1 -5
- package/dist/core/topology/topology-emitter.service.js +19 -23
- package/dist/core/update-availability-emitter.js +3 -7
- package/dist/core/update-availability-store.js +8 -45
- package/dist/core/updates/agent-installed-packages.js +5 -9
- package/dist/core/updates/restart-marker.js +3 -8
- package/dist/core/updates/update-check-scheduler.js +13 -18
- package/dist/core/updates/wrapper-update-checker.js +3 -7
- package/dist/first-boot-addon-plan.js +2 -6
- package/dist/framework-nodepath.js +2 -38
- package/dist/i18n/request-lang.js +7 -11
- package/dist/launcher.js +30 -65
- package/dist/lifecycle-journal-path.js +2 -38
- package/dist/main.js +287 -324
- package/dist/manual-boot.js +120 -157
- package/dist/node-role.js +1 -4
- package/dist/package-inventory.js +7 -48
- package/dist/pending-restore.js +7 -43
- package/dist/single-copy-cleanup-runner.js +9 -45
- package/dist/single-copy-cleanup.js +7 -15
- package/dist/sqlite-restore.js +9 -48
- package/dist/starter.js +4 -39
- package/dist/ui-serving/lazy-ui-serving.js +3 -39
- package/package.json +13 -13
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.overlayDeclaration = overlayDeclaration;
|
|
4
1
|
/**
|
|
5
2
|
* Overlay the fresh on-disk `declaration` onto a live addon instance's
|
|
6
3
|
* `manifest` when building the rows returned by `listAddons()`.
|
|
@@ -24,6 +21,6 @@ exports.overlayDeclaration = overlayDeclaration;
|
|
|
24
21
|
* values), so the spread overlays only the keys the declaration actually
|
|
25
22
|
* defines; the instance manifest fills any gaps.
|
|
26
23
|
*/
|
|
27
|
-
function overlayDeclaration(instanceManifest, declaration) {
|
|
24
|
+
export function overlayDeclaration(instanceManifest, declaration) {
|
|
28
25
|
return { ...instanceManifest, ...declaration };
|
|
29
26
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AddonSearchService = void 0;
|
|
4
|
-
const types_1 = require("@camstack/types");
|
|
5
|
-
class AddonSearchService {
|
|
1
|
+
import { errMsg } from '@camstack/types';
|
|
2
|
+
export class AddonSearchService {
|
|
6
3
|
loggingService;
|
|
7
4
|
cache = null;
|
|
8
5
|
CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -53,10 +50,9 @@ class AddonSearchService {
|
|
|
53
50
|
}
|
|
54
51
|
catch (err) {
|
|
55
52
|
const logger = this.loggingService.createLogger('addon-search');
|
|
56
|
-
logger.warn('npm search failed', { meta: { error:
|
|
53
|
+
logger.warn('npm search failed', { meta: { error: errMsg(err) } });
|
|
57
54
|
// Stale cache is better than nothing on transient network failure
|
|
58
55
|
return this.cache?.results ?? [];
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
exports.AddonSearchService = AddonSearchService;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAddonSettingsProvider = createAddonSettingsProvider;
|
|
4
1
|
function reshapeForOutput(schema) {
|
|
5
2
|
return {
|
|
6
3
|
tabs: schema.tabs
|
|
@@ -120,3 +117,4 @@ function createAddonSettingsProvider(deps) {
|
|
|
120
117
|
},
|
|
121
118
|
};
|
|
122
119
|
}
|
|
120
|
+
export { createAddonSettingsProvider };
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PackageProtectedError = void 0;
|
|
4
|
-
exports.isHubNodeId = isHubNodeId;
|
|
5
|
-
exports.uninstallPackage = uninstallPackage;
|
|
6
|
-
exports.listInstallations = listInstallations;
|
|
7
1
|
/** The hub refuses before touching any node. Mapped to FORBIDDEN by the router. */
|
|
8
|
-
class PackageProtectedError extends Error {
|
|
2
|
+
export class PackageProtectedError extends Error {
|
|
9
3
|
constructor(packageName) {
|
|
10
4
|
super(`Package ${packageName} is required and cannot be uninstalled`);
|
|
11
5
|
this.name = 'PackageProtectedError';
|
|
12
6
|
}
|
|
13
7
|
}
|
|
14
|
-
exports.PackageProtectedError = PackageProtectedError;
|
|
15
8
|
/** A node id that refers to the hub itself (top-level or a hub group runner). */
|
|
16
|
-
function isHubNodeId(nodeId) {
|
|
9
|
+
export function isHubNodeId(nodeId) {
|
|
17
10
|
return nodeId === 'hub' || nodeId.startsWith('hub/');
|
|
18
11
|
}
|
|
19
12
|
const OK_OUTCOMES = new Set([
|
|
@@ -164,7 +157,7 @@ async function agentsHolding(seam, packageName) {
|
|
|
164
157
|
}));
|
|
165
158
|
return holding.filter((n) => n !== null);
|
|
166
159
|
}
|
|
167
|
-
async function uninstallPackage(seam, request) {
|
|
160
|
+
export async function uninstallPackage(seam, request) {
|
|
168
161
|
const { packageName } = request;
|
|
169
162
|
if (seam.isProtected(packageName))
|
|
170
163
|
throw new PackageProtectedError(packageName);
|
|
@@ -196,7 +189,7 @@ async function uninstallPackage(seam, request) {
|
|
|
196
189
|
}
|
|
197
190
|
return summarize(packageName, [await uninstallFromAgent(seam, node, packageName)]);
|
|
198
191
|
}
|
|
199
|
-
async function listInstallations(seam, packageName) {
|
|
192
|
+
export async function listInstallations(seam, packageName) {
|
|
200
193
|
const wanted = (name) => packageName === undefined || name === packageName;
|
|
201
194
|
const hubPackages = seam.listHubPackages();
|
|
202
195
|
const onHub = new Set(hubPackages.map((p) => p.name));
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BUILTIN_ADDONS = exports.ADDON_REGISTRY = void 0;
|
|
4
|
-
exports.ADDON_REGISTRY = Symbol('ADDON_REGISTRY');
|
|
5
|
-
exports.BUILTIN_ADDONS = Symbol('BUILTIN_ADDONS');
|
|
1
|
+
export const ADDON_REGISTRY = Symbol('ADDON_REGISTRY');
|
|
2
|
+
export const BUILTIN_ADDONS = Symbol('BUILTIN_ADDONS');
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* The hub-process mirror of every device's persisted `parentDeviceId`, `type`
|
|
4
3
|
* and `location` — and the rule that decides how much of the fleet a device
|
|
@@ -59,18 +58,15 @@
|
|
|
59
58
|
* contract `DeviceRowStore.getMany` states for a fleet it does not know. A
|
|
60
59
|
* read that THROWS is not that: it changes nothing at all (D49).
|
|
61
60
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
exports.classifyDeviceEvent = classifyDeviceEvent;
|
|
65
|
-
const types_1 = require("@camstack/types");
|
|
66
|
-
const single_flight_refresh_js_1 = require("./single-flight-refresh.js");
|
|
61
|
+
import { errMsg } from '@camstack/types';
|
|
62
|
+
import { createSingleFlightRefresh } from './single-flight-refresh.js';
|
|
67
63
|
/**
|
|
68
64
|
* Meta fields a `DeviceMetaChanged` can name that this mirror provably does
|
|
69
65
|
* not hold. Enumerated from every `field:` literal `device-meta-actions.ts`
|
|
70
66
|
* emits; `location` and `type` are deliberately ABSENT because those two are
|
|
71
67
|
* the mirror.
|
|
72
68
|
*/
|
|
73
|
-
|
|
69
|
+
export const MIRROR_IRRELEVANT_META_FIELDS = new Set([
|
|
74
70
|
'name',
|
|
75
71
|
'disabled',
|
|
76
72
|
'metadata',
|
|
@@ -90,11 +86,11 @@ exports.MIRROR_IRRELEVANT_META_FIELDS = new Set([
|
|
|
90
86
|
* never silently skip a refresh, because the failure mode is an authorisation
|
|
91
87
|
* mirror that quietly stops converging.
|
|
92
88
|
*/
|
|
93
|
-
function classifyDeviceEvent(data) {
|
|
89
|
+
export function classifyDeviceEvent(data) {
|
|
94
90
|
if (data === null || typeof data !== 'object')
|
|
95
91
|
return { kind: 'fleet' };
|
|
96
92
|
const field = Reflect.get(data, 'field');
|
|
97
|
-
if (typeof field === 'string' &&
|
|
93
|
+
if (typeof field === 'string' && MIRROR_IRRELEVANT_META_FIELDS.has(field)) {
|
|
98
94
|
return { kind: 'none' };
|
|
99
95
|
}
|
|
100
96
|
const deviceId = Reflect.get(data, 'deviceId');
|
|
@@ -104,7 +100,7 @@ function classifyDeviceEvent(data) {
|
|
|
104
100
|
}
|
|
105
101
|
/** Max ancestor hops — defence-in-depth against a corrupt parent cycle. */
|
|
106
102
|
const MAX_ANCESTOR_HOPS = 8;
|
|
107
|
-
class DeviceMetaMirror {
|
|
103
|
+
export class DeviceMetaMirror {
|
|
108
104
|
read;
|
|
109
105
|
live;
|
|
110
106
|
logger;
|
|
@@ -115,7 +111,7 @@ class DeviceMetaMirror {
|
|
|
115
111
|
this.read = read;
|
|
116
112
|
this.live = live;
|
|
117
113
|
this.logger = logger;
|
|
118
|
-
this.gate =
|
|
114
|
+
this.gate = createSingleFlightRefresh((scope) => this.refresh(scope));
|
|
119
115
|
}
|
|
120
116
|
/** Ask for a refresh covering exactly what the event changed. */
|
|
121
117
|
onDeviceEvent(data) {
|
|
@@ -231,9 +227,8 @@ class DeviceMetaMirror {
|
|
|
231
227
|
}
|
|
232
228
|
catch (err) {
|
|
233
229
|
this.logger.debug('device-meta mirror refresh failed — keeping previous', {
|
|
234
|
-
meta: { error:
|
|
230
|
+
meta: { error: errMsg(err), scope: scope === null ? 'fleet' : scope.size },
|
|
235
231
|
});
|
|
236
232
|
}
|
|
237
233
|
}
|
|
238
234
|
}
|
|
239
|
-
exports.DeviceMetaMirror = DeviceMetaMirror;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toForkedCustomActionsSpec = toForkedCustomActionsSpec;
|
|
4
|
-
exports.childCatalogsFingerprint = childCatalogsFingerprint;
|
|
5
|
-
exports.summarizeChildCatalogs = summarizeChildCatalogs;
|
|
6
|
-
const zod_1 = require("zod");
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
/**
|
|
8
3
|
* Build the hub-side catalog for a forked addon.
|
|
9
4
|
*
|
|
@@ -13,12 +8,12 @@ const zod_1 = require("zod");
|
|
|
13
8
|
* schemas and refuses what they refuse. `kind`, `auth`, `scope` and `caller`
|
|
14
9
|
* are the fields the hub actually gates on, and they arrive intact.
|
|
15
10
|
*/
|
|
16
|
-
function toForkedCustomActionsSpec(descriptor) {
|
|
11
|
+
export function toForkedCustomActionsSpec(descriptor) {
|
|
17
12
|
const spec = {};
|
|
18
13
|
for (const [name, action] of Object.entries(descriptor)) {
|
|
19
14
|
spec[name] = {
|
|
20
|
-
input:
|
|
21
|
-
output:
|
|
15
|
+
input: z.unknown(),
|
|
16
|
+
output: z.unknown(),
|
|
22
17
|
kind: action.kind,
|
|
23
18
|
auth: action.auth,
|
|
24
19
|
scope: action.scope,
|
|
@@ -35,7 +30,7 @@ function toForkedCustomActionsSpec(descriptor) {
|
|
|
35
30
|
* one catalog must never fingerprint differently because a runner enumerated
|
|
36
31
|
* its map in another order.
|
|
37
32
|
*/
|
|
38
|
-
function childCatalogsFingerprint(catalogs) {
|
|
33
|
+
export function childCatalogsFingerprint(catalogs) {
|
|
39
34
|
return JSON.stringify(sortKeysDeep(catalogs));
|
|
40
35
|
}
|
|
41
36
|
function sortKeysDeep(value) {
|
|
@@ -49,7 +44,7 @@ function sortKeysDeep(value) {
|
|
|
49
44
|
}
|
|
50
45
|
return out;
|
|
51
46
|
}
|
|
52
|
-
function summarizeChildCatalogs(catalogs) {
|
|
47
|
+
export function summarizeChildCatalogs(catalogs) {
|
|
53
48
|
const withActions = [];
|
|
54
49
|
const withoutActions = [];
|
|
55
50
|
for (const addonId of Object.keys(catalogs).sort()) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Who may see, and who may mint, an integration.
|
|
4
3
|
*
|
|
@@ -11,9 +10,7 @@
|
|
|
11
10
|
* here verbatim from `AddonRegistryService.createFilteredRegistry` so the rule
|
|
12
11
|
* is testable on its own.
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
|
-
exports.createFilteredIntegrationRegistry = createFilteredIntegrationRegistry;
|
|
16
|
-
const types_1 = require("@camstack/types");
|
|
13
|
+
import { bareAddonId } from '@camstack/types';
|
|
17
14
|
/**
|
|
18
15
|
* Wrap `raw` in the installed-addon view.
|
|
19
16
|
*
|
|
@@ -36,12 +33,12 @@ const types_1 = require("@camstack/types");
|
|
|
36
33
|
* it. Both branches returned a bare `null`, and that indistinguishability is
|
|
37
34
|
* precisely what kept rule 1's breach invisible for as long as it lasted.
|
|
38
35
|
*/
|
|
39
|
-
function createFilteredIntegrationRegistry(deps) {
|
|
36
|
+
export function createFilteredIntegrationRegistry(deps) {
|
|
40
37
|
const { raw, logger } = deps;
|
|
41
38
|
// A co-located builtin's `ctx.id` is `addon:<manifest id>`; every registry
|
|
42
39
|
// key is bare (D72). Normalise on the way in, or the create guard rejects
|
|
43
40
|
// exactly the builtins that legitimately declare an integration.
|
|
44
|
-
const isInstalled = (addonId) => deps.isAddonInstalled(
|
|
41
|
+
const isInstalled = (addonId) => deps.isAddonInstalled(bareAddonId(addonId));
|
|
45
42
|
/** The suppression log line. Only ever called when the row EXISTS. */
|
|
46
43
|
const logHidden = (integration, phase) => {
|
|
47
44
|
logger.warn('integration hidden — its addon is not installed, so this read answers null even though the row exists', {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.materializeRoutePath = materializeRoutePath;
|
|
4
1
|
/**
|
|
5
2
|
* Rebuild the concrete request path from a route pattern and the params the
|
|
6
3
|
* hub already matched (`/:providerId/start` + `{providerId:'authentik'}` →
|
|
@@ -13,7 +10,7 @@ exports.materializeRoutePath = materializeRoutePath;
|
|
|
13
10
|
* overwrote the real value — every parameterized route of a forked addon saw
|
|
14
11
|
* literal `:name` params.
|
|
15
12
|
*/
|
|
16
|
-
function materializeRoutePath(pattern, params) {
|
|
13
|
+
export function materializeRoutePath(pattern, params) {
|
|
17
14
|
return pattern
|
|
18
15
|
.split('/')
|
|
19
16
|
.map((part) => {
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.resolveHubClosurePackageDir = resolveHubClosurePackageDir;
|
|
37
|
-
exports.computeDistBuildId = computeDistBuildId;
|
|
38
1
|
/**
|
|
39
2
|
* Package-dir introspection helpers for the hub's OWN framework closure.
|
|
40
3
|
*
|
|
@@ -44,14 +7,14 @@ exports.computeDistBuildId = computeDistBuildId;
|
|
|
44
7
|
* these two read-only helpers remain in use by `AddonPackageService`'s
|
|
45
8
|
* framework-package status surface.
|
|
46
9
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
10
|
+
import * as fs from 'node:fs';
|
|
11
|
+
import * as path from 'node:path';
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
import { createRequire } from 'node:module';
|
|
51
14
|
// Resolve framework packages the same way the running hub does — from THIS
|
|
52
15
|
// module's location, whose walk-up lands on the hub's own `node_modules`
|
|
53
16
|
// closure (identical to the hub main's `@camstack/system` resolution).
|
|
54
|
-
const requireFromHere =
|
|
17
|
+
const requireFromHere = createRequire(__filename);
|
|
55
18
|
function readJsonObjectSafe(filePath) {
|
|
56
19
|
try {
|
|
57
20
|
const parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
@@ -76,7 +39,7 @@ function packageNameOf(pkgJsonPath) {
|
|
|
76
39
|
* resolving the main entry and walking up to the matching `package.json`.
|
|
77
40
|
* Returns null when the package is not resolvable.
|
|
78
41
|
*/
|
|
79
|
-
function resolveHubClosurePackageDir(packageName) {
|
|
42
|
+
export function resolveHubClosurePackageDir(packageName) {
|
|
80
43
|
try {
|
|
81
44
|
return path.dirname(requireFromHere.resolve(`${packageName}/package.json`));
|
|
82
45
|
}
|
|
@@ -122,7 +85,7 @@ function collectJsFiles(root, dir, out) {
|
|
|
122
85
|
* image's `seed-version` fingerprint. Returns null when the dir is missing or
|
|
123
86
|
* empty. Used to surface "same semver, new code" instead of trusting `version`.
|
|
124
87
|
*/
|
|
125
|
-
function computeDistBuildId(distDir) {
|
|
88
|
+
export function computeDistBuildId(distDir) {
|
|
126
89
|
if (!fs.existsSync(distDir))
|
|
127
90
|
return null;
|
|
128
91
|
const files = [];
|
|
@@ -130,7 +93,7 @@ function computeDistBuildId(distDir) {
|
|
|
130
93
|
if (files.length === 0)
|
|
131
94
|
return null;
|
|
132
95
|
files.sort();
|
|
133
|
-
const hash =
|
|
96
|
+
const hash = createHash('md5');
|
|
134
97
|
for (const rel of files) {
|
|
135
98
|
hash.update(rel);
|
|
136
99
|
hash.update('\0');
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.decidePrune = decidePrune;
|
|
37
|
-
exports.isPrunableDir = isPrunableDir;
|
|
38
|
-
exports.prunePlacementLeftovers = prunePlacementLeftovers;
|
|
39
1
|
/**
|
|
40
2
|
* prune-misplaced-addons — remove an installed addon that can never run here.
|
|
41
3
|
*
|
|
@@ -65,8 +27,8 @@ exports.prunePlacementLeftovers = prunePlacementLeftovers;
|
|
|
65
27
|
* deleting DATA would be. Anything outside `<dataDir>/addons/@camstack/` is
|
|
66
28
|
* refused outright.
|
|
67
29
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
30
|
+
import * as fs from 'node:fs';
|
|
31
|
+
import * as path from 'node:path';
|
|
70
32
|
/**
|
|
71
33
|
* Decide what to prune for a node in `role`. Pure — the decision is the part
|
|
72
34
|
* worth testing, and it must never depend on a filesystem to be checked.
|
|
@@ -77,7 +39,7 @@ const path = __importStar(require("node:path"));
|
|
|
77
39
|
* is expected to be inert, so pruning it would fight the seeding rather than
|
|
78
40
|
* fix anything.
|
|
79
41
|
*/
|
|
80
|
-
function decidePrune(installed, role) {
|
|
42
|
+
export function decidePrune(installed, role) {
|
|
81
43
|
if (role !== 'hub')
|
|
82
44
|
return [];
|
|
83
45
|
return installed
|
|
@@ -89,7 +51,7 @@ function decidePrune(installed, role) {
|
|
|
89
51
|
}));
|
|
90
52
|
}
|
|
91
53
|
/** Guard: only ever remove something under `<dataDir>/addons/@camstack/`. */
|
|
92
|
-
function isPrunableDir(dir, addonsRoot) {
|
|
54
|
+
export function isPrunableDir(dir, addonsRoot) {
|
|
93
55
|
const rel = path.relative(addonsRoot, dir);
|
|
94
56
|
if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel))
|
|
95
57
|
return false;
|
|
@@ -104,7 +66,7 @@ function isPrunableDir(dir, addonsRoot) {
|
|
|
104
66
|
* failed — which is exactly what we are trying to improve, not a reason to
|
|
105
67
|
* refuse to start.
|
|
106
68
|
*/
|
|
107
|
-
function prunePlacementLeftovers(decisions, addonsRoot, logger, rm = (dir) => fs.rmSync(dir, { recursive: true, force: true })) {
|
|
69
|
+
export function prunePlacementLeftovers(decisions, addonsRoot, logger, rm = (dir) => fs.rmSync(dir, { recursive: true, force: true })) {
|
|
108
70
|
const removed = [];
|
|
109
71
|
for (const d of decisions) {
|
|
110
72
|
if (!isPrunableDir(d.dir, addonsRoot)) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Group-runner convergence planner (pure).
|
|
4
3
|
*
|
|
@@ -22,8 +21,6 @@
|
|
|
22
21
|
* solo forever. To adopt a NEW roster the stale runner(s) must be STOPPED and
|
|
23
22
|
* the group spawned fresh — the convergence this planner encodes.
|
|
24
23
|
*/
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.planRunnerConvergence = planRunnerConvergence;
|
|
27
24
|
function sameRoster(addonIds, rosterSet) {
|
|
28
25
|
return addonIds.length === rosterSet.size && addonIds.every((a) => rosterSet.has(a));
|
|
29
26
|
}
|
|
@@ -38,7 +35,7 @@ function sameRoster(addonIds, rosterSet) {
|
|
|
38
35
|
* @param opts.restart true when the caller wants an in-place respawn even if
|
|
39
36
|
* the roster already matches (deploy hot-reload path).
|
|
40
37
|
*/
|
|
41
|
-
function planRunnerConvergence(runnerId, rosterAddonIds, running, opts) {
|
|
38
|
+
export function planRunnerConvergence(runnerId, rosterAddonIds, running, opts) {
|
|
42
39
|
const rosterSet = new Set(rosterAddonIds);
|
|
43
40
|
const target = running.find((p) => p.name === runnerId);
|
|
44
41
|
const targetIsCorrect = target !== undefined && sameRoster(target.addonIds, rosterSet);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRunnerSerializer = createRunnerSerializer;
|
|
4
|
-
function createRunnerSerializer() {
|
|
1
|
+
export function createRunnerSerializer() {
|
|
5
2
|
const tails = new Map();
|
|
6
3
|
return (runnerId, converge) => {
|
|
7
4
|
const previous = tails.get(runnerId) ?? Promise.resolve();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* What makes the boot runner plan safe to OVERLAP.
|
|
4
3
|
*
|
|
@@ -19,10 +18,6 @@
|
|
|
19
18
|
* Two primitives, because overlapping the loop exposes exactly one shared
|
|
20
19
|
* resource: Node's `require.cache`.
|
|
21
20
|
*/
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.RUNNER_SPAWN_CONCURRENCY = void 0;
|
|
24
|
-
exports.spawnPlanConcurrently = spawnPlanConcurrently;
|
|
25
|
-
exports.createKeyedSerializer = createKeyedSerializer;
|
|
26
21
|
/**
|
|
27
22
|
* Concurrent runner spawns during boot.
|
|
28
23
|
*
|
|
@@ -33,7 +28,7 @@ exports.createKeyedSerializer = createKeyedSerializer;
|
|
|
33
28
|
* fork syscalls overlapped while never leaving more than eight bundles being
|
|
34
29
|
* parsed at once.
|
|
35
30
|
*/
|
|
36
|
-
|
|
31
|
+
export const RUNNER_SPAWN_CONCURRENCY = 8;
|
|
37
32
|
/**
|
|
38
33
|
* Run `spawnOne` over every plan entry with at most `concurrency` in flight.
|
|
39
34
|
*
|
|
@@ -42,7 +37,7 @@ exports.RUNNER_SPAWN_CONCURRENCY = 8;
|
|
|
42
37
|
* the next index until the queue is drained. `spawnOne` owns its own failure
|
|
43
38
|
* handling; a unit that settles (however it settles) frees its lane.
|
|
44
39
|
*/
|
|
45
|
-
async function spawnPlanConcurrently(plan, spawnOne, concurrency =
|
|
40
|
+
export async function spawnPlanConcurrently(plan, spawnOne, concurrency = RUNNER_SPAWN_CONCURRENCY) {
|
|
46
41
|
const queue = [...plan.entries()];
|
|
47
42
|
if (queue.length === 0)
|
|
48
43
|
return;
|
|
@@ -76,7 +71,7 @@ async function spawnPlanConcurrently(plan, spawnOne, concurrency = exports.RUNNE
|
|
|
76
71
|
* Keyed by the purge scope, so the bound above still applies across packages
|
|
77
72
|
* and only true siblings queue behind each other.
|
|
78
73
|
*/
|
|
79
|
-
function createKeyedSerializer() {
|
|
74
|
+
export function createKeyedSerializer() {
|
|
80
75
|
const chains = new Map();
|
|
81
76
|
return {
|
|
82
77
|
run(key, work) {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wireSettingsDoor = wireSettingsDoor;
|
|
4
1
|
/**
|
|
5
2
|
* Wiring the async `settings-store` door into `ConfigService` — and replaying
|
|
6
3
|
* the operator's persisted capability preferences once its boot read settles
|
|
@@ -13,13 +10,13 @@ exports.wireSettingsDoor = wireSettingsDoor;
|
|
|
13
10
|
* it. No timer, no retry (D3). A failed read is logged at error and leaves
|
|
14
11
|
* every preference UNKNOWN until the next boot.
|
|
15
12
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { isInfraCapability } from '@camstack/system';
|
|
14
|
+
import { errMsg } from '@camstack/types';
|
|
18
15
|
/**
|
|
19
16
|
* Wire `door` and schedule the one preference replay. Returns the replay's
|
|
20
17
|
* promise (it never rejects) so a caller — or a spec — can await it.
|
|
21
18
|
*/
|
|
22
|
-
function wireSettingsDoor(deps, door) {
|
|
19
|
+
export function wireSettingsDoor(deps, door) {
|
|
23
20
|
deps.configService.setSettingsDoor(door);
|
|
24
21
|
const preload = deps.configService.whenSystemSettingsPreloaded();
|
|
25
22
|
if (preload === null)
|
|
@@ -30,7 +27,7 @@ function wireSettingsDoor(deps, door) {
|
|
|
30
27
|
deps.logger.error('capability preferences could not be read at boot — every persisted preference is UNKNOWN until the next boot, and the defaults apply', { meta: { error: result.error } });
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
|
-
const replay = deps.registry.applyPersistedPreferences((capability) =>
|
|
30
|
+
const replay = deps.registry.applyPersistedPreferences((capability) => isInfraCapability(capability));
|
|
34
31
|
deps.logger.info('capability preferences loaded from the settings store', {
|
|
35
32
|
meta: {
|
|
36
33
|
keyCount: result.keyCount,
|
|
@@ -40,6 +37,6 @@ function wireSettingsDoor(deps, door) {
|
|
|
40
37
|
});
|
|
41
38
|
})
|
|
42
39
|
.catch((err) => {
|
|
43
|
-
deps.logger.error('capability preference replay failed', { meta: { error:
|
|
40
|
+
deps.logger.error('capability preference replay failed', { meta: { error: errMsg(err) } });
|
|
44
41
|
});
|
|
45
42
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSingleFlightRefresh = createSingleFlightRefresh;
|
|
4
1
|
/** Union of two scopes. `null` (everything) absorbs. */
|
|
5
2
|
function widenScope(a, b) {
|
|
6
3
|
if (a === null || b === null)
|
|
@@ -14,7 +11,7 @@ function widenScope(a, b) {
|
|
|
14
11
|
* @param run the rebuild, given the scope it must cover. Never called
|
|
15
12
|
* concurrently with itself, and never called with an empty set.
|
|
16
13
|
*/
|
|
17
|
-
function createSingleFlightRefresh(run) {
|
|
14
|
+
export function createSingleFlightRefresh(run) {
|
|
18
15
|
let inFlight = null;
|
|
19
16
|
// The union of everything requested while a run is active — `undefined` when
|
|
20
17
|
// nothing is pending. One accumulator, not a queue: N requests during one run
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.AddonBridgeService = void 0;
|
|
37
|
-
const path = __importStar(require("node:path"));
|
|
38
|
-
const types_1 = require("@camstack/types");
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { errMsg } from '@camstack/types';
|
|
39
3
|
/**
|
|
40
4
|
* AddonBridgeService — slim package-management surface.
|
|
41
5
|
*
|
|
@@ -56,7 +20,7 @@ const types_1 = require("@camstack/types");
|
|
|
56
20
|
* set read like the uninstall guard and was not; uninstall is the `addons`
|
|
57
21
|
* cap's (`core/addon/addon-uninstall.ts`).
|
|
58
22
|
*/
|
|
59
|
-
class AddonBridgeService {
|
|
23
|
+
export class AddonBridgeService {
|
|
60
24
|
loggingService;
|
|
61
25
|
logger;
|
|
62
26
|
loader;
|
|
@@ -80,14 +44,14 @@ class AddonBridgeService {
|
|
|
80
44
|
kernel.ensureDir(addonsDir);
|
|
81
45
|
}
|
|
82
46
|
catch (error) {
|
|
83
|
-
const msg =
|
|
47
|
+
const msg = errMsg(error);
|
|
84
48
|
this.logger.warn('Installer init failed', { meta: { error: msg } });
|
|
85
49
|
}
|
|
86
50
|
}
|
|
87
51
|
async onModuleInit() {
|
|
88
52
|
this.logger.info('Initializing addon bridge (package management only)...');
|
|
89
53
|
try {
|
|
90
|
-
const kernel = await
|
|
54
|
+
const kernel = await import('@camstack/system');
|
|
91
55
|
this.loader = new kernel.AddonLoader(this.logger.child('AddonLoader'));
|
|
92
56
|
const dataDir = process.env.CAMSTACK_DATA ?? 'camstack-data';
|
|
93
57
|
const addonsDir = process.env.CAMSTACK_ADDONS_DIR ?? path.resolve(dataDir, 'addons');
|
|
@@ -98,7 +62,7 @@ class AddonBridgeService {
|
|
|
98
62
|
});
|
|
99
63
|
}
|
|
100
64
|
catch (error) {
|
|
101
|
-
const msg =
|
|
65
|
+
const msg = errMsg(error);
|
|
102
66
|
this.logger.warn('Addon bridge loader failed — install/uninstall still available', {
|
|
103
67
|
meta: { error: msg },
|
|
104
68
|
});
|
|
@@ -134,7 +98,7 @@ class AddonBridgeService {
|
|
|
134
98
|
this.logger.warn('reloadPackages called but bridge is unavailable — skipping');
|
|
135
99
|
return;
|
|
136
100
|
}
|
|
137
|
-
const kernel = await
|
|
101
|
+
const kernel = await import('@camstack/system');
|
|
138
102
|
this.loader = new kernel.AddonLoader(this.logger.child('AddonLoader'));
|
|
139
103
|
const dataDir = process.env.CAMSTACK_DATA ?? 'camstack-data';
|
|
140
104
|
const addonsDir = process.env.CAMSTACK_ADDONS_DIR ?? path.resolve(dataDir, 'addons');
|
|
@@ -142,4 +106,3 @@ class AddonBridgeService {
|
|
|
142
106
|
this.logger.info('Reloaded', { meta: { count: this.loader.listAddons().length } });
|
|
143
107
|
}
|
|
144
108
|
}
|
|
145
|
-
exports.AddonBridgeService = AddonBridgeService;
|