@camstack/server 1.2.728 → 1.2.730

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 (114) hide show
  1. package/CHANGELOG.md +19 -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 +4 -1
  5. package/dist/api/trpc/generated-cap-routers.js +1923 -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 +19 -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-C8Gz2jjS.js} +1 -1
  14. package/system/dist/{agent-https-BsedJhrb.mjs → agent-https-DZq8uf8L.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.d.ts +6 -0
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.js +1361 -440
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +1360 -440
  36. package/system/dist/builtins/core-blocks/fan-presets-action-source.d.ts +35 -0
  37. package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +83 -0
  38. package/system/dist/builtins/core-blocks/fan-presets-wiring.d.ts +31 -0
  39. package/system/dist/builtins/core-blocks/record-kinds.d.ts +15 -0
  40. package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +84 -0
  41. package/system/dist/builtins/core-blocks/timed-run/timed-run-wiring.d.ts +21 -0
  42. package/system/dist/builtins/device-history/device-history.addon.d.ts +4 -0
  43. package/system/dist/builtins/device-history/device-history.addon.js +769 -17
  44. package/system/dist/builtins/device-history/device-history.addon.mjs +769 -17
  45. package/system/dist/builtins/device-history/runs/device-runs-provider.d.ts +7 -0
  46. package/system/dist/builtins/device-history/runs/device-runs-record-kinds.d.ts +15 -0
  47. package/system/dist/builtins/device-history/runs/device-runs-service.d.ts +42 -0
  48. package/system/dist/builtins/device-history/runs/energy-from-history.d.ts +22 -0
  49. package/system/dist/builtins/device-history/runs/run-recorder.d.ts +111 -0
  50. package/system/dist/builtins/device-history/runs/slice-readers.d.ts +9 -0
  51. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  52. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  53. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  54. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  55. package/system/dist/builtins/keychain/index.js +47 -38
  56. package/system/dist/builtins/keychain/index.mjs +47 -38
  57. package/system/dist/builtins/keychain/key-sources.d.ts +12 -7
  58. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  59. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  60. package/system/dist/builtins/local-auth/local-auth.addon.js +3 -3
  61. package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  62. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  63. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  64. package/system/dist/builtins/loki-logging/index.js +1 -1
  65. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  66. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  67. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  68. package/system/dist/builtins/platform-probe/index.js +1 -1
  69. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  70. package/system/dist/builtins/record-entries/index.js +1 -1
  71. package/system/dist/builtins/record-entries/index.mjs +1 -1
  72. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  73. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  74. package/system/dist/builtins/snapshot/index.js +1 -1
  75. package/system/dist/builtins/snapshot/index.mjs +1 -1
  76. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  77. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  78. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  79. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  80. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  81. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  82. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  83. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  84. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  85. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  86. package/system/dist/builtins/winston-logging/index.js +1 -1
  87. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  88. package/system/dist/{composition-sources-BjuQ3xot.mjs → composition-sources-4M_NnTnV.mjs} +1 -1
  89. package/system/dist/{composition-sources-C5r8i46e.js → composition-sources-hokiaS3J.js} +1 -1
  90. package/system/dist/{constants-Bh5wQoTg.js → constants-B0L3suFC.js} +1 -1
  91. package/system/dist/{constants-GnxjCxT3.mjs → constants-DTVU00LZ.mjs} +1 -1
  92. package/system/dist/{device-ca-OWEYAYaG.mjs → device-ca-C_y2GrU5.mjs} +2 -2
  93. package/system/dist/{device-ca-oM-nuINR.js → device-ca-DaTT1Y9v.js} +2 -2
  94. package/system/dist/{dist-Cw8KtuQY.mjs → dist-9lvgpcnm.mjs} +43394 -42706
  95. package/system/dist/{dist-B9xpybTG.js → dist-B3S0ruBa.js} +43217 -42457
  96. package/system/dist/file-host-worker.js +1 -1
  97. package/system/dist/file-host-worker.mjs +1 -1
  98. package/system/dist/{hub-mdns-ciao-BPENkOKX.js → hub-mdns-ciao-Dkw38L-g.js} +2 -2
  99. package/system/dist/{hub-mdns-ciao-C3qMZFP0.mjs → hub-mdns-ciao-xgLfZIVx.mjs} +2 -2
  100. package/system/dist/index.js +40 -186
  101. package/system/dist/index.mjs +41 -185
  102. package/system/dist/kernel/addon-installer.d.ts +9 -60
  103. package/system/dist/kernel/bootstrap-config.d.ts +3 -1
  104. package/system/dist/kernel/config-schema.d.ts +2 -11
  105. package/system/dist/kernel/fs-utils.d.ts +0 -6
  106. package/system/dist/kernel/index.d.ts +2 -3
  107. package/system/dist/{restore-archive-DJv5ATV8.mjs → restore-archive-cxnuWxQM.mjs} +1 -1
  108. package/system/dist/{restore-archive-BiN1yKZV.js → restore-archive-orP6eHBd.js} +1 -1
  109. package/system/dist/{retention-BT7TgsUn.js → retention-CB2cyW9k.js} +1 -1
  110. package/system/dist/{retention-DQje-V4I.mjs → retention-Me4u6zMp.mjs} +1 -1
  111. package/system/dist/{wal-maintenance-DM08Htuy.mjs → wal-maintenance-De7Ifvph.mjs} +0 -0
  112. package/system/dist/{wal-maintenance-BLwgOIXb.js → wal-maintenance-_PXj626-.js} +0 -0
  113. package/system/package.json +11 -2
  114. package/system/dist/kernel/workspace-detect.d.ts +0 -9
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-BLwgOIXb.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-_PXj626-.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-DM08Htuy.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-De7Ifvph.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-B9xpybTG.js");
2
+ const require_dist = require("./dist-B3S0ruBa.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-B1XLr4nm.js");
4
+ const require_agent_https = require("./agent-https-C8Gz2jjS.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Es as userError } from "./dist-Cw8KtuQY.mjs";
2
+ import { Rs as userError } from "./dist-9lvgpcnm.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-BsedJhrb.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-DZq8uf8L.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-B9xpybTG.js");
4
- const require_device_ca = require("./device-ca-oM-nuINR.js");
3
+ const require_dist = require("./dist-B3S0ruBa.js");
4
+ const require_device_ca = require("./device-ca-DaTT1Y9v.js");
5
5
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
6
6
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
7
7
  require("./builtins/alerts/index.js");
@@ -26,21 +26,21 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
26
26
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
27
27
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
28
28
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
29
- const require_wal_maintenance = require("./wal-maintenance-BLwgOIXb.js");
29
+ const require_wal_maintenance = require("./wal-maintenance-_PXj626-.js");
30
30
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
31
31
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
32
32
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
33
33
  require("./builtins/storage-orchestrator/index.js");
34
- const require_agent_https = require("./agent-https-B1XLr4nm.js");
35
- const require_constants = require("./constants-Bh5wQoTg.js");
34
+ const require_agent_https = require("./agent-https-C8Gz2jjS.js");
35
+ const require_constants = require("./constants-B0L3suFC.js");
36
36
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
37
37
  require("./builtins/system-config/index.js");
38
38
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
39
39
  const require_custom_action_registry = require("./custom-action-registry-JuMHGKEc.js");
40
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-BPENkOKX.js");
40
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-Dkw38L-g.js");
41
41
  const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
42
42
  const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
43
- const require_restore_archive = require("./restore-archive-BiN1yKZV.js");
43
+ const require_restore_archive = require("./restore-archive-orP6eHBd.js");
44
44
  const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
45
45
  let zod = require("zod");
46
46
  let node_crypto = require("node:crypto");
@@ -7278,19 +7278,6 @@ function isSourceNewer(packageDir) {
7278
7278
  }
7279
7279
  }
