@camstack/server 1.2.728 → 1.2.729

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 (107) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/agent/main.js +2 -14
  3. package/dist/api/core/cap-providers.js +0 -7
  4. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  5. package/dist/api/trpc/generated-cap-routers.js +1848 -1839
  6. package/dist/boot/boot-config.js +1 -1
  7. package/dist/core/addon/addon-package.service.js +3 -105
  8. package/dist/core/addon-bridge/addon-bridge.service.js +1 -5
  9. package/dist/launcher.js +12 -124
  10. package/package.json +21 -17
  11. package/system/dist/addon-runner.js +1 -2
  12. package/system/dist/addon-runner.mjs +1 -2
  13. package/system/dist/{agent-https-B1XLr4nm.js → agent-https-BMmfwElS.js} +1 -1
  14. package/system/dist/{agent-https-BsedJhrb.mjs → agent-https-BXB7X23w.mjs} +1 -1
  15. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  17. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  19. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  20. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  21. package/system/dist/builtins/autotrack/index.js +1 -1
  22. package/system/dist/builtins/autotrack/index.mjs +1 -1
  23. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  25. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  26. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  27. package/system/dist/builtins/camera-grid/index.js +1 -1
  28. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  29. package/system/dist/builtins/composer/composer.addon.js +3 -3
  30. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  31. package/system/dist/builtins/console-logging/index.js +1 -1
  32. package/system/dist/builtins/console-logging/index.mjs +1 -1
  33. package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  35. package/system/dist/builtins/device-history/device-history.addon.d.ts +4 -0
  36. package/system/dist/builtins/device-history/device-history.addon.js +769 -17
  37. package/system/dist/builtins/device-history/device-history.addon.mjs +769 -17
  38. package/system/dist/builtins/device-history/runs/device-runs-provider.d.ts +7 -0
  39. package/system/dist/builtins/device-history/runs/device-runs-record-kinds.d.ts +15 -0
  40. package/system/dist/builtins/device-history/runs/device-runs-service.d.ts +42 -0
  41. package/system/dist/builtins/device-history/runs/energy-from-history.d.ts +22 -0
  42. package/system/dist/builtins/device-history/runs/run-recorder.d.ts +111 -0
  43. package/system/dist/builtins/device-history/runs/slice-readers.d.ts +9 -0
  44. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  45. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  46. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  47. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  48. package/system/dist/builtins/keychain/index.js +47 -38
  49. package/system/dist/builtins/keychain/index.mjs +47 -38
  50. package/system/dist/builtins/keychain/key-sources.d.ts +12 -7
  51. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  52. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  53. package/system/dist/builtins/local-auth/local-auth.addon.js +3 -3
  54. package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  55. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  56. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  57. package/system/dist/builtins/loki-logging/index.js +1 -1
  58. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  59. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  60. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  61. package/system/dist/builtins/platform-probe/index.js +1 -1
  62. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  63. package/system/dist/builtins/record-entries/index.js +1 -1
  64. package/system/dist/builtins/record-entries/index.mjs +1 -1
  65. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  66. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  67. package/system/dist/builtins/snapshot/index.js +1 -1
  68. package/system/dist/builtins/snapshot/index.mjs +1 -1
  69. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  70. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  71. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  72. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  73. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  74. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  75. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  76. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  77. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  78. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  79. package/system/dist/builtins/winston-logging/index.js +1 -1
  80. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  81. package/system/dist/{composition-sources-BjuQ3xot.mjs → composition-sources-BCfgVe9V.mjs} +1 -1
  82. package/system/dist/{composition-sources-C5r8i46e.js → composition-sources-D6b0p8Hl.js} +1 -1
  83. package/system/dist/{constants-GnxjCxT3.mjs → constants-BQLyzulL.mjs} +1 -1
  84. package/system/dist/{constants-Bh5wQoTg.js → constants-ePrW9DMj.js} +1 -1
  85. package/system/dist/{device-ca-OWEYAYaG.mjs → device-ca-C8X1AGHU.mjs} +2 -2
  86. package/system/dist/{device-ca-oM-nuINR.js → device-ca-Dh9wjg_e.js} +2 -2
  87. package/system/dist/{dist-B9xpybTG.js → dist-D-7p7cJp.js} +198 -35
  88. package/system/dist/{dist-Cw8KtuQY.mjs → dist-XvOCXwnA.mjs} +187 -36
  89. package/system/dist/file-host-worker.js +1 -1
  90. package/system/dist/file-host-worker.mjs +1 -1
  91. package/system/dist/{hub-mdns-ciao-BPENkOKX.js → hub-mdns-ciao-BFZZAJIx.js} +2 -2
  92. package/system/dist/{hub-mdns-ciao-C3qMZFP0.mjs → hub-mdns-ciao-CGwz5__T.mjs} +2 -2
  93. package/system/dist/index.js +40 -186
  94. package/system/dist/index.mjs +41 -185
  95. package/system/dist/kernel/addon-installer.d.ts +9 -60
  96. package/system/dist/kernel/bootstrap-config.d.ts +3 -1
  97. package/system/dist/kernel/config-schema.d.ts +2 -11
  98. package/system/dist/kernel/fs-utils.d.ts +0 -6
  99. package/system/dist/kernel/index.d.ts +2 -3
  100. package/system/dist/{restore-archive-BiN1yKZV.js → restore-archive-3e5X8g6h.js} +1 -1
  101. package/system/dist/{restore-archive-DJv5ATV8.mjs → restore-archive-B3M3ZwAl.mjs} +82 -82
  102. package/system/dist/{retention-DQje-V4I.mjs → retention-BPxZj_Qf.mjs} +1 -1
  103. package/system/dist/{retention-BT7TgsUn.js → retention-DacNjIXz.js} +1 -1
  104. package/system/dist/{wal-maintenance-DM08Htuy.mjs → wal-maintenance-C4K7pX1x.mjs} +0 -0
  105. package/system/dist/{wal-maintenance-BLwgOIXb.js → wal-maintenance-Dguwwx4N.js} +0 -0
  106. package/system/package.json +5 -2
  107. package/system/dist/kernel/workspace-detect.d.ts +0 -9
