@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
package/dist/launcher.js
CHANGED
|
@@ -1,38 +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
1
|
/**
|
|
37
2
|
* Launcher -- entry point that ensures required addons are installed
|
|
38
3
|
* before main.ts loads. This solves the chicken-and-egg problem:
|
|
@@ -51,18 +16,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
51
16
|
* framework dir + NODE_PATH are set up. Framework/cap updates ship via the
|
|
52
17
|
* node-root `applyServerUpdate` flow, not an in-launcher package swap.
|
|
53
18
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
19
|
+
import * as fs from 'node:fs';
|
|
20
|
+
import * as os from 'node:os';
|
|
21
|
+
import * as path from 'node:path';
|
|
22
|
+
import * as yaml from 'js-yaml';
|
|
23
|
+
import { formatAddonRootReport, inventoryAddonRoots } from './addon-root-inventory.js';
|
|
24
|
+
import { selectHubBootstrapPackages } from './bootstrap-packages.js';
|
|
25
|
+
import { formatFirstBootPlan, planFirstBootAddons } from './first-boot-addon-plan.js';
|
|
26
|
+
import { planAddonRealignment } from './core/addon/addon-realign-plan.js';
|
|
27
|
+
import { resolveClosureNodeModules } from './closure-node-modules.js';
|
|
28
|
+
import { frameworkNodePaths } from './framework-nodepath.js';
|
|
29
|
+
import { formatInventoryReport, formatShadowingNotes, hostProvidedSearchRoots, inventoryHostProvided, seedNodeModulesRoots, } from './package-inventory.js';
|
|
30
|
+
import { applyPendingRestore } from './pending-restore.js';
|
|
66
31
|
/** Resolve the data directory from env or default */
|
|
67
32
|
const DATA_DIR = process.env['CAMSTACK_DATA'] ?? 'camstack-data';
|
|
68
33
|
/** Narrow `CAMSTACK_INSTALL_SOURCE` env into the typed union. */
|
|
@@ -134,7 +99,7 @@ function readBootstrapInstallSource(dataDir, bootstrapSchema) {
|
|
|
134
99
|
*/
|
|
135
100
|
function deriveBootstrapFromSelf() {
|
|
136
101
|
const pkg = readOwnManifest();
|
|
137
|
-
return pkg === null ? [] :
|
|
102
|
+
return pkg === null ? [] : selectHubBootstrapPackages(pkg);
|
|
138
103
|
}
|
|
139
104
|
/**
|
|
140
105
|
* THIS server closure's own `package.json` — the roster's source and, when
|
|
@@ -219,7 +184,7 @@ async function launch() {
|
|
|
219
184
|
// `node-role.ts` imports no @camstack/* itself. The role selects both the
|
|
220
185
|
// bootstrap package set (hub → all addons; agent → AGENT_PACKAGES) and,
|
|
221
186
|
// at the very end of launch(), which runtime entry is loaded.
|
|
222
|
-
const { resolveNodeRole } = await
|
|
187
|
+
const { resolveNodeRole } = await import('./node-role.js');
|
|
223
188
|
const role = resolveNodeRole(process.env);
|
|
224
189
|
console.log(`[launcher] Node role: ${role}`);
|
|
225
190
|
// Addons live in a real `node_modules`-shaped dir so ESM `import` resolves
|
|
@@ -245,11 +210,11 @@ async function launch() {
|
|
|
245
210
|
// Restore must happen first so the snapshot's `addons/` is what the
|
|
246
211
|
// installer + symlink step pick up — otherwise we'd install a stale
|
|
247
212
|
// set and overwrite it a step later.
|
|
248
|
-
await
|
|
213
|
+
await applyPendingRestore(dataDir, (line) => console.log(line));
|
|
249
214
|
// @camstack/system is imported DYNAMICALLY here — AFTER the active framework
|
|
250
215
|
// dir + NODE_PATH are resolved above — so the correct framework copy is what
|
|
251
216
|
// gets loaded. Never import it at module top.
|
|
252
|
-
const { AddonInstaller, bootstrapSchema, detectWorkspacePackagesDir, quarantineAddonResidue } = await
|
|
217
|
+
const { AddonInstaller, bootstrapSchema, detectWorkspacePackagesDir, quarantineAddonResidue } = await import('@camstack/system');
|
|
253
218
|
// Residue quarantine — FIRST thing that touches the addon root, before the
|
|
254
219
|
// bootstrap seed writes into it and long before any loader scans it.
|
|
255
220
|
//
|
|
@@ -351,8 +316,8 @@ async function launch() {
|
|
|
351
316
|
//
|
|
352
317
|
// Diagnostics, so it can never end a boot: same policy as the inventories.
|
|
353
318
|
try {
|
|
354
|
-
const closureNodeModules =
|
|
355
|
-
const plan =
|
|
319
|
+
const closureNodeModules = resolveClosureNodeModules(__dirname);
|
|
320
|
+
const plan = planFirstBootAddons({
|
|
356
321
|
required: bootstrapRequired,
|
|
357
322
|
installed: readInstalledAddonVersions(addonsDir, bootstrapRequired),
|
|
358
323
|
closureVersions: readInstalledAddonVersions(closureNodeModules, bootstrapRequired),
|
|
@@ -368,7 +333,7 @@ async function launch() {
|
|
|
368
333
|
}
|
|
369
334
|
})(),
|
|
370
335
|
});
|
|
371
|
-
for (const line of
|
|
336
|
+
for (const line of formatFirstBootPlan(plan, 'observe')) {
|
|
372
337
|
console.log(`[launcher] ${line}`);
|
|
373
338
|
}
|
|
374
339
|
}
|
|
@@ -390,8 +355,8 @@ async function launch() {
|
|
|
390
355
|
// re-alignment that throws must never end a boot. An addon that stays behind
|
|
391
356
|
// is the status quo; a node that will not start is not.
|
|
392
357
|
try {
|
|
393
|
-
const closureNodeModules =
|
|
394
|
-
const decisions =
|
|
358
|
+
const closureNodeModules = resolveClosureNodeModules(__dirname);
|
|
359
|
+
const decisions = planAddonRealignment(bootstrapRequired.flatMap((pkg) => {
|
|
395
360
|
const installedVersion = readInstalledAddonVersions(addonsDir, [pkg])[pkg];
|
|
396
361
|
if (typeof installedVersion !== 'string')
|
|
397
362
|
return [];
|
|
@@ -509,7 +474,7 @@ async function launch() {
|
|
|
509
474
|
// etc); the server-local node_modules has direct deps. Listing
|
|
510
475
|
// both covers every realistic resolution.
|
|
511
476
|
const workspaceRootNodeModules = path.resolve(serverDir, '..', '..', 'node_modules');
|
|
512
|
-
const frameworkPaths =
|
|
477
|
+
const frameworkPaths = frameworkNodePaths(process.env['CAMSTACK_FRAMEWORK_DIR'], fs.existsSync);
|
|
513
478
|
const extraNodePaths = [...frameworkPaths, nodeModulesDir, workspaceRootNodeModules].filter((p) => fs.existsSync(p));
|
|
514
479
|
if (frameworkPaths.length > 0) {
|
|
515
480
|
console.log(`[launcher] Framework dir on NODE_PATH: ${frameworkPaths[0]}`);
|
|
@@ -572,13 +537,13 @@ async function launch() {
|
|
|
572
537
|
//
|
|
573
538
|
// [inventory-diagnostics-begin] enforced by scripts/check-inventory-never-fatal.ts
|
|
574
539
|
try {
|
|
575
|
-
const inventory =
|
|
540
|
+
const inventory = inventoryHostProvided(hostProvidedSearchRoots({
|
|
576
541
|
nodePath: process.env['NODE_PATH'],
|
|
577
542
|
pathSeparator: process.platform === 'win32' ? ';' : ':',
|
|
578
543
|
dataDir: DATA_DIR,
|
|
579
544
|
serverNodeModules: nodeModulesDir,
|
|
580
545
|
frameworkRoots: frameworkPaths,
|
|
581
|
-
seedRoots:
|
|
546
|
+
seedRoots: seedNodeModulesRoots(fs),
|
|
582
547
|
}), {
|
|
583
548
|
exists: (dir) => fs.existsSync(path.join(dir, 'package.json')),
|
|
584
549
|
readVersion: (dir) => {
|
|
@@ -602,10 +567,10 @@ async function launch() {
|
|
|
602
567
|
}
|
|
603
568
|
},
|
|
604
569
|
});
|
|
605
|
-
for (const note of
|
|
570
|
+
for (const note of formatShadowingNotes(inventory)) {
|
|
606
571
|
console.log(`[launcher] ${note}`);
|
|
607
572
|
}
|
|
608
|
-
const report =
|
|
573
|
+
const report = formatInventoryReport(inventory);
|
|
609
574
|
if (report !== '') {
|
|
610
575
|
console.error(`[launcher] ${report}`);
|
|
611
576
|
}
|
|
@@ -629,7 +594,7 @@ async function launch() {
|
|
|
629
594
|
// no flag changes it. Making the second location LOUD is the whole job;
|
|
630
595
|
// removing it stays an operator decision.
|
|
631
596
|
try {
|
|
632
|
-
const addonRoots =
|
|
597
|
+
const addonRoots = inventoryAddonRoots({
|
|
633
598
|
dataDir: DATA_DIR,
|
|
634
599
|
activeAddonsDir: addonsDir,
|
|
635
600
|
homeDir: os.homedir(),
|
|
@@ -668,7 +633,7 @@ async function launch() {
|
|
|
668
633
|
}
|
|
669
634
|
},
|
|
670
635
|
});
|
|
671
|
-
const addonRootReport =
|
|
636
|
+
const addonRootReport = formatAddonRootReport(addonRoots);
|
|
672
637
|
if (addonRootReport !== '') {
|
|
673
638
|
console.error(`[launcher] ${addonRootReport}`);
|
|
674
639
|
}
|
|
@@ -683,12 +648,12 @@ async function launch() {
|
|
|
683
648
|
// no separate agent root package.
|
|
684
649
|
if (role === 'agent') {
|
|
685
650
|
console.log('[launcher] Starting agent runtime...');
|
|
686
|
-
const { startAgent } = await
|
|
651
|
+
const { startAgent } = await import('./agent/main.js');
|
|
687
652
|
await startAgent();
|
|
688
653
|
}
|
|
689
654
|
else {
|
|
690
655
|
console.log('[launcher] Starting server...');
|
|
691
|
-
await
|
|
656
|
+
await import('./main');
|
|
692
657
|
}
|
|
693
658
|
// The role runtime has installed its own SIGTERM/SIGINT handlers now. Stop
|
|
694
659
|
// intercepting those signals here: calling process.exit() first prevented the
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
|
|
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.lifecycleJobsDir = lifecycleJobsDir;
|
|
37
|
-
const path = __importStar(require("node:path"));
|
|
1
|
+
import * as path from 'node:path';
|
|
38
2
|
/** Single source of truth for the lifecycle job journal directory. */
|
|
39
|
-
function lifecycleJobsDir(dataDir) {
|
|
3
|
+
export function lifecycleJobsDir(dataDir) {
|
|
40
4
|
return path.join(dataDir, 'lifecycle', 'jobs');
|
|
41
5
|
}
|