7280
7280
  /**
7281
- * Ensure a library dependency (not an addon) has a dist/ directory.
7282
- * Does NOT rebuild — in dev mode, `npm run build` should be run separately.
7283
- * Only checks that dist/ exists and has an index file.
7284
- */
7285
- function ensureLibraryBuilt(packageName, packagesDir) {
7286
- const dirName = packageName.replace("@camstack/", "");
7287
- const sourceDir = node_path.join(packagesDir, dirName);
7288
- if (!node_fs.existsSync(sourceDir)) return;
7289
- const distDir = node_path.join(sourceDir, "dist");
7290
- if (node_fs.existsSync(node_path.join(distDir, "index.js")) || node_fs.existsSync(node_path.join(distDir, "index.mjs"))) return;
7291
- console.warn(`[ensureLibraryBuilt] ${packageName} has no dist/ — run 'npm run build' first`);
7292
- }
7293
- /**
7294
7281
  * Install a single npm package into a target directory (package.json + dist/).
7295
7282
  * No validation on camstack.addons -- works for any @camstack/* package.
7296
7283
  *
@@ -8466,8 +8453,7 @@ function selectSweepableStaging(entries, inFlight, minAgeMs = STAGING_RESIDUE_MI
8466
8453
  var AddonInstaller = class AddonInstaller {
8467
8454
  addonsDir;
8468
8455
  registry;
8469
- workspaceDir;
8470
- installSource;
8456
+ bundledAddonsDir;
8471
8457
  logger;
8472
8458
  isPackageResolvable;
8473
8459
  /** Test seam — production resolves via `CAMSTACK_FRAMEWORK_DIR`. */