@@ -120,7 +120,7 @@ function retiredSecretSources(env) {
120
120
  * variable still set, so a container template that carries one is told.
121
121
  */
122
122
  function loadBootstrapConfig(configPath) {
123
- const config = (0, system_1.loadBootstrapConfig)(configPath);
123
+ const config = (0, system_1.loadBootstrapConfig)(configPath, { warnRetiredKeys: true });
124
124
  const env = process.env;
125
125
  const retired = retiredSecretSources(env);
126
126
  if (retired.length > 0) {
@@ -258,7 +258,6 @@ class AddonPackageService {
258
258
  // Ensures install/uninstall works before full module init completes.
259
259
  try {
260
260
  const addonsDir = this.resolveAddonsDir();
261
- const workspacePackagesDir = (0, system_1.detectWorkspacePackagesDir)(__dirname);
262
261
  // `CAMSTACK_NPM_REGISTRY` override exists primarily for the e2e
263
262
  // harness — it points the installer at a sandboxed verdaccio so
264
263
  // the CLI-vs-npm version-interaction tests don't hit the public
@@ -269,7 +268,6 @@ class AddonPackageService {
269
268
  const registry = process.env['CAMSTACK_NPM_REGISTRY'];
270
269
  this.installer = new system_1.AddonInstaller({
271
270
  addonsDir,
272
- workspacePackagesDir: workspacePackagesDir ?? undefined,
273
271
  ...(registry ? { registry } : {}),
274
272
  });
275
273
  (0, system_1.ensureDir)(addonsDir);
@@ -298,15 +296,6 @@ class AddonPackageService {
298
296
  });
299
297
  return result;
300
298
  }
301
- /** Install an addon from the local workspace (dev mode) */
302
- async installFromWorkspace(name) {
303
- this.requireInstaller();
304
- const result = await this.installer.install(name);
305
- this.logger.info('Installed from workspace', {
306
- meta: { name: result.name, version: result.version },
307
- });
308
- return result;
309
- }
310
299
  /** Install an addon from an uploaded tgz file */
311
300
  async installFromUpload(tgzPath) {
312
301
  this.requireInstaller();
@@ -448,53 +437,6 @@ class AddonPackageService {
448
437
  });
449
438
  return { success: true, loaded, failed };
450
439
  }
451
- /**
452
- * Full install-from-workspace orchestration:
453
- * 1. Workspace install
454
- * 2. Reload packages
455
- * 3. Load new addons into registry
456
- * 4. Broadcast toast notification
457
- */
458
- async installFromWorkspaceAndLoad(packageName) {
459
- this.logger.info('Installing from workspace...', { meta: { packageName } });
460
- try {
461
- const result = await this.installFromWorkspace(packageName);
462
- this.logger.info('Workspace install complete', {
463
- meta: { name: result.name, version: result.version },
464
- });
465
- }
466
- catch (err) {
467
- const msg = (0, types_2.errMsg)(err);
468
- this.logger.error('Workspace install failed', { meta: { error: msg } });
469
- this.toastService.broadcast({ title: 'Install Failed', message: msg, severity: 'warning' });
470
- throw new Error(`Workspace install failed: ${msg}`, { cause: err });
471
- }
472
- try {
473
- await this.reloadPackages();
474
- }
475
- catch (err) {
476
- this.logger.warn('Non-fatal: failed to reload packages after workspace install', {
477
- meta: { error: (0, types_2.errMsg)(err) },
478
- });
479
- }
480
- let loaded = [];
481
- let failed = [];
482
- try {
483
- const result = await this.addonRegistry.loadNewAddons();
484
- loaded = result.loaded;
485
- failed = result.failed;
486
- }
487
- catch (err) {
488
- this.logger.warn('Failed to load new addons after install', { meta: { error: (0, types_2.errMsg)(err) } });
489
- failed.push(packageName);
490
- }
491
- this.toastService.broadcast({
492
- title: 'Addon Installed from Workspace',
493
- message: `${packageName} installed${loaded.length ? ` — addons: ${loaded.join(', ')}` : ''}`,
494
- severity: failed.length ? 'warning' : 'info',
495
- });
496
- return { success: true, loaded, failed };
497
- }
498
440
  /**
499
441
  * Full uninstall orchestration:
500
442
  * 1. Emit uninstall lifecycle event
@@ -537,50 +479,6 @@ class AddonPackageService {
537
479
  return { success: true };
538
480
  }
539
481
  // =========================================================================
540
- // Workspace
541
- // =========================================================================
542
- /** Check if workspace packages directory is available (dev mode) */
543
- isWorkspaceAvailable() {
544
- return this.installer?.workspaceDir != null;
545
- }
546
- /** List addon packages available in the workspace but not necessarily installed */
547
- listWorkspacePackages() {
548
- const workspaceDir = this.installer?.workspaceDir;
549
- if (!workspaceDir)
550
- return [];
551
- const results = [];
552
- const installed = new Set(this.listInstalled().map((p) => p.name));
553
- try {
554
- for (const entry of fs.readdirSync(workspaceDir, { withFileTypes: true })) {
555
- if (!entry.isDirectory())
556
- continue;
557
- const pkgJsonPath = path.join(workspaceDir, entry.name, 'package.json');
558
- if (!fs.existsSync(pkgJsonPath))
559
- continue;
560
- const pkg = readJsonObject(pkgJsonPath);
561
- if (!pkg) {
562
- this.logger.debug('Skipping malformed package.json', { meta: { entryName: entry.name } });
563
- continue;
564
- }
565
- const name = asString(pkg['name']);
566
- if (!name.startsWith('@camstack/'))
567
- continue;
568
- const camstack = asRecord(pkg['camstack']);
569
- if (!Array.isArray(camstack['addons']))
570
- continue;
571
- results.push({
572
- name,
573
- version: asString(pkg['version'], '0.0.0'),
574
- installed: installed.has(name),
575
- });
576
- }
577
- }
578
- catch (err) {
579
- this.logger.warn('Failed to read workspace directory', { meta: { error: (0, types_2.errMsg)(err) } });
580
- }
581
- return results;
582
- }
583
- // =========================================================================
584
482
  // Query
585
483
  // =========================================================================
586
484
  /** List all installed addon packages */
@@ -1127,9 +1025,9 @@ class AddonPackageService {
1127
1025
  };
1128
1026
  }
1129
1027
  // Reuse the long-lived installer the registry already configured
1130
- // (correct addonsDir + installSource + workspaceDir) — building a
1131
- // fresh one with `new AI({ addonsDir })` would lose installSource
1132
- // detection and skip the central manifest write.
1028
+ // (correct addonsDir + registry) — building a
1029
+ // fresh one with `new AI({ addonsDir })` would skip the central
1030
+ // manifest write.
1133
1031
  this.requireInstaller();
1134
1032
  const addonInstaller = this.installer;
1135
1033
  const previousVersion = this.getInstalledPackageVersion(name);
@@ -72,11 +72,7 @@ class AddonBridgeService {
72
72
  const kernel = require('@camstack/server/system');
73
73
  const dataDir = process.env.CAMSTACK_DATA ?? 'camstack-data';
74
74
  const addonsDir = process.env.CAMSTACK_ADDONS_DIR ?? path.resolve(dataDir, 'addons');
75
- const workspacePackagesDir = kernel.detectWorkspacePackagesDir(__dirname);
76
- this.installer = new kernel.AddonInstaller({
77
- addonsDir,
78
- workspacePackagesDir: workspacePackagesDir ?? undefined,
79
- });
75
+ this.installer = new kernel.AddonInstaller({ addonsDir });
80
76
  kernel.ensureDir(addonsDir);
81
77
  }
82
78
  catch (error) {
package/dist/launcher.js CHANGED
@@ -54,7 +54,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
54
54
  const fs = __importStar(require("node:fs"));
55
55
  const os = __importStar(require("node:os"));
56
56
  const path = __importStar(require("node:path"));
57
- const yaml = __importStar(require("js-yaml"));
58
57
  const addon_root_inventory_js_1 = require("./addon-root-inventory.js");
59
58
  const bootstrap_packages_js_1 = require("./bootstrap-packages.js");
60
59
  const first_boot_addon_plan_js_1 = require("./first-boot-addon-plan.js");
@@ -66,62 +65,6 @@ const pending_restore_js_1 = require("./pending-restore.js");
66
65
  const pre_migration_restore_js_1 = require("./pre-migration-restore.js");
67
66
  /** Resolve the data directory from env or default */
68
67
  const DATA_DIR = process.env['CAMSTACK_DATA'] ?? 'camstack-data';
69
- /** Narrow `CAMSTACK_INSTALL_SOURCE` env into the typed union. */
70
- function parseInstallSource(value) {
71
- if (value === 'npm' || value === 'local' || value === 'symlink')
72
- return value;
73
- return undefined;
74
- }
75
- /**
76
- * Locate + parse `config.yaml` relative to the data dir. Returns the
77
- * raw object on success, `null` when missing or unparseable. The
78
- * launcher uses this BEFORE @camstack/server/system is imported so it must stay
79
- * free of core deps — just js-yaml + the kernel's bootstrapSchema for
80
- * shape validation by the call site.
81
- */
82
- function readConfigYaml(dataDir) {
83
- // CONFIG_PATH (when set) is the authoritative location and must win — it
84
- // is what main.ts reads/writes. Without this the launcher would miss the
85
- // `bootstrap.*` section of a relocated config.yaml (e.g. a separate
86
- // /config mount) and silently fall back to defaults.
87
- const candidates = [
88
- ...(process.env.CONFIG_PATH ? [path.resolve(process.env.CONFIG_PATH)] : []),
89
- path.resolve(dataDir, '..', 'config.yaml'),
90
- path.resolve(dataDir, 'config.yaml'),
91
- path.resolve(process.cwd(), 'config.yaml'),
92
- ];
93
- const found = candidates.find((p) => fs.existsSync(p));
94
- if (!found)
95
- return null;
96
- try {
97
- return yaml.load(fs.readFileSync(found, 'utf-8')) ?? {};
98
- }
99
- catch (err) {
100
- console.warn(`[launcher] Could not parse ${found}: ${err instanceof Error ? err.message : String(err)}`);
101
- return null;
102
- }
103
- }
104
- /**
105
- * Read `bootstrap.installSource` from `<dataDir>/config.yaml` if present.
106
- * Returns the configured value or `null` when absent.
107
- *
108
- * Production deployments should leave this unset (defaults to 'npm');
109
- * `symlink` is a dev-time convenience that points data/addons/<pkg>
110
- * directly at the workspace source dir — never set in shipped
111
- * containers or Electron bundles.
112
- *
113
- * `bootstrapSchema` is passed in (not imported at module top) so this
114
- * helper can be called after the dynamic @camstack/server/system import in launch().
115
- */
116
- function readBootstrapInstallSource(dataDir, bootstrapSchema) {
117
- const raw = readConfigYaml(dataDir);
118
- if (raw === null)
119
- return undefined;
120
- const validation = bootstrapSchema.safeParse(raw);
121
- if (!validation.success)
122
- return undefined;
123
- return parseInstallSource(validation.data.bootstrap.installSource);
124
- }
125
68
  /**
126
69
  * Derive the bootstrap package list from THIS server's own package.json — the
127
70
  * `@camstack/addon-*` deps plus `@camstack/server/system` (which ships the required
@@ -188,31 +131,6 @@ function readInstalledAddonVersions(addonRoot, packages) {
188
131
  }
189
132
  return out;
190
133
  }
191
- /**
192
- * Read `bootstrap.requiredAddons` from `<dataDir>/config.yaml` if present.
193
- * Returns the parsed array, an empty array when explicitly set to `[]`,
194
- * or `null` when the field is absent (caller should fall back to the
195
- * kernel's REQUIRED_PACKAGES constant).
196
- *
197
- * Inline YAML parse rather than going through ConfigManager: the
198
- * launcher runs before @camstack/server/system is imported and must stay free of
199
- * core dependencies. Just yaml.load + bootstrapSchema (kernel) for
200
- * shape validation.
201
- *
202
- * `bootstrapSchema` is passed in (not imported at module top) so this
203
- * helper can be called after the dynamic @camstack/server/system import in launch().
204
- */
205
- function readBootstrapRequiredAddons(dataDir, bootstrapSchema) {
206
- const raw = readConfigYaml(dataDir);
207
- if (raw === null)
208
- return null;
209
- const validation = bootstrapSchema.safeParse(raw);
210
- if (!validation.success) {
211
- console.warn(`[launcher] config.yaml failed bootstrapSchema validation: ${validation.error.message}`);
212
- return null;
213
- }
214
- return validation.data.bootstrap.requiredAddons ?? null;
215
- }
216
134
  async function launch() {
217
135
  const dataDir = DATA_DIR;
218
136
  // Node role (hub | agent) — resolved ONCE here. Dynamic import keeps the
@@ -252,7 +170,7 @@ async function launch() {
252
170
  // @camstack/server/system is imported DYNAMICALLY here — AFTER the active framework
253
171
  // dir + NODE_PATH are resolved above — so the correct framework copy is what
254
172
  // gets loaded. Never import it at module top.
255
- const { AddonInstaller, bootstrapSchema, detectWorkspacePackagesDir, quarantineAddonResidue } = await Promise.resolve().then(() => __importStar(require('@camstack/server/system')));
173
+ const { AddonInstaller, quarantineAddonResidue } = await Promise.resolve().then(() => __importStar(require('@camstack/server/system')));
256
174
  // Residue quarantine — FIRST thing that touches the addon root, before the
257
175
  // bootstrap seed writes into it and long before any loader scans it.
258
176
  //
@@ -276,52 +194,23 @@ async function launch() {
276
194
  else {
277
195
  console.warn('[launcher] quarantineAddonResidue unavailable — skipping residue quarantine');
278
196
  }
279
- // Install source resolution:
280
- // 1. CAMSTACK_BUNDLED_ADDONS_DIR — set by Electron-packaged builds to
281
- // the closure's own scope dir, <resourcesPath>/node_modules/@camstack.
282
- // Pre-built addons ship inside that closure and are copied out of it at
283
- // first launch (`'local'` mode). ONE copy in the bundle: the app used to
284
- // ship a second, hand-copied <resourcesPath>/addons tree as well (D45).
285
- // 2. CAMSTACK_INSTALL_SOURCE=local — explicit opt-in to copy from
286
- // the monorepo workspace (used by e2e + dev bootstrap). Hub
287
- // auto-detects `packages/` via detectWorkspacePackagesDir.
288
- // 3. Otherwise: 'npm' from the registry. Local development pushes
289
- // via `camstack deploy` (CLI tarball upload), bypassing this
290
- // bootstrap entirely.
197
+ // Provisioning source: CAMSTACK_BUNDLED_ADDONS_DIR — set by Electron-packaged
198
+ // builds to the closure's own scope dir, <resourcesPath>/node_modules/@camstack
199
+ // — seeds first launch from that closure (D45). Otherwise addons come from
200
+ // npm; a workspace build reaches a node only through `camstack deploy`.
291
201
  console.log('[launcher] Checking required packages...');
292
- // Install source resolution:
293
- // CAMSTACK_INSTALL_SOURCE env: 'npm' | 'local' | 'symlink' | undefined.
294
- // CAMSTACK_BUNDLED_ADDONS_DIR: Electron path, forces 'local'.
295
- // bootstrap.installSource (config.yaml): same set as env. Env wins.
296
- const rawEnvSource = process.env['CAMSTACK_INSTALL_SOURCE'];
297
- const yamlSource = readBootstrapInstallSource(dataDir, bootstrapSchema);
298
- const explicitSource = parseInstallSource(rawEnvSource) ?? yamlSource;
299
202
  const bundledDir = process.env['CAMSTACK_BUNDLED_ADDONS_DIR'];
300
- let workspaceDir = null;
301
- let resolvedSource = explicitSource;
203
+ let bundledAddonsDir;
302
204
  if (bundledDir && fs.existsSync(bundledDir)) {
303
- workspaceDir = bundledDir;
304
- resolvedSource = 'local';
205
+ bundledAddonsDir = bundledDir;
305
206
  console.log(`[launcher] Using bundled addons from ${bundledDir}`);
306
207
  }
307
- else if (explicitSource === 'local' || explicitSource === 'symlink') {
308
- workspaceDir = detectWorkspacePackagesDir(__dirname);
309
- if (workspaceDir === null) {
310
- console.warn(`[launcher] installSource=${explicitSource} requested but no workspace ` +
311
- `packages/ dir found from ${__dirname} — falling back to 'npm'`);
312
- resolvedSource = 'npm';
313
- }
314
- }
315
208
  const installer = new AddonInstaller({
316
209
  addonsDir,
317
- workspacePackagesDir: workspaceDir ?? undefined,
318
- installSource: resolvedSource,
210
+ ...(bundledAddonsDir ? { bundledAddonsDir } : {}),
319
211
  });
320
- // bootstrap.requiredAddons from config.yaml — if set, REPLACES the
321
- // kernel's hard-coded REQUIRED_PACKAGES. The kernel never reaches into
322
- // SQL before this list is installed; everything here must be a known
323
- // package name that can be resolved from the workspace, the bundle, or
324
- // npm. Default (undefined) → derive from THIS server's own package.json.
212
+ // The first-boot addon set always comes from the package; no config key
213
+ // overrides it.
325
214
  //
326
215
  // We derive the list here rather than relying on
327
216
  // `AddonInstaller.REQUIRED_PACKAGES` (which uses
@@ -335,10 +224,9 @@ async function launch() {
335
224
  // The server's own package.json is always readable next to this launcher.
336
225
  // Role-aware default bootstrap set: the hub installs every addon-* dep of
337
226
  // its own package.json; the agent installs ONLY the agent bootstrap subset
338
- // (AGENT_PACKAGES, derived from `camstack.agentBootstrapAddons`). A
339
- // config.yaml `bootstrap.requiredAddons` override still wins for both roles.
227
+ // (AGENT_PACKAGES, derived from `camstack.agentBootstrapAddons`).
340
228
  const roleDefaultBootstrap = role === 'agent' ? AddonInstaller.AGENT_PACKAGES : deriveBootstrapFromSelf();
341
- const bootstrapRequired = readBootstrapRequiredAddons(dataDir, bootstrapSchema) ?? roleDefaultBootstrap;
229
+ const bootstrapRequired = roleDefaultBootstrap;
342
230
  console.log(`[launcher] bootstrap (${role}): ${bootstrapRequired.length} required package(s)`);
343
231
  // THE FIRST-BOOT ADDON PLAN — reported every boot (D45 task 32).
344
232
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.728",
3
+ "version": "1.2.729",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,15 +66,19 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-admin-ui": ">=1.2.548",
70
- "@camstack/addon-agent-ui": ">=1.2.309",
71
- "@camstack/addon-benchmark": ">=1.2.307",
72
- "@camstack/addon-model-studio": ">=1.1.338",
73
- "@camstack/addon-osd-manager": ">=0.1.311",
74
- "@camstack/addon-pipeline-orchestrator": ">=1.2.651",
75
- "@camstack/addon-post-analysis": ">=1.2.661",
76
- "@camstack/addon-provider-homematic": ">=1.2.177",
77
- "@camstack/addon-training": ">=0.1.124"
69
+ "@camstack/addon-admin-ui": ">=1.2.549",
70
+ "@camstack/addon-agent-ui": ">=1.2.310",
71
+ "@camstack/addon-benchmark": ">=1.2.308",
72
+ "@camstack/addon-import-alexa": ">=0.2.176",
73
+ "@camstack/addon-model-studio": ">=1.1.339",
74
+ "@camstack/addon-osd-manager": ">=0.1.312",
75
+ "@camstack/addon-post-analysis": ">=1.2.662",
76
+ "@camstack/addon-provider-homeassistant": ">=1.2.645",
77
+ "@camstack/addon-provider-homematic": ">=1.2.178",
78
+ "@camstack/addon-provider-unifi": ">=0.2.154",
79
+ "@camstack/addon-provider-unraid": ">=0.2.155",
80
+ "@camstack/addon-provider-velux": ">=0.2.155",
81
+ "@camstack/addon-training": ">=0.1.125"
78
82
  },
79
83
  "wrapper": {
80
84
  "desktop": ">=0.0.1",
@@ -83,19 +87,19 @@
83
87
  }
84
88
  },
85
89
  "dependencies": {
86
- "@camstack/addon-admin-ui": "1.2.548",
87
- "@camstack/addon-agent-ui": "1.2.309",
90
+ "@camstack/addon-admin-ui": "1.2.549",
91
+ "@camstack/addon-agent-ui": "1.2.310",
88
92
  "@camstack/addon-auth": "1.2.175",
89
- "@camstack/addon-benchmark": "1.2.307",
93
+ "@camstack/addon-benchmark": "1.2.308",
90
94
  "@camstack/addon-decoder-nodeav": "1.2.145",
91
95
  "@camstack/addon-notifiers": "1.2.626",
92
96
  "@camstack/addon-pipeline": "1.2.637",
93
97
  "@camstack/addon-pipeline-orchestrator": "1.2.651",
94
- "@camstack/addon-post-analysis": "1.2.661",
95
- "@camstack/develop": "0.1.43",
98
+ "@camstack/addon-post-analysis": "1.2.662",
99
+ "@camstack/develop": "0.1.44",
96
100
  "@camstack/sdk": "1.2.155",
97
- "@camstack/types": "1.2.468",
98
- "@camstack/ui-library": "1.2.367",
101
+ "@camstack/types": "1.2.469",
102
+ "@camstack/ui-library": "1.2.368",
99
103
  "@fastify/compress": "^9.0.0",
100
104
  "@fastify/cookie": "^11.0.2",
101
105
  "@fastify/cors": "^11.2.0",
@@ -10297,8 +10297,7 @@ function createAddonSettingsStore(door, addonId) {
10297
10297
  var BOOTSTRAP_OWNED_SECTIONS = new Set([
10298
10298
  "server",
10299
10299
  "auth",
10300
- "bootstrap",
10301
- "keychain"
10300
+ "bootstrap"
10302
10301
  ]);
10303
10302
  /** The only keys under a bootstrap-owned section the store may answer. */
10304
10303
  var STORE_READABLE_BOOTSTRAP_KEYS = new Set([
@@ -10242,8 +10242,7 @@ function createAddonSettingsStore(door, addonId) {
10242
10242
  var BOOTSTRAP_OWNED_SECTIONS = new Set([
10243
10243
  "server",
10244
10244
  "auth",
10245
- "bootstrap",
10246
- "keychain"
10245
+ "bootstrap"
10247
10246
  ]);
10248
10247
  /** The only keys under a bootstrap-owned section the store may answer. */
10249
10248
  var STORE_READABLE_BOOTSTRAP_KEYS = new Set([
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-B9xpybTG.js");
2
+ const require_dist = require("./dist-D-7p7cJp.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
4
  let zod = require("zod");
5
5
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { Go as defineRecordKinds } from "./dist-Cw8KtuQY.mjs";
1
+ import { qo as defineRecordKinds } from "./dist-XvOCXwnA.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { z } from "zod";
4
4
  import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ms as EventCategory, Qa as BaseAddon, Xt as addonPagesCapability, js as errMsg } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Ns as errMsg, Ps as EventCategory, Zt as addonPagesCapability, eo as BaseAddon } from "../../dist-XvOCXwnA.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ms as EventCategory, Qa as BaseAddon, Qt as addonWidgetsCapability, js as errMsg } from "../../dist-Cw8KtuQY.mjs";
1
+ import { $t as addonWidgetsCapability, Ns as errMsg, Ps as EventCategory, eo as BaseAddon } from "../../dist-XvOCXwnA.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  //#region src/builtins/alerts/alert-episode-policy.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { $t as alertEpisodeId, Go as defineRecordKinds, Ho as createEvent, Ms as EventCategory, Qa as BaseAddon, d as AlertSchema, en as alertEpisodePayload, js as errMsg, tn as alertsCapability, vr as isAlertEpisodeOpen, yr as isAlertEpisodeSeverity } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Ns as errMsg, Ps as EventCategory, Wo as createEvent, br as isAlertEpisodeOpen, d as AlertSchema, en as alertEpisodeId, eo as BaseAddon, nn as alertsCapability, qo as defineRecordKinds, tn as alertEpisodePayload, xr as isAlertEpisodeSeverity } from "../../dist-XvOCXwnA.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  //#region src/builtins/alerts/alert-episode-policy.ts
4
4
  /**
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  //#region src/builtins/autotrack/autotrack-config.ts
8
8
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
9
9
  deadZoneFraction: .5,
@@ -1,4 +1,4 @@
1
- import { Ms as EventCategory, Qa as BaseAddon, Z as FIRST_LEVEL_MACRO_CLASSES, es as isEvent, js as errMsg, on as bareAddonId, yi as ptzAutotrackCapability } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Ns as errMsg, Ps as EventCategory, Q as FIRST_LEVEL_MACRO_CLASSES, eo as BaseAddon, ns as isEvent, sn as bareAddonId, xi as ptzAutotrackCapability } from "../../dist-XvOCXwnA.mjs";
2
2
  //#region src/builtins/autotrack/autotrack-config.ts
3
3
  var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
4
4
  deadZoneFraction: .5,
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
- const require_restore_archive = require("../../restore-archive-BiN1yKZV.js");
8
+ const require_restore_archive = require("../../restore-archive-3e5X8g6h.js");
9
9
  let node_crypto = require("node:crypto");
10
10
  let node_fs_promises = require("node:fs/promises");
11
11
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -1,6 +1,6 @@
1
- import { Cs as toNodeId, Ms as EventCategory, Qa as BaseAddon, Wr as mayWriteToLocation, an as backupCapability, ls as nodePin, na as storageOccupancyCapability } from "../../dist-Cw8KtuQY.mjs";
1
+ import { Kr as mayWriteToLocation, Ps as EventCategory, Ts as toNodeId, ds as nodePin, eo as BaseAddon, ia as storageOccupancyCapability, on as backupCapability } from "../../dist-XvOCXwnA.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
- import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-DJv5ATV8.mjs";
3
+ import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-B3M3ZwAl.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import * as fsp from "node:fs/promises";
6
6
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/calendars/calendar-color.ts
@@ -1,4 +1,4 @@
1
- import { Go as defineRecordKinds, Qa as BaseAddon, T as CalendarPreferencesSchema, mn as calendarsCapability } from "../../dist-Cw8KtuQY.mjs";
1
+ import { T as CalendarPreferencesSchema, eo as BaseAddon, hn as calendarsCapability, qo as defineRecordKinds } from "../../dist-XvOCXwnA.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/calendars/calendar-color.ts
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
7
  let zod = require("zod");
8
8
  let _camstack_types_node = require("@camstack/types/node");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { As as DeviceType, G as DeclaredDevices, Ho as createEvent, I as DERIVED_CAMERA_SILENCED_CAP_NAMES, Kr as memoizePinnedFfmpeg, Ms as EventCategory, Oa as buildFfmpegArgs, Os as DeviceFeature, Qa as BaseAddon, Qo as hydrateSchema, Rn as declarationOwnerNodeId, Zi as snapshotCapability, Zr as motionCapability, gt as MOTION_CLOSE_AFTER_MS, hn as cameraGridLayoutCapability, ia as streamCatalogCapability, js as errMsg, m as BaseDevice } from "../../dist-Cw8KtuQY.mjs";
1
+ import { $i as snapshotCapability, $r as motionCapability, Aa as buildFfmpegArgs, As as DeviceFeature, G as DeclaredDevices, I as DERIVED_CAMERA_SILENCED_CAP_NAMES, Jr as memoizePinnedFfmpeg, Ms as DeviceType, Ns as errMsg, Ps as EventCategory, Wo as createEvent, _t as MOTION_CLOSE_AFTER_MS, eo as BaseAddon, es as hydrateSchema, gn as cameraGridLayoutCapability, m as BaseDevice, oa as streamCatalogCapability, zn as declarationOwnerNodeId } from "../../dist-XvOCXwnA.mjs";
2
2
  import { z } from "zod";
3
3
  import { FfmpegProcess } from "@camstack/types/node";
4
4
  import { join } from "node:path";
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-B9xpybTG.js");
7
- const require_composition_sources = require("../../composition-sources-C5r8i46e.js");
8
- const require_retention = require("../../retention-BT7TgsUn.js");
6
+ const require_dist = require("../../dist-D-7p7cJp.js");
7
+ const require_composition_sources = require("../../composition-sources-D6b0p8Hl.js");
8
+ const require_retention = require("../../retention-DacNjIXz.js");
9
9
  let zod = require("zod");
10
10
  //#region src/builtins/composer/actuator-invoke.ts
11
11
  /**