@camstack/server 1.2.727 → 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.
- package/CHANGELOG.md +15 -0
- package/dist/agent/main.js +2 -14
- package/dist/api/core/cap-providers.js +0 -7
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +1872 -1847
- package/dist/boot/boot-config.js +1 -1
- package/dist/core/addon/addon-package.service.js +3 -105
- package/dist/core/addon-bridge/addon-bridge.service.js +1 -5
- package/dist/launcher.js +12 -124
- package/package.json +22 -11
- package/system/dist/addon-runner.js +1 -2
- package/system/dist/addon-runner.mjs +1 -2
- package/system/dist/{agent-https-Cm8wrQ3N.js → agent-https-BMmfwElS.js} +1 -1
- package/system/dist/{agent-https-BFjd0kVS.mjs → agent-https-BXB7X23w.mjs} +1 -1
- package/system/dist/auth/user-manager.d.ts +9 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/device-history/device-history.addon.d.ts +4 -0
- package/system/dist/builtins/device-history/device-history.addon.js +769 -17
- package/system/dist/builtins/device-history/device-history.addon.mjs +769 -17
- package/system/dist/builtins/device-history/runs/device-runs-provider.d.ts +7 -0
- package/system/dist/builtins/device-history/runs/device-runs-record-kinds.d.ts +15 -0
- package/system/dist/builtins/device-history/runs/device-runs-service.d.ts +42 -0
- package/system/dist/builtins/device-history/runs/energy-from-history.d.ts +22 -0
- package/system/dist/builtins/device-history/runs/run-recorder.d.ts +111 -0
- package/system/dist/builtins/device-history/runs/slice-readers.d.ts +9 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +47 -38
- package/system/dist/builtins/keychain/index.mjs +47 -38
- package/system/dist/builtins/keychain/key-sources.d.ts +12 -7
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +21 -3
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +21 -3
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +11 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +11 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{composition-sources-CMLKuImu.mjs → composition-sources-BCfgVe9V.mjs} +1 -1
- package/system/dist/{composition-sources-DbRy2m6-.js → composition-sources-D6b0p8Hl.js} +1 -1
- package/system/dist/{constants-z0p-SIpO.mjs → constants-BQLyzulL.mjs} +1 -1
- package/system/dist/{constants-BpTCwvl7.js → constants-ePrW9DMj.js} +1 -1
- package/system/dist/{device-ca-IFiCeZUY.mjs → device-ca-C8X1AGHU.mjs} +2 -2
- package/system/dist/{device-ca-tXY-d38g.js → device-ca-Dh9wjg_e.js} +2 -2
- package/system/dist/{dist-BvVArCmo.js → dist-D-7p7cJp.js} +219 -36
- package/system/dist/{dist-8RpYuR_b.mjs → dist-XvOCXwnA.mjs} +208 -37
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-BGTQuEAj.js → hub-mdns-ciao-BFZZAJIx.js} +2 -2
- package/system/dist/{hub-mdns-ciao-ChnLH7jR.mjs → hub-mdns-ciao-CGwz5__T.mjs} +2 -2
- package/system/dist/index.js +40 -186
- package/system/dist/index.mjs +41 -185
- package/system/dist/kernel/addon-installer.d.ts +9 -60
- package/system/dist/kernel/bootstrap-config.d.ts +3 -1
- package/system/dist/kernel/config-schema.d.ts +2 -11
- package/system/dist/kernel/fs-utils.d.ts +0 -6
- package/system/dist/kernel/index.d.ts +2 -3
- package/system/dist/{restore-archive-CmljxWcJ.js → restore-archive-3e5X8g6h.js} +1 -1
- package/system/dist/{restore-archive-gcyWu7gb.mjs → restore-archive-B3M3ZwAl.mjs} +82 -82
- package/system/dist/{retention-DwnQVMqM.mjs → retention-BPxZj_Qf.mjs} +1 -1
- package/system/dist/{retention-DRAqh5oQ.js → retention-DacNjIXz.js} +1 -1
- package/system/dist/{wal-maintenance-CH6boUNm.mjs → wal-maintenance-C4K7pX1x.mjs} +0 -0
- package/system/dist/{wal-maintenance-DOIYwfc8.js → wal-maintenance-Dguwwx4N.js} +0 -0
- package/system/package.json +5 -2
- package/system/dist/kernel/workspace-detect.d.ts +0 -9
package/system/dist/index.js
CHANGED
|
@@ -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-
|
|
4
|
-
const require_device_ca = require("./device-ca-
|
|
3
|
+
const require_dist = require("./dist-D-7p7cJp.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-Dh9wjg_e.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-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-Dguwwx4N.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-
|
|
35
|
-
const require_constants = require("./constants-
|
|
34
|
+
const require_agent_https = require("./agent-https-BMmfwElS.js");
|
|
35
|
+
const require_constants = require("./constants-ePrW9DMj.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-
|
|
40
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-BFZZAJIx.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-
|
|
43
|
+
const require_restore_archive = require("./restore-archive-3e5X8g6h.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
|
-
|
|
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.
|
|
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.
|
|
8626
|
-
this.logger.info(`Install source: ${
|
|
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 (
|
|
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).
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
|
12161
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
14580
|
-
|
|
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", {
|