@@ -8490,14 +8476,12 @@ var AddonInstaller = class AddonInstaller {
8490
8476
  constructor(config, logger = noopLogger) {
8491
8477
  this.addonsDir = config.addonsDir;
8492
8478
  this.registry = config.registry;
8493
- this.workspaceDir = config.workspacePackagesDir;
8479
+ this.bundledAddonsDir = config.bundledAddonsDir;
8494
8480
  this.logger = logger;
8495
8481
  this.manifest = new AddonManifest(config.addonsDir);
8496
8482
  this.isPackageResolvable = config.isPackageResolvable;
8497
8483
  this.closureNodeModulesDir = config.closureNodeModulesDir;
8498
8484
  this.resolveLatestVersionOverride = config.resolveLatestVersion;
8499
- if (config.installSource) this.installSource = config.installSource;
8500
- else this.installSource = "npm";
8501
8485
  }
8502
8486
  /**
8503
8487
  * Where a bootstrapped npm lives when the host has none on PATH (packaged
@@ -8622,16 +8606,12 @@ var AddonInstaller = class AddonInstaller {
8622
8606
  async ensureRequiredPackages(packages) {
8623
8607
  const pkgList = packages ?? AddonInstaller.REQUIRED_PACKAGES;
8624
8608
  ensureDir(this.addonsDir);
8625
- const isLocal = this.installSource !== "npm" && this.workspaceDir != null;
8626
- this.logger.info(`Install source: ${this.installSource}${this.workspaceDir ? ` (${this.workspaceDir})` : ""}, ${pkgList.length} package(s)`);
8627
- if (isLocal && this.workspaceDir) {
8628
- ensureLibraryBuilt("@camstack/kernel", this.workspaceDir);
8629
- ensureLibraryBuilt("@camstack/types", this.workspaceDir);
8630
- }
8609
+ const isLocal = this.bundledAddonsDir != null;
8610
+ this.logger.info(`Install source: ${isLocal ? `bundle (${this.bundledAddonsDir})` : "npm"}, ${pkgList.length} package(s)`);
8631
8611
  for (const packageName of pkgList) {
8632
8612
  const addonDir = node_path.join(this.addonsDir, packageName);
8633
8613
  if (node_fs.existsSync(node_path.join(addonDir, "package.json"))) {
8634
- if (this.installSource !== "npm" || shouldSkipClosureProvidedSeed(packageName, this.isResolvableFromClosure(packageName))) {
8614
+ if (isLocal || shouldSkipClosureProvidedSeed(packageName, this.isResolvableFromClosure(packageName))) {
8635
8615
  this.logger.debug(`${packageName} — already installed, skipping`);
8636
8616
  continue;
8637
8617
  }
@@ -8884,26 +8864,12 @@ var AddonInstaller = class AddonInstaller {
8884
8864
  *
8885
8865
  * Always npm. The legacy "auto-use workspace symlink in dev" branch
8886
8866
  * was removed; local development pushes via `camstack deploy` (CLI
8887
- * tarball upload). Operators wanting to install from workspace use
8888
- * `installFromWorkspace` (explicit `'local'` codepath) instead.
8867
+ * tarball upload).
8889
8868
  */
8890
8869
  async install(packageName, version) {
8891
8870
  return this.installFromNpm(packageName, version);
8892
8871
  }
8893
8872
  /**
8894
- * Install addon from a local workspace package. Two strategies
8895
- * depending on `installSource`:
8896
- * - `'symlink'` (dev): create a directory symlink
8897
- * `addonsDir/<pkg>` → `<workspace>/packages/<pkg>`. Edits to
8898
- * the workspace are visible at the next addon load after a
8899
- * `npm run build` of that package — no copy step. Falls back
8900
- * to `'local'` if symlink creation fails (Windows w/o
8901
- * developer-mode).
8902
- * - `'local'` (default): copy `package.json` (stripped) + `dist/`
8903
- * into `addonsDir/<pkg>/`. The Electron bundled-addons path
8904
- * uses this so the runtime owns its on-disk copy.
8905
- */
8906
- /**
8907
8873
  * Re-install one addon from the running server closure.
8908
8874
  *
8909
8875
  * The closure carries a copy of every addon it declares as a dependency, and
@@ -8933,46 +8899,8 @@ var AddonInstaller = class AddonInstaller {
8933
8899
  const pkgView = readPackageJson(node_path.join(sourceDir, "package.json"));
8934
8900
  if (!pkgView) throw new Error(`Invalid package.json at ${sourceDir}`);
8935
8901
  const targetDir = node_path.join(this.addonsDir, packageName);
8936
- if (this.installSource === "symlink") try {
8937
- return await this.installSymlink(packageName, sourceDir, pkgView.raw, targetDir);
8938
- } catch (err) {
8939
- this.logger.warn(`${packageName} — symlink failed, falling back to copy: ${require_dist.errMsg(err)}`);
8940
- }
8941
8902
  return this.installCopy(packageName, sourceDir, pkgView.raw, targetDir);
8942
8903
  }
8943
- /**
8944
- * Symlink `addonsDir/<pkg>` at the workspace source dir. Dev-only.
8945
- * After this, the AddonLoader resolves `<addonsDir>/<pkg>/dist/...`
8946
- * through the symlink straight to `packages/<pkg>/dist/...` — a fresh
8947
- * `npm run build` of the package is immediately picked up by the
8948
- * next addon load.
8949
- *
8950
- * Auto-runs `ensureBuilt` so a workspace freshly cloned (with no
8951
- * dist/ yet) still boots — same auto-build hook installCopy uses.
8952
- *
8953
- * Does NOT plant peer-dep symlinks into `<targetDir>/node_modules/`
8954
- * the way the pre-`eb96df3c` symlink mode did. Self-contained
8955
- * addons bundle their own copy of types/zod/sdk — no shared
8956
- * workspace symlinks needed.
8957
- */
8958
- async installSymlink(packageName, sourceDir, pkgData, targetDir) {
8959
- await this.ensureBuilt(packageName, sourceDir, pkgData);
8960
- node_fs.rmSync(targetDir, {
8961
- recursive: true,
8962
- force: true
8963
- });
8964
- ensureDir(node_path.dirname(targetDir));
8965
- node_fs.symlinkSync(sourceDir, targetDir, "dir");
8966
- this.manifest.upsert(packageName, {
8967
- version: require_dist.asString(pkgData.version, "0.0.0"),
8968
- source: "local"
8969
- });
8970
- this.logger.info(`${packageName} — symlinked → ${sourceDir}`);
8971
- return {
8972
- name: require_dist.asString(pkgData.name, packageName),
8973
- version: require_dist.asString(pkgData.version, "0.0.0")
8974
- };
8975
- }
8976
8904
  async installCopy(packageName, sourceDir, pkgData, targetDir) {
8977
8905
  await this.ensureBuilt(packageName, sourceDir, pkgData);
8978
8906
  const distDir = node_path.join(sourceDir, "dist");
@@ -9401,7 +9329,7 @@ var AddonInstaller = class AddonInstaller {
9401
9329
  *
9402
9330
  * Steps:
9403
9331
  * 1. Rename current install dir → {addonsDir}/.backups/{name}/{ts}/
9404
- * 2. Run a fresh install (npm or local depending on installSource)
9332
+ * 2. Run a fresh install from npm
9405
9333
  * 3. Record `lastBackupDir` in the manifest entry
9406
9334
  * 4. Prune every OTHER backup of this addon — the previous one just
9407
9335
  * lost its only pointer and would otherwise be orphaned forever.
@@ -9428,15 +9356,7 @@ var AddonInstaller = class AddonInstaller {
9428
9356
  node_fs.renameSync(addonDir, backupDir);
9429
9357
  let result;
9430
9358
  try {
9431
- if (this.installSource === "local" || this.installSource === "symlink") {
9432
- const pkgDir = this.findLocalPackage(packageName);
9433
- if (pkgDir == null) throw new Error(`Local source not found for ${packageName} (installSource=${this.installSource})`);
9434
- await this.installLocal(packageName, pkgDir);
9435
- result = {
9436
- name: packageName,
9437
- version: this.manifest.get(packageName)?.version ?? current.version
9438
- };
9439
- } else result = await this.installFromNpm(packageName, version);
9359
+ result = await this.installFromNpm(packageName, version);
9440
9360
  } catch (installErr) {
9441
9361
  this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: require_dist.errMsg(installErr) } });
9442
9362
  try {
@@ -9860,14 +9780,14 @@ var AddonInstaller = class AddonInstaller {
9860
9780
  };
9861
9781
  }
9862
9782
  findLocalPackage(packageName) {
9863
- if (!this.workspaceDir) return null;
9783
+ if (!this.bundledAddonsDir) return null;
9864
9784
  const shortName = packageName.replace("@camstack/", "");
9865
9785
  for (const dirName of [
9866
9786
  shortName,
9867
9787
  `addon-${shortName}`,
9868
9788
  shortName.replace("addon-", "")
9869
9789
  ]) {
9870
- const candidate = node_path.join(this.workspaceDir, dirName);
9790
+ const candidate = node_path.join(this.bundledAddonsDir, dirName);
9871
9791
  try {
9872
9792
  const pkg = require_dist.asJsonObject(require_dist.parseJsonUnknown(node_fs.readFileSync(node_path.join(candidate, "package.json"), "utf-8")));
9873
9793
  if (pkg && require_dist.asString(pkg["name"]) === packageName) return candidate;
@@ -10102,29 +10022,6 @@ function quarantineAddonResidue(addonsDir, log) {
10102
10022
  };
10103
10023
  }
10104
10024
  //#endregion
10105
- //#region src/kernel/workspace-detect.ts
10106
- /**
10107
- * Detect whether we're running inside the monorepo workspace.
10108
- * Returns the absolute path to the packages/ directory if found, otherwise null.
10109
- *
10110
- * Single source of truth — replaces identical implementations in:
10111
- * - first-boot-installer.ts
10112
- * - addon-bridge.service.ts
10113
- */
10114
- function detectWorkspacePackagesDir(startDir) {
10115
- let current = node_path.resolve(startDir);
10116
- for (let i = 0; i < 6; i++) {
10117
- current = node_path.dirname(current);
10118
- const packagesDir = node_path.join(current, "packages");
10119
- const rootPkgJson = node_path.join(current, "package.json");
10120
- if (node_fs.existsSync(packagesDir) && node_fs.existsSync(rootPkgJson)) try {
10121
- const rootPkg = JSON.parse(node_fs.readFileSync(rootPkgJson, "utf-8"));
10122
- if (rootPkg.workspaces || rootPkg.name === "camstack-server" || rootPkg.name === "camstack") return packagesDir;
10123
- } catch {}
10124
- }
10125
- return null;
10126
- }
10127
- //#endregion
10128
10025
  //#region src/kernel/restart-coordinator.ts
10129
10026
  /**
10130
10027
  * RestartCoordinator — shared primitives for the framework live-update flow.
@@ -12157,68 +12054,15 @@ var serverSchema = zod.z.object({
12157
12054
  dataPath: zod.z.string().default(DEFAULT_DATA_PATH)
12158
12055
  });
12159
12056
  /**
12160
- * Bootstrap-time addon configuration — read PURELY from YAML, before the
12161
- * kernel can talk to the settings-store. Every field is optional.
12162
- */
12163
- var bootstrapAddonsSchema = zod.z.object({
12164
- /**
12165
- * How the launcher provisions REQUIRED_PACKAGES into `data/addons/`
12166
- * on startup.
12167
- *
12168
- * - `'npm'` — pull from the npm registry (production default).
12169
- * - `'local'` — copy `packages/<X>/` from the workspace into
12170
- * `data/addons/<X>/`. Use for the Electron-
12171
- * packaged bundle and the e2e harness.
12172
- * - `'symlink'` — point `data/addons/<X>` at the workspace source
12173
- * dir via a directory symlink. Dev-only: a
12174
- * workspace rebuild (`npm run build -w <X>`) is
12175
- * immediately reflected at the next addon load,
12176
- * no copy step. Falls back to `'local'` on
12177
- * platforms that reject symlink creation (Windows
12178
- * without developer-mode).
12179
- *
12180
- * The `CAMSTACK_INSTALL_SOURCE` env var, when set, wins over this
12181
- * field. Leave undefined to keep the launcher's default behaviour
12182
- * (npm when no workspace, local when a bundled addons dir is
12183
- * present, …).
12184
- */
12185
- installSource: zod.z.enum([
12186
- "npm",
12187
- "local",
12188
- "symlink"
12189
- ]).optional(),
12190
- /**
12191
- * Override the kernel's hard-coded `AddonInstaller.REQUIRED_PACKAGES`.
12192
- * Passing an array here REPLACES the default list entirely — useful
12193
- * for stripped-down deployments (only the bundle of addons the
12194
- * operator actually wants) and for forcing a different storage
12195
- * backend at first boot.
12196
- *
12197
- * Leave undefined to use the kernel-shipped defaults.
12198
- */
12199
- requiredAddons: zod.z.array(zod.z.string()).optional()
12200
- });
12201
- /**
12202
- * Where the keychain's master key lives (D788). config.yaml ONLY: no env var
12203
- * maps here, and the settings store may not answer it
12204
- * (`BOOTSTRAP_OWNED_SECTIONS`). Absent → the desktop OS keychain when the hub
12205
- * runs inside the desktop app, else `<dataDir>/.keychain/master.key`.
12057
+ * Bootstrap-time addon configuration. Nothing is read from it: the first-boot
12058
+ * addon set always comes from the package (the server's own addon-* deps on a
12059
+ * hub, `camstack.agentBootstrapAddons` on an agent). A retired key is stripped.
12206
12060
  */
12207
- var keychainSchema = zod.z.object({
12208
- /** A file holding 32 random bytes, base64 (or hex). Keep it OFF the data volume. */
12209
- keyFile: zod.z.string().min(1).optional(),
12210
- /**
12211
- * The key being rotated away from — consulted only to UNLOCK, so a move to a
12212
- * new key file is: new file, old one here, restart, rotate, remove this.
12213
- */
12214
- previousKeyFile: zod.z.string().min(1).optional()
12215
- });
12061
+ var bootstrapAddonsSchema = zod.z.object({});
12216
12062
  var bootstrapSchema = zod.z.object({
12217
12063
  server: serverSchema.default(serverSchema.parse({})),
12218
- /** Install source and the required-addon override (read by the launcher). */
12219
- bootstrap: bootstrapAddonsSchema.default(bootstrapAddonsSchema.parse({})),
12220
- /** Keychain master-key location (config.yaml only). */
12221
- keychain: keychainSchema.default({})
12064
+ /** The required-addon override (read by the launcher). */
12065
+ bootstrap: bootstrapAddonsSchema.default(bootstrapAddonsSchema.parse({}))
12222
12066
  });
12223
12067
  //#endregion
12224
12068
  //#region ../../node_modules/js-yaml/dist/js-yaml.mjs
@@ -14575,9 +14419,22 @@ var ENV_VAR_MAP = {
14575
14419
  * `main.ts` and `ConfigManager` come through here, so a key is
14576
14420
  * read in one place. Keys the schema does not name are stripped, not read.
14577
14421
  */
14578
- function loadBootstrapConfig(configPath) {
14579
- const merged = applyEnvOverrides((0, _camstack_types_addon.asJsonObject)(loadYaml(configPath)) ?? {});
14580
- return bootstrapSchema.parse(merged);
14422
+ function loadBootstrapConfig(configPath, options = {}) {
14423
+ const raw = (0, _camstack_types_addon.asJsonObject)(loadYaml(configPath)) ?? {};
14424
+ if (options.warnRetiredKeys === true) warnRetiredYamlKeys(raw);
14425
+ return bootstrapSchema.parse(applyEnvOverrides(raw));
14426
+ }
14427
+ /**
14428
+ * A yaml key that no longer exists is stripped by the schema; this names it
14429
+ * once so an operator who still carries it is told. Addons always come from
14430
+ * npm — a workspace build reaches a node through `camstack deploy`.
14431
+ */
14432
+ function warnRetiredYamlKeys(raw) {
14433
+ const section = raw["bootstrap"];
14434
+ if (isRecord$2(section) && "installSource" in section) console.warn("[Phase1] WARN bootstrap.installSource ignored — addons always install from npm; a workspace build reaches a node through `camstack deploy`. Remove the key.");
14435
+ if (isRecord$2(section) && "requiredAddons" in section) console.warn("[Phase1] WARN bootstrap.requiredAddons ignored — the first-boot addon set always comes from the server package. Remove the key.");
14436
+ const keychain = raw["keychain"];
14437
+ if (isRecord$2(keychain) && ("keyFile" in keychain || "previousKeyFile" in keychain)) console.warn("[Phase1] WARN keychain.keyFile / keychain.previousKeyFile ignored — the external master key is a fixed mounted path: mount the file at /run/secrets/camstack-master-key (the key being rotated away from at /run/secrets/camstack-master-key.previous). Remove the keys.");
14581
14438
  }
14582
14439
  /**
14583
14440
  * Deep-set a value in a nested plain object using a dot-notation path.
@@ -14710,8 +14567,7 @@ function createStoreSettingsView(addonId, cm) {
14710
14567
  var BOOTSTRAP_OWNED_SECTIONS = new Set([
14711
14568
  "server",
14712
14569
  "auth",
14713
- "bootstrap",
14714
- "keychain"
14570
+ "bootstrap"
14715
14571
  ]);
14716
14572
  /** The only keys under a bootstrap-owned section the store may answer. */
14717
14573
  var STORE_READABLE_BOOTSTRAP_KEYS = new Set([
@@ -28519,7 +28375,6 @@ exports.describeHttpsLeaf = require_agent_https.describeHttpsLeaf;
28519
28375
  exports.describeMeshLeaf = require_builtins_system_config_system_config_addon.describeMeshLeaf;
28520
28376
  exports.describeProviderKindDrift = describeProviderKindDrift;
28521
28377
  exports.describeRss = describeRss;
28522
- exports.detectWorkspacePackagesDir = detectWorkspacePackagesDir;
28523
28378
  exports.deviceCapResolverLink = deviceCapResolverLink;
28524
28379
  exports.deviceOfGetStatus = deviceOfGetStatus;
28525
28380
  exports.diffCapActionCensus = diffCapActionCensus;
@@ -28553,7 +28408,6 @@ Object.defineProperty(exports, "ensureFfmpeg", {
28553
28408
  return _camstack_types_node.ensureFfmpeg;
28554
28409
  }
28555
28410
  });
28556
- exports.ensureLibraryBuilt = ensureLibraryBuilt;
28557
28411
  exports.ensureModel = require_custom_action_registry.ensureModel;
28558
28412
  exports.ensureNativePrebuilds = ensureNativePrebuilds;
28559
28413
  Object.defineProperty(exports, "ensurePython", {