@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.
Files changed (255) hide show
  1. package/dist/addon-root-inventory.js +50 -11
  2. package/dist/agent/addon-scan.js +44 -6
  3. package/dist/agent/agent-addon-runtime.js +8 -3
  4. package/dist/agent/agent-addon-updates.js +52 -12
  5. package/dist/agent/agent-cap-dispatch-service.js +5 -3
  6. package/dist/agent/agent-config.js +42 -7
  7. package/dist/agent/agent-deploy-swap.js +41 -5
  8. package/dist/agent/agent-group-runner.js +47 -8
  9. package/dist/agent/agent-http-auth.js +22 -10
  10. package/dist/agent/agent-http.js +113 -64
  11. package/dist/agent/agent-hub-addon-update.js +16 -10
  12. package/dist/agent/agent-hub-registration.js +7 -4
  13. package/dist/agent/agent-infra-capabilities.js +9 -5
  14. package/dist/agent/agent-json-file.js +42 -5
  15. package/dist/agent/agent-mesh-gate.js +8 -5
  16. package/dist/agent/agent-node-certificates.js +28 -25
  17. package/dist/agent/agent-pairing-local.js +47 -10
  18. package/dist/agent/agent-pairing-routes.js +20 -16
  19. package/dist/agent/agent-pairing-store.js +58 -18
  20. package/dist/agent/agent-reconnect.js +4 -1
  21. package/dist/agent/agent-service.js +71 -35
  22. package/dist/agent/agent-sniffing-listener.js +48 -11
  23. package/dist/agent/agent-undeploy.js +41 -5
  24. package/dist/agent/agent-update-routes.js +19 -14
  25. package/dist/agent/agent-update-service.js +80 -38
  26. package/dist/agent/apply-model-distribution.js +4 -1
  27. package/dist/agent/apply-stage-dev-uploads.js +9 -6
  28. package/dist/agent/derive-hub-url.js +8 -3
  29. package/dist/agent/fetch-bundle-from-hub.js +9 -6
  30. package/dist/agent/hubs-found.js +43 -6
  31. package/dist/agent/infra-boot-guard.js +4 -1
  32. package/dist/agent/infra-boot-plan.js +6 -2
  33. package/dist/agent/main.js +183 -148
  34. package/dist/agent/register-agent-cap-dispatch.js +6 -3
  35. package/dist/agent/serial-queue.js +7 -2
  36. package/dist/agent-status-page.js +4 -1
  37. package/dist/api/addon-upload.js +61 -22
  38. package/dist/api/agent-addon-delivery.js +11 -6
  39. package/dist/api/auth-whoami.js +4 -1
  40. package/dist/api/backup-download-pump.js +9 -5
  41. package/dist/api/backup-download.js +10 -7
  42. package/dist/api/core/addon-settings.router.js +19 -16
  43. package/dist/api/core/agent-pairing.router.js +79 -76
  44. package/dist/api/core/agents.router.js +24 -21
  45. package/dist/api/core/auth-admin-tokens.procedures.js +52 -48
  46. package/dist/api/core/auth-device-cert.procedures.js +67 -62
  47. package/dist/api/core/auth-limits.js +25 -16
  48. package/dist/api/core/auth-reauth.procedures.js +37 -32
  49. package/dist/api/core/auth-revoke-credentials.procedures.js +26 -22
  50. package/dist/api/core/auth-sessions.procedures.js +56 -52
  51. package/dist/api/core/auth.router.js +304 -300
  52. package/dist/api/core/cap-providers.js +121 -74
  53. package/dist/api/core/capabilities.router.js +37 -34
  54. package/dist/api/core/capability-preference-writes.js +17 -10
  55. package/dist/api/core/certificates.router.js +109 -106
  56. package/dist/api/core/cluster-nodes.router.js +18 -15
  57. package/dist/api/core/collection-preference.js +6 -2
  58. package/dist/api/core/event-bus-proxy.router.js +37 -34
  59. package/dist/api/core/failure-contributions.js +8 -4
  60. package/dist/api/core/hwaccel.router.js +20 -17
  61. package/dist/api/core/integration-secrets.js +12 -8
  62. package/dist/api/core/lifecycle-job-runner.js +49 -13
  63. package/dist/api/core/live-events.router.js +32 -29
  64. package/dist/api/core/load-contributions.js +8 -4
  65. package/dist/api/core/logging-settings.js +43 -30
  66. package/dist/api/core/logs.router.js +43 -40
  67. package/dist/api/core/notifications.router.js +18 -15
  68. package/dist/api/core/public-event-filter.js +8 -4
  69. package/dist/api/core/repl.router.js +21 -18
  70. package/dist/api/core/request-census-settings.js +16 -11
  71. package/dist/api/core/server-management.provider.js +4 -1
  72. package/dist/api/core/server-name.js +17 -9
  73. package/dist/api/core/site-location.js +24 -16
  74. package/dist/api/core/stream-probe.router.js +24 -21
  75. package/dist/api/core/system-events.router.js +26 -23
  76. package/dist/api/cors/cors-policy.js +29 -20
  77. package/dist/api/cors/register-cors-policy.js +14 -9
  78. package/dist/api/deploy-stage-registry.js +10 -6
  79. package/dist/api/dev-uploads-bundle.js +50 -12
  80. package/dist/api/health/adaptive-probe.routes.js +13 -9
  81. package/dist/api/health/health.routes.js +13 -8
  82. package/dist/api/hub-cluster-url.js +9 -3
  83. package/dist/api/model-distributor.js +50 -12
  84. package/dist/api/oauth2/consent-page.js +13 -10
  85. package/dist/api/oauth2/oauth2-routes.js +25 -17
  86. package/dist/api/oauth2/private-host.js +4 -1
  87. package/dist/api/server-upload-propagate.js +51 -15
  88. package/dist/api/server-upload.js +50 -13
  89. package/dist/api/sse-no-compression.js +4 -1
  90. package/dist/api/static/frame-policy.js +9 -4
  91. package/dist/api/static/precompressed-asset.js +57 -15
  92. package/dist/api/static/spa-mount.js +47 -8
  93. package/dist/api/static/spa-static.js +12 -5
  94. package/dist/api/tarball-manifest.js +44 -7
  95. package/dist/api/trpc/cap-mount-helpers.js +12 -7
  96. package/dist/api/trpc/cap-route-error-formatter.js +13 -10
  97. package/dist/api/trpc/cap-router-runtime.js +51 -40
  98. package/dist/api/trpc/client-ip.js +20 -9
  99. package/dist/api/trpc/core-cap-bridge.js +42 -32
  100. package/dist/api/trpc/device-collection-dispatch.js +27 -23
  101. package/dist/api/trpc/device-config-secret-redaction.js +40 -24
  102. package/dist/api/trpc/generated-cap-mounts.js +225 -219
  103. package/dist/api/trpc/generated-cap-routers.js +5167 -4852
  104. package/dist/api/trpc/http-request-census-hook.js +11 -8
  105. package/dist/api/trpc/http-request-census.js +41 -34
  106. package/dist/api/trpc/http-request-census.singleton.js +8 -4
  107. package/dist/api/trpc/localized-schema-paths.js +4 -1
  108. package/dist/api/trpc/principal-visibility.js +22 -14
  109. package/dist/api/trpc/remote-addon-update-grant.js +4 -1
  110. package/dist/api/trpc/scope-access.js +15 -10
  111. package/dist/api/trpc/server-provided-caps.js +7 -3
  112. package/dist/api/trpc/share-view-access.js +14 -6
  113. package/dist/api/trpc/trpc-error-device-tags.js +6 -3
  114. package/dist/api/trpc/trpc-error-principal.js +6 -2
  115. package/dist/api/trpc/trpc.context.js +25 -20
  116. package/dist/api/trpc/trpc.middleware.js +46 -38
  117. package/dist/api/trpc/trpc.router.js +99 -58
  118. package/dist/api/trpc/user-error.js +8 -5
  119. package/dist/api/trpc/ws-request-census.js +24 -17
  120. package/dist/api/trpc/ws-slow-consumer-guard.js +16 -11
  121. package/dist/api/upload-auth.js +9 -5
  122. package/dist/auth/addon-route-jwt-gate.js +7 -4
  123. package/dist/auth/addon-route-share-gate.js +12 -7
  124. package/dist/auth/app-confirm-page.js +22 -17
  125. package/dist/auth/app-confirm-routes.js +31 -26
  126. package/dist/auth/app-confirmations.js +44 -7
  127. package/dist/auth/app-page-shell.js +30 -17
  128. package/dist/auth/app-page-strings.js +17 -11
  129. package/dist/auth/app-passkey-page.js +21 -16
  130. package/dist/auth/app-passkey-routes.js +41 -37
  131. package/dist/auth/app-refused-route.js +18 -13
  132. package/dist/auth/auth-network-policy.js +15 -11
  133. package/dist/auth/auth-provider-gate.js +9 -4
  134. package/dist/auth/auth-rate-limit.js +7 -3
  135. package/dist/auth/client-address.js +9 -6
  136. package/dist/auth/device-enroll-proofs.js +43 -6
  137. package/dist/auth/external-link-intents.js +7 -3
  138. package/dist/auth/hub-sessions.js +12 -6
  139. package/dist/auth/native-link-completions.js +11 -7
  140. package/dist/auth/native-return.js +13 -9
  141. package/dist/auth/passkey-provider.js +32 -26
  142. package/dist/auth/second-factors.js +10 -6
  143. package/dist/auth/session-connections.js +12 -6
  144. package/dist/auth/session-cookie.js +23 -12
  145. package/dist/auth/session-lifetimes.js +12 -8
  146. package/dist/auth/session-mint.js +11 -4
  147. package/dist/auth/sso-finish-app.js +16 -13
  148. package/dist/auth/sso-finish-deps.js +27 -21
  149. package/dist/auth/sso-finish.js +38 -28
  150. package/dist/auth/sso-routes.js +25 -22
  151. package/dist/auth/used-bridge-ids.js +5 -1
  152. package/dist/boot/boot-config.js +55 -16
  153. package/dist/boot/init-sequence.js +4 -1
  154. package/dist/boot/integration-id-backfill.js +8 -3
  155. package/dist/boot/platform-keychain-key.js +42 -5
  156. package/dist/boot/post-boot.service.js +18 -14
  157. package/dist/boot/reconcile-lifecycle-jobs.js +6 -3
  158. package/dist/boot/retired-public-url-env.js +8 -4
  159. package/dist/bootstrap-packages.js +4 -1
  160. package/dist/closure-node-modules.js +38 -2
  161. package/dist/core/addon/addon-call-gateway.js +5 -1
  162. package/dist/core/addon/addon-package.service.js +123 -83
  163. package/dist/core/addon/addon-process-view.js +6 -2
  164. package/dist/core/addon/addon-realign-plan.js +4 -1
  165. package/dist/core/addon/addon-registry.service.js +187 -146
  166. package/dist/core/addon/addon-row-manifest.js +4 -1
  167. package/dist/core/addon/addon-search.service.js +7 -3
  168. package/dist/core/addon/addon-settings-provider.js +3 -1
  169. package/dist/core/addon/addon-uninstall.js +11 -4
  170. package/dist/core/addon/addon.tokens.js +5 -2
  171. package/dist/core/addon/device-meta-mirror.js +13 -8
  172. package/dist/core/addon/forked-custom-actions.js +11 -6
  173. package/dist/core/addon/integration-visibility.js +6 -3
  174. package/dist/core/addon/materialize-route-path.js +4 -1
  175. package/dist/core/addon/package-dir-utils.js +45 -8
  176. package/dist/core/addon/prune-misplaced-addons.js +43 -5
  177. package/dist/core/addon/runner-convergence.js +4 -1
  178. package/dist/core/addon/runner-serialization.js +4 -1
  179. package/dist/core/addon/runner-spawn-fanout.js +8 -3
  180. package/dist/core/addon/settings-door-wiring.js +8 -5
  181. package/dist/core/addon/single-flight-refresh.js +4 -1
  182. package/dist/core/addon-bridge/addon-bridge.service.js +44 -7
  183. package/dist/core/addon-pages/addon-pages.service.js +40 -3
  184. package/dist/core/addon-widgets/addon-widgets.service.js +42 -4
  185. package/dist/core/agent/agent-addon-backfill.js +17 -9
  186. package/dist/core/agent/agent-delivery-ledger.js +7 -3
  187. package/dist/core/agent/agent-liveness-event.js +6 -2
  188. package/dist/core/agent/agent-pairing-http.js +45 -41
  189. package/dist/core/agent/agent-registry.service.js +89 -50
  190. package/dist/core/agent/cluster-node-history-mirror.js +7 -3
  191. package/dist/core/agent/cluster-node-history-store.js +35 -31
  192. package/dist/core/agent/hub-agent-pairing.js +5 -1
  193. package/dist/core/agent/node-certificates-client.js +6 -3
  194. package/dist/core/agent/node-directory.js +4 -1
  195. package/dist/core/app-links/well-known-app-links.js +6 -2
  196. package/dist/core/auth/auth.service.js +8 -3
  197. package/dist/core/auth/handoff-code.service.js +49 -11
  198. package/dist/core/auth/record-kinds.js +19 -16
  199. package/dist/core/auth/share-token.service.js +79 -42
  200. package/dist/core/capability/capability.service.js +5 -1
  201. package/dist/core/config/config.schema.js +6 -1
  202. package/dist/core/config/config.service.js +6 -2
  203. package/dist/core/events/event-bus.service.js +7 -3
  204. package/dist/core/feature/feature.service.js +6 -2
  205. package/dist/core/lifecycle/lifecycle-runner.singleton.js +10 -5
  206. package/dist/core/lifecycle/lifecycle-state-machine.js +5 -1
  207. package/dist/core/logging/log-ring-buffer.js +5 -1
  208. package/dist/core/logging/logging.service.js +9 -5
  209. package/dist/core/logging/scoped-logger.js +5 -1
  210. package/dist/core/moleculer/agent-readiness-pull.js +4 -1
  211. package/dist/core/moleculer/agent-registration-request.js +7 -3
  212. package/dist/core/moleculer/cap-call-fn.js +7 -4
  213. package/dist/core/moleculer/cap-route-authority.js +8 -3
  214. package/dist/core/moleculer/hub-mesh-guard.js +9 -5
  215. package/dist/core/moleculer/moleculer.service.js +86 -79
  216. package/dist/core/network/network-quality.service.js +6 -2
  217. package/dist/core/notification/notification-wrapper.service.js +7 -3
  218. package/dist/core/notification/toast-wrapper.service.js +7 -3
  219. package/dist/core/provider/provider.tokens.js +4 -1
  220. package/dist/core/repl/repl-engine.service.js +8 -4
  221. package/dist/core/runner-health/runner-boot-check.js +15 -7
  222. package/dist/core/runner-health/update-preflight.js +14 -9
  223. package/dist/core/server-update/server-update.service.js +49 -12
  224. package/dist/core/server-update/system-apply-closure-patches.js +42 -6
  225. package/dist/core/server-update/system-ensure-prebuilds.js +6 -3
  226. package/dist/core/server-update/system-exec-npm.js +5 -2
  227. package/dist/core/storage/fs-storage-backend.js +5 -1
  228. package/dist/core/storage/storage-location-manager.js +5 -1
  229. package/dist/core/storage/storage.service.js +6 -2
  230. package/dist/core/streaming/ffmpeg-stream-info.js +8 -3
  231. package/dist/core/streaming/stream-probe.service.js +16 -12
  232. package/dist/core/streaming/ttl-cache.js +5 -1
  233. package/dist/core/topology/topology-emitter.service.js +23 -19
  234. package/dist/core/update-availability-emitter.js +7 -3
  235. package/dist/core/update-availability-store.js +45 -8
  236. package/dist/core/updates/agent-installed-packages.js +9 -5
  237. package/dist/core/updates/restart-marker.js +8 -3
  238. package/dist/core/updates/update-check-scheduler.js +18 -13
  239. package/dist/core/updates/wrapper-update-checker.js +7 -3
  240. package/dist/first-boot-addon-plan.js +6 -2
  241. package/dist/framework-nodepath.js +38 -2
  242. package/dist/i18n/request-lang.js +11 -7
  243. package/dist/launcher.js +65 -30
  244. package/dist/lifecycle-journal-path.js +38 -2
  245. package/dist/main.js +324 -286
  246. package/dist/manual-boot.js +156 -117
  247. package/dist/node-role.js +4 -1
  248. package/dist/package-inventory.js +48 -7
  249. package/dist/pending-restore.js +43 -7
  250. package/dist/single-copy-cleanup-runner.js +45 -9
  251. package/dist/single-copy-cleanup.js +15 -7
  252. package/dist/sqlite-restore.js +48 -9
  253. package/dist/starter.js +39 -4
  254. package/dist/ui-serving/lazy-ui-serving.js +39 -3
  255. package/package.json +7 -7
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * One-time integration-id backfill for devices created before the
3
4
  * device-manager forwarder started stamping `integrationId` (camera
@@ -6,7 +7,11 @@
6
7
  * Multi-instance addons (e.g. Home Assistant with several brokers) are
7
8
  * ambiguous on `addonId` alone and are skipped — they stamp going forward.
8
9
  */
9
- export function planIntegrationIdBackfill(integrations, devices) {
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.planIntegrationIdBackfill = planIntegrationIdBackfill;
12
+ exports.planDeleteTimeStamps = planDeleteTimeStamps;
13
+ exports.runIntegrationIdBackfill = runIntegrationIdBackfill;
14
+ function planIntegrationIdBackfill(integrations, devices) {
10
15
  const singleByAddon = new Map();
11
16
  const ambiguous = new Set();
12
17
  for (const integration of integrations) {
@@ -45,10 +50,10 @@ export function planIntegrationIdBackfill(integrations, devices) {
45
50
  * rule (only addons hosting exactly ONE integration are unambiguous) and
46
51
  * filters to the integration being deleted so siblings are never touched.
47
52
  */
48
- export function planDeleteTimeStamps(integrationId, integrations, devices) {
53
+ function planDeleteTimeStamps(integrationId, integrations, devices) {
49
54
  return planIntegrationIdBackfill(integrations, devices).filter((stamp) => stamp.integrationId === integrationId);
50
55
  }
51
- export async function runIntegrationIdBackfill(deps) {
56
+ async function runIntegrationIdBackfill(deps) {
52
57
  const [integrations, devices] = await Promise.all([deps.listIntegrations(), deps.listDevices()]);
53
58
  const stamps = planIntegrationIdBackfill(integrations, devices);
54
59
  let stamped = 0;
@@ -1,3 +1,40 @@
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.keychainKeyFdFromArgv = keychainKeyFdFromArgv;
37
+ exports.loadPlatformKeychainKey = loadPlatformKeychainKey;
1
38
  /**
2
39
  * Read the keychain master key a DESKTOP app handed this hub over an inherited
3
40
  * pipe (D788): `--keychain-key-fd=<n>` names the descriptor, the parent wrote
@@ -8,8 +45,8 @@
8
45
  * An env var was rejected: a child's environment is readable by every process
9
46
  * of the same user and is inherited by every addon runner the hub forks.
10
47
  */
11
- import * as fs from 'node:fs';
12
- import { setPlatformKeychainKey } from '@camstack/system';
48
+ const fs = __importStar(require("node:fs"));
49
+ const system_1 = require("@camstack/system");
13
50
  const FD_ARG = '--keychain-key-fd=';
14
51
  const KEY_BYTES = 32;
15
52
  /** The OS keychain's name, for the Secrets page. */
@@ -24,14 +61,14 @@ function platformLabel(platform) {
24
61
  }
25
62
  }
26
63
  /** Parse the descriptor number out of argv; `null` when not passed. */
27
- export function keychainKeyFdFromArgv(argv) {
64
+ function keychainKeyFdFromArgv(argv) {
28
65
  const arg = argv.find((a) => a.startsWith(FD_ARG));
29
66
  if (arg === undefined)
30
67
  return null;
31
68
  const n = Number(arg.slice(FD_ARG.length));
32
69
  return Number.isInteger(n) && n > 2 ? n : null;
33
70
  }
34
- export function loadPlatformKeychainKey(argv = process.argv, readFd = (fd) => fs.readFileSync(fd, 'utf8'), closeFd = (fd) => fs.closeSync(fd)) {
71
+ function loadPlatformKeychainKey(argv = process.argv, readFd = (fd) => fs.readFileSync(fd, 'utf8'), closeFd = (fd) => fs.closeSync(fd)) {
35
72
  const fd = keychainKeyFdFromArgv(argv);
36
73
  if (fd === null)
37
74
  return { kind: 'none' };
@@ -40,7 +77,7 @@ export function loadPlatformKeychainKey(argv = process.argv, readFd = (fd) => fs
40
77
  if (key.length !== KEY_BYTES)
41
78
  return { kind: 'failed', error: 'not 32 bytes of key material' };
42
79
  const label = platformLabel(process.platform);
43
- setPlatformKeychainKey({ label, key });
80
+ (0, system_1.setPlatformKeychainKey)({ label, key });
44
81
  return { kind: 'loaded', label };
45
82
  }
46
83
  catch (err) {
@@ -1,8 +1,11 @@
1
- import { randomUUID } from 'node:crypto';
2
- import { readPendingRestart, retirePreviousLocalCa } from '@camstack/system';
3
- import { EventCategory } from '@camstack/types';
4
- import { reconcileLifecycleJobsAtBoot } from './reconcile-lifecycle-jobs.js';
5
- export class PostBootService {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostBootService = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ const system_1 = require("@camstack/system");
6
+ const types_1 = require("@camstack/types");
7
+ const reconcile_lifecycle_jobs_js_1 = require("./reconcile-lifecycle-jobs.js");
8
+ class PostBootService {
6
9
  eventBus;
7
10
  logger;
8
11
  /**
@@ -41,10 +44,10 @@ export class PostBootService {
41
44
  // orchestration shim needed here anymore.
42
45
  // Emit system.boot event
43
46
  this.eventBus.emit({
44
- id: randomUUID(),
47
+ id: (0, node_crypto_1.randomUUID)(),
45
48
  timestamp: new Date(),
46
49
  source: { type: 'core', id: 'system' },
47
- category: EventCategory.SystemBoot,
50
+ category: types_1.EventCategory.SystemBoot,
48
51
  data: { port, host, trpcRegistered, dataPath },
49
52
  });
50
53
  // If the previous shutdown was driven by RestartCoordinator, emit a
@@ -58,7 +61,7 @@ export class PostBootService {
58
61
  this.emitTlsCertChangedIfReissued(tlsCert);
59
62
  // The listener is up on the replacement CA's leaf: the retired unconstrained CA (and
60
63
  // its key) kept on disk for the replacement window can go (D873).
61
- if (retirePreviousLocalCa(dataPath)) {
64
+ if ((0, system_1.retirePreviousLocalCa)(dataPath)) {
62
65
  this.logger.warn('Retired the previous local CA that had no name constraints (D873)');
63
66
  }
64
67
  // Re-drive every non-terminal lifecycle job (addon task phases) from its
@@ -68,7 +71,7 @@ export class PostBootService {
68
71
  await this.reconcileLifecycleJobsIfAny();
69
72
  }
70
73
  async reconcileLifecycleJobsIfAny() {
71
- const { resumed, failed } = await reconcileLifecycleJobsAtBoot();
74
+ const { resumed, failed } = await (0, reconcile_lifecycle_jobs_js_1.reconcileLifecycleJobsAtBoot)();
72
75
  if (resumed + failed > 0) {
73
76
  this.logger.info('Lifecycle jobs reconciled at boot', { meta: { resumed, failed } });
74
77
  }
@@ -87,15 +90,15 @@ export class PostBootService {
87
90
  };
88
91
  this.logger.warn('TLS certificate reissued', { meta: payload });
89
92
  this.eventBus.emit({
90
- id: randomUUID(),
93
+ id: (0, node_crypto_1.randomUUID)(),
91
94
  timestamp: new Date(),
92
95
  source: { type: 'core', id: 'system' },
93
- category: EventCategory.SystemTlsCertChanged,
96
+ category: types_1.EventCategory.SystemTlsCertChanged,
94
97
  data: payload,
95
98
  });
96
99
  }
97
100
  emitRestartCompletedIfPending(dataDir) {
98
- const marker = readPendingRestart(dataDir);
101
+ const marker = (0, system_1.readPendingRestart)(dataDir);
99
102
  if (marker === null)
100
103
  return;
101
104
  const payload = {
@@ -113,11 +116,12 @@ export class PostBootService {
113
116
  expiresAt: Date.now() + PostBootService.LAST_RESTART_RETENTION_MS,
114
117
  };
115
118
  this.eventBus.emit({
116
- id: randomUUID(),
119
+ id: (0, node_crypto_1.randomUUID)(),
117
120
  timestamp: new Date(),
118
121
  source: { type: 'core', id: 'system' },
119
- category: EventCategory.SystemRestartCompleted,
122
+ category: types_1.EventCategory.SystemRestartCompleted,
120
123
  data: payload,
121
124
  });
122
125
  }
123
126
  }
127
+ exports.PostBootService = PostBootService;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * Boot-time §10 reconcile of all non-terminal lifecycle jobs.
3
4
  *
@@ -15,10 +16,12 @@
15
16
  * framework updates ship via `applyServerUpdate`); any stray non-terminal
16
17
  * framework task is marked `skipped` during reconcile so the job can finalize.
17
18
  */
18
- import { getLifecycleRunner } from '../core/lifecycle/lifecycle-runner.singleton.js';
19
- export async function reconcileLifecycleJobsAtBoot() {
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.reconcileLifecycleJobsAtBoot = reconcileLifecycleJobsAtBoot;
21
+ const lifecycle_runner_singleton_js_1 = require("../core/lifecycle/lifecycle-runner.singleton.js");
22
+ async function reconcileLifecycleJobsAtBoot() {
20
23
  try {
21
- return await getLifecycleRunner().reconcile();
24
+ return await (0, lifecycle_runner_singleton_js_1.getLifecycleRunner)().reconcile();
22
25
  }
23
26
  catch {
24
27
  // Never crash the post-boot path.
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * The hub's address is not an environment variable.
3
4
  *
@@ -14,8 +15,11 @@
14
15
  * ignored, and the variable is removed from this process's environment before
15
16
  * any addon runner is forked — so no child can grow a new reader of it.
16
17
  */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.RETIRED_HUB_ADDRESS_ENVS = void 0;
20
+ exports.dropRetiredHubAddressEnv = dropRetiredHubAddressEnv;
17
21
  /** Variables that used to name the hub's address; all ignored now. */
18
- export const RETIRED_HUB_ADDRESS_ENVS = [
22
+ exports.RETIRED_HUB_ADDRESS_ENVS = [
19
23
  'CAMSTACK_HUB_PUBLIC_URL',
20
24
  'CAMSTACK_PUBLIC_ORIGIN',
21
25
  ];
@@ -23,12 +27,12 @@ export const RETIRED_HUB_ADDRESS_ENVS = [
23
27
  * Remove every retired address variable from `env` and return the warning to
24
28
  * log once a logger exists, or `undefined` when none was set.
25
29
  */
26
- export function dropRetiredHubAddressEnv(env) {
27
- const present = RETIRED_HUB_ADDRESS_ENVS.filter((name) => {
30
+ function dropRetiredHubAddressEnv(env) {
31
+ const present = exports.RETIRED_HUB_ADDRESS_ENVS.filter((name) => {
28
32
  const value = env[name];
29
33
  return value !== undefined && value.trim() !== '';
30
34
  });
31
- for (const name of RETIRED_HUB_ADDRESS_ENVS)
35
+ for (const name of exports.RETIRED_HUB_ADDRESS_ENVS)
32
36
  delete env[name];
33
37
  if (present.length === 0)
34
38
  return undefined;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * Hub bootstrap package selection.
3
4
  *
@@ -15,6 +16,8 @@
15
16
  * copy honoured `camstack.agentOnlyBootstrapAddons`, this one did not, and the
16
17
  * hub is the side that actually boots through here.
17
18
  */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.selectHubBootstrapPackages = selectHubBootstrapPackages;
18
21
  /**
19
22
  * The packages a HUB-role node bootstrap-installs: every `@camstack/addon-*`
20
23
  * runtime dependency plus `@camstack/system` (the carrier of the required
@@ -26,7 +29,7 @@
26
29
  * them for agent-role nodes to seed, but they are `execution.placement:
27
30
  * 'agent-only'` and the hub must never install them.
28
31
  */
29
- export function selectHubBootstrapPackages(pkg) {
32
+ function selectHubBootstrapPackages(pkg) {
30
33
  const agentOnly = new Set(pkg.camstack?.agentOnlyBootstrapAddons ?? []);
31
34
  return Object.keys(pkg.dependencies ?? {}).filter((name) => !agentOnly.has(name) && (name.startsWith('@camstack/addon-') || name === '@camstack/system'));
32
35
  }
@@ -1,3 +1,39 @@
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.resolveClosureNodeModules = resolveClosureNodeModules;
1
37
  /**
2
38
  * The directory holding the closure's own copy of each `@camstack` package.
3
39
  *
@@ -15,9 +51,9 @@
15
51
  * behind. A wrong path that answers "nothing" is indistinguishable from a
16
52
  * closure that carries nothing, which is why it survived.
17
53
  */
18
- import * as path from 'node:path';
54
+ const path = __importStar(require("node:path"));
19
55
  /** @param serverDistDir typically `__dirname` of the launcher. */
20
- export function resolveClosureNodeModules(serverDistDir) {
56
+ function resolveClosureNodeModules(serverDistDir) {
21
57
  // dist → server → @camstack → node_modules
22
58
  return path.resolve(serverDistDir, '..', '..', '..');
23
59
  }
@@ -1,5 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddonCallGateway = void 0;
1
4
  const REMOTE_TIMEOUT_MS = 10_000;
2
- export class AddonCallGateway {
5
+ class AddonCallGateway {
3
6
  deps;
4
7
  constructor(deps) {
5
8
  this.deps = deps;
@@ -100,3 +103,4 @@ export class AddonCallGateway {
100
103
  return anyWithName?.nodeID ?? null;
101
104
  }
102
105
  }
106
+ exports.AddonCallGateway = AddonCallGateway;