@camstack/system 1.2.118 → 1.2.119

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 (60) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  21. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  23. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  25. package/dist/builtins/local-network/local-network.addon.js +1 -1
  26. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  27. package/dist/builtins/loki-logging/index.js +1 -1
  28. package/dist/builtins/loki-logging/index.mjs +1 -1
  29. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  31. package/dist/builtins/platform-probe/index.js +1 -1
  32. package/dist/builtins/platform-probe/index.mjs +1 -1
  33. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  35. package/dist/builtins/snapshot/index.js +1 -1
  36. package/dist/builtins/snapshot/index.mjs +1 -1
  37. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  39. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -2
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-C2_1HCpW.js → dist-CX9qXYC4.js} +114 -11
  49. package/dist/{dist-DCTpBXm4.mjs → dist-DNbsZxNv.mjs} +114 -11
  50. package/dist/index.js +170 -9
  51. package/dist/index.mjs +169 -11
  52. package/dist/kernel/config-manager.d.ts +8 -1
  53. package/dist/kernel/index.d.ts +3 -0
  54. package/dist/kernel/isolated-builtin-phase.d.ts +21 -0
  55. package/dist/kernel/settings-door-view.d.ts +7 -0
  56. package/dist/{manifest-python-deps-CwBbX4Ut.js → manifest-python-deps-76dZLxD0.js} +11 -3
  57. package/dist/{manifest-python-deps-SGdbr9D5.mjs → manifest-python-deps-DZSNlHjU.mjs} +12 -4
  58. package/dist/{retired-settings-keys-DHRXLMPn.js → retired-settings-keys-DlIuGG4o.js} +1 -1
  59. package/dist/{retired-settings-keys-Czd76yLZ.mjs → retired-settings-keys-Dt0-obcq.mjs} +1 -1
  60. package/package.json +6 -2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-C2_1HCpW.js");
3
+ const require_dist = require("./dist-CX9qXYC4.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
6
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -25,7 +25,7 @@ const require_builtins_system_config_system_config_addon = require("./builtins/s
25
25
  require("./builtins/system-config/index.js");
26
26
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
27
27
  const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
28
- const require_manifest_python_deps = require("./manifest-python-deps-CwBbX4Ut.js");
28
+ const require_manifest_python_deps = require("./manifest-python-deps-76dZLxD0.js");
29
29
  const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
30
30
  const require_lan_http_bind = require("./lan-http-bind-DmgpFP6_.js");
31
31
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
@@ -2611,7 +2611,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
2611
2611
  }
2612
2612
  //#endregion
2613
2613
  //#region src/kernel/addon-loader.ts
2614
- function isRecord$1(value) {
2614
+ function isRecord$2(value) {
2615
2615
  return typeof value === "object" && value !== null && !Array.isArray(value);
2616
2616
  }
2617
2617
  /**
@@ -2709,9 +2709,9 @@ async function importAddonModuleFresh(entryPath) {
2709
2709
  * AddonPackageManifest + AddonDeclaration.
2710
2710
  */
2711
2711
  function toAddonPackageManifest(value) {
2712
- if (!isRecord$1(value)) return void 0;
2712
+ if (!isRecord$2(value)) return void 0;
2713
2713
  if (!Array.isArray(value.addons)) return void 0;
2714
- if (!value.addons.every((a) => isRecord$1(a) && typeof a.id === "string")) return void 0;
2714
+ if (!value.addons.every((a) => isRecord$2(a) && typeof a.id === "string")) return void 0;
2715
2715
  return value;
2716
2716
  }
2717
2717
  /** Minimal no-op logger for default parameter */
@@ -2861,7 +2861,7 @@ var AddonLoader = class {
2861
2861
  }
2862
2862
  if (!node_fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
2863
2863
  const modUnknown = await importAddonModuleFresh(entryPath);
2864
- const mod = isRecord$1(modUnknown) ? modUnknown : {};
2864
+ const mod = isRecord$2(modUnknown) ? modUnknown : {};
2865
2865
  const AddonClass = require_manifest_python_deps.resolveAddonClass(mod);
2866
2866
  if (!AddonClass) throw new Error(`No addon class in ${entryPath}`);
2867
2867
  this.addons.set(declaration.id, {
@@ -2877,7 +2877,7 @@ var AddonLoader = class {
2877
2877
  /** Load addon from a direct path (for development/testing) */
2878
2878
  async loadFromPath(addonId, modulePath, packageName, declaration, packageVersion = "0.0.0") {
2879
2879
  const modUnknown = await importAddonModuleFresh(modulePath);
2880
- const mod = isRecord$1(modUnknown) ? modUnknown : {};
2880
+ const mod = isRecord$2(modUnknown) ? modUnknown : {};
2881
2881
  const AddonClass = require_manifest_python_deps.resolveAddonClass(mod);
2882
2882
  if (!AddonClass) throw new Error(`Module ${modulePath} has no default export`);
2883
2883
  this.addons.set(addonId, {
@@ -6646,6 +6646,129 @@ function isInfraCapability(name) {
6646
6646
  return infraNames.has(name);
6647
6647
  }
6648
6648
  //#endregion
6649
+ //#region src/kernel/isolated-builtin-phase.ts
6650
+ var INFRA_NAMES = new Set(INFRA_CAPABILITIES.map((c) => c.name));
6651
+ function isolatedBuiltinPhase(capabilities) {
6652
+ return capabilities.some((c) => INFRA_NAMES.has(c.name)) ? "infra" : "consumer";
6653
+ }
6654
+ function partitionIsolatedBuiltinIds(ids, capabilitiesOf) {
6655
+ const infra = [];
6656
+ const consumers = [];
6657
+ for (const id of ids) if (isolatedBuiltinPhase(capabilitiesOf(id)) === "infra") infra.push(id);
6658
+ else consumers.push(id);
6659
+ return {
6660
+ infra,
6661
+ consumers
6662
+ };
6663
+ }
6664
+ //#endregion
6665
+ //#region src/kernel/settings-door-view.ts
6666
+ function isRecord$1(value) {
6667
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6668
+ }
6669
+ function asBlob(value) {
6670
+ return isRecord$1(value) ? value : {};
6671
+ }
6672
+ function unwrapValue(parsed) {
6673
+ if (!isRecord$1(parsed) || !("value" in parsed)) return parsed;
6674
+ return parsed.value;
6675
+ }
6676
+ async function loadPrefixed(door, collection, prefix) {
6677
+ const range = require_builtins_sqlite_storage_sqlite_settings_addon.prefixRange(prefix);
6678
+ const rows = await door.query({
6679
+ collection,
6680
+ ...range !== null ? { filter: { whereBetween: { id: [range.lo, range.hi] } } } : {}
6681
+ });
6682
+ const result = {};
6683
+ for (const row of rows) {
6684
+ if (range !== null && (row.id < range.lo || row.id >= range.hi)) continue;
6685
+ if (!row.id.startsWith(prefix)) continue;
6686
+ result[row.id.slice(prefix.length)] = unwrapValue(row.data);
6687
+ }
6688
+ return result;
6689
+ }
6690
+ async function replacePrefixed(door, collection, prefix, values, wrap) {
6691
+ const range = require_builtins_sqlite_storage_sqlite_settings_addon.prefixRange(prefix);
6692
+ if (range !== null) await door.deleteWhere({
6693
+ collection,
6694
+ filter: { whereBetween: { id: [range.lo, range.hi] } }
6695
+ });
6696
+ for (const [key, value] of Object.entries(values)) {
6697
+ if (value === void 0) continue;
6698
+ await door.set({
6699
+ collection,
6700
+ key: `${prefix}${key}`,
6701
+ value: wrap(key, value)
6702
+ });
6703
+ }
6704
+ }
6705
+ function createDoorSettingsView(addonId, door, sections) {
6706
+ const addonPrefix = `${addonId}.`;
6707
+ return {
6708
+ async readAddonStore() {
6709
+ return loadPrefixed(door, "addon-settings", addonPrefix);
6710
+ },
6711
+ async writeAddonStore(patch) {
6712
+ await replacePrefixed(door, "addon-settings", addonPrefix, {
6713
+ ...await loadPrefixed(door, "addon-settings", addonPrefix),
6714
+ ...patch
6715
+ }, (key, value) => ({
6716
+ addonId,
6717
+ key,
6718
+ value
6719
+ }));
6720
+ },
6721
+ async readDeviceStore(deviceId) {
6722
+ return loadPrefixed(door, "addon-device-settings", `${addonId}:${String(deviceId)}.`);
6723
+ },
6724
+ async writeDeviceStore(deviceId, patch) {
6725
+ const scope = `${addonId}:${String(deviceId)}.`;
6726
+ await replacePrefixed(door, "addon-device-settings", scope, {
6727
+ ...await loadPrefixed(door, "addon-device-settings", scope),
6728
+ ...patch
6729
+ }, (key, value) => ({
6730
+ addonId,
6731
+ deviceId: String(deviceId),
6732
+ key,
6733
+ value
6734
+ }));
6735
+ },
6736
+ async clearDeviceStore(deviceId) {
6737
+ const range = require_builtins_sqlite_storage_sqlite_settings_addon.prefixRange(`${addonId}:${String(deviceId)}.`);
6738
+ if (range === null) return;
6739
+ await door.deleteWhere({
6740
+ collection: "addon-device-settings",
6741
+ filter: { whereBetween: { id: [range.lo, range.hi] } }
6742
+ });
6743
+ },
6744
+ async readDeviceRuntimeState(deviceId) {
6745
+ return asBlob(await door.get({
6746
+ collection: "device-runtime-state",
6747
+ key: String(deviceId)
6748
+ }));
6749
+ },
6750
+ async writeDeviceRuntimeState(deviceId, data) {
6751
+ await door.set({
6752
+ collection: "device-runtime-state",
6753
+ key: String(deviceId),
6754
+ value: data
6755
+ });
6756
+ },
6757
+ async clearDeviceRuntimeState(deviceId) {
6758
+ await door.delete({
6759
+ collection: "device-runtime-state",
6760
+ key: String(deviceId)
6761
+ });
6762
+ },
6763
+ async getSection(section) {
6764
+ return sections.getSection(section);
6765
+ },
6766
+ async setSection(section, patch) {
6767
+ await sections.setSection(section, patch);
6768
+ }
6769
+ };
6770
+ }
6771
+ //#endregion
6649
6772
  //#region ../../node_modules/js-yaml/dist/js-yaml.mjs
6650
6773
  /*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */
6651
6774
  var __create = Object.create;
@@ -9115,6 +9238,7 @@ var ConfigManager = class ConfigManager {
9115
9238
  configPath;
9116
9239
  bootstrapConfig;
9117
9240
  settingsStore = null;
9241
+ settingsDoor = null;
9118
9242
  runtimeState;
9119
9243
  runtimeStatePath;
9120
9244
  constructor(configPath) {
@@ -9135,6 +9259,14 @@ var ConfigManager = class ConfigManager {
9135
9259
  setSettingsStore(store) {
9136
9260
  this.settingsStore = store;
9137
9261
  }
9262
+ /**
9263
+ * Wire the async `settings-store` door. Used when the engine is isolated
9264
+ * (no sync `ISettingsStore` handle on hub-main). {@link createSettingsView}
9265
+ * prefers the sync store when both are present.
9266
+ */
9267
+ setSettingsDoor(door) {
9268
+ this.settingsDoor = door;
9269
+ }
9138
9270
  get(configPath) {
9139
9271
  return this.resolveConfigValue(configPath);
9140
9272
  }
@@ -9155,8 +9287,21 @@ var ConfigManager = class ConfigManager {
9155
9287
  * Throws if the settings store is not yet wired.
9156
9288
  */
9157
9289
  set(key, value) {
9158
- if (this.settingsStore === null) throw new Error("[ConfigManager] SettingsStore not initialized -- call setSettingsStore() first");
9159
- this.settingsStore.setSystem(key, value);
9290
+ if (this.settingsStore !== null) {
9291
+ this.settingsStore.setSystem(key, value);
9292
+ return;
9293
+ }
9294
+ if (this.settingsDoor !== null) {
9295
+ this.settingsDoor.set({
9296
+ collection: "system-settings",
9297
+ key,
9298
+ value
9299
+ }).catch((err) => {
9300
+ console.error("[ConfigManager] isolated settings-store write failed", err);
9301
+ });
9302
+ return;
9303
+ }
9304
+ throw new Error("[ConfigManager] SettingsStore not initialized -- call setSettingsStore() first");
9160
9305
  }
9161
9306
  /**
9162
9307
  * Bulk-read all keys that belong to a logical section.
@@ -9277,6 +9422,19 @@ var ConfigManager = class ConfigManager {
9277
9422
  this.settingsStore.clearDeviceRuntimeState(deviceId);
9278
9423
  }
9279
9424
  createSettingsView(addonId) {
9425
+ if (this.settingsStore === null && this.settingsDoor !== null) {
9426
+ const door = this.settingsDoor;
9427
+ return createDoorSettingsView(addonId, door, {
9428
+ getSection: (section) => this.getSection(section),
9429
+ setSection: async (section, patch) => {
9430
+ for (const [key, value] of Object.entries(patch)) await door.set({
9431
+ collection: "system-settings",
9432
+ key: `${section}.${key}`,
9433
+ value
9434
+ });
9435
+ }
9436
+ });
9437
+ }
9280
9438
  const cm = this;
9281
9439
  return {
9282
9440
  async readAddonStore() {
@@ -94992,6 +95150,7 @@ exports.createAuthenticatedFileServer = require_file_data_plane.createAuthentica
94992
95150
  exports.createBroker = createBroker;
94993
95151
  exports.createBrokerDeviceManagerApi = require_manifest_python_deps.createBrokerDeviceManagerApi;
94994
95152
  exports.createCoreCapService = createCoreCapService;
95153
+ exports.createDoorSettingsView = createDoorSettingsView;
94995
95154
  exports.createFileDataPlaneHandler = require_file_data_plane.createFileDataPlaneHandler;
94996
95155
  exports.createHubCapForwardService = require_manifest_python_deps.createHubCapForwardService;
94997
95156
  exports.createHubService = createHubService;
@@ -95111,6 +95270,7 @@ exports.isCollectionArrayMethod = require_dist.isCollectionArrayMethod;
95111
95270
  exports.isInfraCapability = isInfraCapability;
95112
95271
  exports.isModelDownloaded = require_file_data_plane.isModelDownloaded;
95113
95272
  exports.isSourceNewer = isSourceNewer;
95273
+ exports.isolatedBuiltinPhase = isolatedBuiltinPhase;
95114
95274
  exports.loadTlsCert = require_lan_http_bind.loadTlsCert;
95115
95275
  exports.localEndpointPath = require_manifest_python_deps.localEndpointPath;
95116
95276
  exports.localProviderLink = require_manifest_python_deps.localProviderLink;
@@ -95118,6 +95278,7 @@ exports.mountNativeCapService = require_manifest_python_deps.mountNativeCapServi
95118
95278
  exports.parseCapAction = require_manifest_python_deps.parseCapAction;
95119
95279
  exports.parseRangeHeader = require_file_data_plane.parseRangeHeader;
95120
95280
  exports.parseTokenizedUrl = require_file_data_plane.parseTokenizedUrl;
95281
+ exports.partitionIsolatedBuiltinIds = partitionIsolatedBuiltinIds;
95121
95282
  exports.proxyToUpstream = proxyToUpstream;
95122
95283
  exports.quarantineAddonResidue = quarantineAddonResidue;
95123
95284
  exports.readExtraSans = require_lan_http_bind.readExtraSans;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { At as asNumber, B as extractNestedAddonId, Bt as parseJsonUnknown$1, Dt as ReadinessTimeoutError, Et as ReadinessRegistry, Ft as expandCapMethods, Gt as EventCategory$1, H as isArrayOutputSchema, Ht as resolveCapMount, J as lifecycleJobSchema, K as isVoidInput, Mt as createEvent, Nt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_STATUS_METHOD, U as isCollectionArrayMethod, Ut as scopeKey, Vt as readinessKey, W as isObjectInput, Z as logLevelAtMost, bt as DATAPLANE_SECRET_HEADER$1, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asString$1, kt as asJsonObject$1, ot as scopesAllowAddon, q as kebabToCamel, st as scopesAllowDeviceCap, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, vt as errMsg$1, xt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, y as addonSettingsCapability, zt as parseJsonObject } from "./dist-DCTpBXm4.mjs";
2
+ import { At as asNumber, B as extractNestedAddonId, Bt as parseJsonUnknown$1, Dt as ReadinessTimeoutError, Et as ReadinessRegistry, Ft as expandCapMethods, Gt as EventCategory$1, H as isArrayOutputSchema, Ht as resolveCapMount, J as lifecycleJobSchema, K as isVoidInput, Mt as createEvent, Nt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_STATUS_METHOD, U as isCollectionArrayMethod, Ut as scopeKey, Vt as readinessKey, W as isObjectInput, Z as logLevelAtMost, bt as DATAPLANE_SECRET_HEADER$1, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asString$1, kt as asJsonObject$1, ot as scopesAllowAddon, q as kebabToCamel, st as scopesAllowDeviceCap, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, vt as errMsg$1, xt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, y as addonSettingsCapability, zt as parseJsonObject } from "./dist-DNbsZxNv.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -16,7 +16,7 @@ import "./builtins/local-auth/index.mjs";
16
16
  import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index.mjs";
17
17
  import NativeMetricsAddon, { t as NativeMetricsProvider } from "./builtins/native-metrics/native-metrics.addon.mjs";
18
18
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
19
- import { SqliteSettingsAddon, o as SqliteSettingsBackend } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
19
+ import { SqliteSettingsAddon, o as SqliteSettingsBackend, s as prefixRange } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
20
20
  import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
21
21
  import { StorageOrchestratorAddon, n as buildStorageLocationRegistry, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
22
22
  import "./builtins/storage-orchestrator/index.mjs";
@@ -24,7 +24,7 @@ import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.
24
24
  import "./builtins/system-config/index.mjs";
25
25
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
26
26
  import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
27
- import { $ as buildNativeCapProxy, A as createHubCapForwardService, At as buildHeapSample, B as AGENT_CAP_FWD_ACTION, C as brokerTransportLink, Ct as runNpm, D as localProviderLink, Dt as HEAP_WATCH_INTERVAL_MS, E as ipcParentLink, Et as HEAP_RECLAIM_TRIGGER_MB, F as createUdsLogger, Ft as strandedMb, G as callWithServiceDiscovery, H as CapRouteResolver, I as createUdsLoggerWithControl, J as UdsLocalTransportServer, K as createLocalTransport, L as LocalChildClient, M as createUdsEventBridge, Mt as shouldReclaim, N as createUdsEventBus, Nt as startHeapWatch, O as HUB_CAP_FWD_ACTION, Ot as HEAP_WATCH_WARN_RATIO, P as udsChildLogToWorkerEntry, Pt as startRunnerHeapWatch, Q as encodeFrame, R as LocalChildRegistry, S as brokerCallForCap, St as resolveNpmInvocation, T as ipcChildLink, Tt as HEAP_RECLAIM_MIN_INTERVAL_MS, U as CapRouteError, V as AGENT_CAP_FWD_SERVICE, W as classifyCapRoute, X as localEndpointPath, Y as SocketChannel, Z as FrameDecoder, _ as createKernelHwAccel, _t as CapabilityHandle, a as getWorkerDeviceRegistry, b as __resetCapUsageRegistryForTests, bt as installManifestNativeDeps, c as setHubConnected, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as getBrokerEventBus, dt as capBareAction, et as buildUdsNativeCapProxy, f as getMoleculerEventStats, ft as capServiceName, g as AddonDepsManager, gt as DeviceRegistry, h as subscribePassthrough, ht as serializeTypedArrays, i as createUdsAddonContext, it as mountNativeCapService, j as createParentUnownedCallHandler, jt as createV8Reclaimer, k as HUB_CAP_FWD_SERVICE, kt as RUNNER_HEAP_WATCH_INTERVAL_MS, l as EVENT_TOPIC_PREFIX, lt as capActionName, m as setNodeEventInterest, mt as deserializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as createAddonService, p as registerEventBusService, pt as parseCapAction, q as UdsLocalTransportClient, r as createAddonContext, s as getOrInitReadinessRegistryForClient, st as validateProviderRegistrations, t as installManifestPythonDeps, tt as createBrokerDeviceManagerApi, u as clusterEventTopic, ut as capActionSuffix, v as resolveHwAccel, vt as CapabilityUnavailableError, w as buildLinkChain, wt as createAddonDataPlaneFacility, x as getCapUsageRegistry, xt as resolveAddonClass, y as CapUsageRegistry, yt as copyBundledNativeModules, z as UDS_NO_ROUTE_PREFIX } from "./manifest-python-deps-SGdbr9D5.mjs";
27
+ import { $ as buildNativeCapProxy, A as createHubCapForwardService, At as buildHeapSample, B as AGENT_CAP_FWD_ACTION, C as brokerTransportLink, Ct as runNpm, D as localProviderLink, Dt as HEAP_WATCH_INTERVAL_MS, E as ipcParentLink, Et as HEAP_RECLAIM_TRIGGER_MB, F as createUdsLogger, Ft as strandedMb, G as callWithServiceDiscovery, H as CapRouteResolver, I as createUdsLoggerWithControl, J as UdsLocalTransportServer, K as createLocalTransport, L as LocalChildClient, M as createUdsEventBridge, Mt as shouldReclaim, N as createUdsEventBus, Nt as startHeapWatch, O as HUB_CAP_FWD_ACTION, Ot as HEAP_WATCH_WARN_RATIO, P as udsChildLogToWorkerEntry, Pt as startRunnerHeapWatch, Q as encodeFrame, R as LocalChildRegistry, S as brokerCallForCap, St as resolveNpmInvocation, T as ipcChildLink, Tt as HEAP_RECLAIM_MIN_INTERVAL_MS, U as CapRouteError, V as AGENT_CAP_FWD_SERVICE, W as classifyCapRoute, X as localEndpointPath, Y as SocketChannel, Z as FrameDecoder, _ as createKernelHwAccel, _t as CapabilityHandle, a as getWorkerDeviceRegistry, b as __resetCapUsageRegistryForTests, bt as installManifestNativeDeps, c as setHubConnected, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as getBrokerEventBus, dt as capBareAction, et as buildUdsNativeCapProxy, f as getMoleculerEventStats, ft as capServiceName, g as AddonDepsManager, gt as DeviceRegistry, h as subscribePassthrough, ht as serializeTypedArrays, i as createUdsAddonContext, it as mountNativeCapService, j as createParentUnownedCallHandler, jt as createV8Reclaimer, k as HUB_CAP_FWD_SERVICE, kt as RUNNER_HEAP_WATCH_INTERVAL_MS, l as EVENT_TOPIC_PREFIX, lt as capActionName, m as setNodeEventInterest, mt as deserializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as createAddonService, p as registerEventBusService, pt as parseCapAction, q as UdsLocalTransportClient, r as createAddonContext, s as getOrInitReadinessRegistryForClient, st as validateProviderRegistrations, t as installManifestPythonDeps, tt as createBrokerDeviceManagerApi, u as clusterEventTopic, ut as capActionSuffix, v as resolveHwAccel, vt as CapabilityUnavailableError, w as buildLinkChain, wt as createAddonDataPlaneFacility, x as getCapUsageRegistry, xt as resolveAddonClass, y as CapUsageRegistry, yt as copyBundledNativeModules, z as UDS_NO_ROUTE_PREFIX } from "./manifest-python-deps-DZSNlHjU.mjs";
28
28
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
29
29
  import { C as evaluateExistingCert, S as SERVER_AUTH_OID, _ as CA_COMMON_NAME, a as closeLanHttp, b as LEAF_RENEWAL_WINDOW_DAYS, c as readExtraSans, d as writeExtraSans, f as writeTlsMode, g as reissueTlsLeaf, h as loadTlsCert, i as bindPendingLanHttp, l as readTlsAccessStatus, m as ensureTlsCert, n as allFamiliesListenHost, o as readLanHttpState, p as validateUploadedTls, r as applyLanHttp, s as registerLanHttpHandler, t as DEFAULT_LAN_HTTP_PORT, u as readTlsMode, v as collectCertIdentity, x as MAX_LEAF_VALIDITY_DAYS, y as CA_VALIDITY_DAYS } from "./lan-http-bind-jKrj6OjQ.mjs";
30
30
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
@@ -2604,7 +2604,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
2604
2604
  }
2605
2605
  //#endregion
2606
2606
  //#region src/kernel/addon-loader.ts
2607
- function isRecord$1(value) {
2607
+ function isRecord$2(value) {
2608
2608
  return typeof value === "object" && value !== null && !Array.isArray(value);
2609
2609
  }
2610
2610
  /**
@@ -2702,9 +2702,9 @@ async function importAddonModuleFresh(entryPath) {
2702
2702
  * AddonPackageManifest + AddonDeclaration.
2703
2703
  */
2704
2704
  function toAddonPackageManifest(value) {
2705
- if (!isRecord$1(value)) return void 0;
2705
+ if (!isRecord$2(value)) return void 0;
2706
2706
  if (!Array.isArray(value.addons)) return void 0;
2707
- if (!value.addons.every((a) => isRecord$1(a) && typeof a.id === "string")) return void 0;
2707
+ if (!value.addons.every((a) => isRecord$2(a) && typeof a.id === "string")) return void 0;
2708
2708
  return value;
2709
2709
  }
2710
2710
  /** Minimal no-op logger for default parameter */
@@ -2854,7 +2854,7 @@ var AddonLoader = class {
2854
2854
  }
2855
2855
  if (!fs$17.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
2856
2856
  const modUnknown = await importAddonModuleFresh(entryPath);
2857
- const mod = isRecord$1(modUnknown) ? modUnknown : {};
2857
+ const mod = isRecord$2(modUnknown) ? modUnknown : {};
2858
2858
  const AddonClass = resolveAddonClass(mod);
2859
2859
  if (!AddonClass) throw new Error(`No addon class in ${entryPath}`);
2860
2860
  this.addons.set(declaration.id, {
@@ -2870,7 +2870,7 @@ var AddonLoader = class {
2870
2870
  /** Load addon from a direct path (for development/testing) */
2871
2871
  async loadFromPath(addonId, modulePath, packageName, declaration, packageVersion = "0.0.0") {
2872
2872
  const modUnknown = await importAddonModuleFresh(modulePath);
2873
- const mod = isRecord$1(modUnknown) ? modUnknown : {};
2873
+ const mod = isRecord$2(modUnknown) ? modUnknown : {};
2874
2874
  const AddonClass = resolveAddonClass(mod);
2875
2875
  if (!AddonClass) throw new Error(`Module ${modulePath} has no default export`);
2876
2876
  this.addons.set(addonId, {
@@ -6639,6 +6639,129 @@ function isInfraCapability(name) {
6639
6639
  return infraNames.has(name);
6640
6640
  }
6641
6641
  //#endregion
6642
+ //#region src/kernel/isolated-builtin-phase.ts
6643
+ var INFRA_NAMES = new Set(INFRA_CAPABILITIES.map((c) => c.name));
6644
+ function isolatedBuiltinPhase(capabilities) {
6645
+ return capabilities.some((c) => INFRA_NAMES.has(c.name)) ? "infra" : "consumer";
6646
+ }
6647
+ function partitionIsolatedBuiltinIds(ids, capabilitiesOf) {
6648
+ const infra = [];
6649
+ const consumers = [];
6650
+ for (const id of ids) if (isolatedBuiltinPhase(capabilitiesOf(id)) === "infra") infra.push(id);
6651
+ else consumers.push(id);
6652
+ return {
6653
+ infra,
6654
+ consumers
6655
+ };
6656
+ }
6657
+ //#endregion
6658
+ //#region src/kernel/settings-door-view.ts
6659
+ function isRecord$1(value) {
6660
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6661
+ }
6662
+ function asBlob(value) {
6663
+ return isRecord$1(value) ? value : {};
6664
+ }
6665
+ function unwrapValue(parsed) {
6666
+ if (!isRecord$1(parsed) || !("value" in parsed)) return parsed;
6667
+ return parsed.value;
6668
+ }
6669
+ async function loadPrefixed(door, collection, prefix) {
6670
+ const range = prefixRange(prefix);
6671
+ const rows = await door.query({
6672
+ collection,
6673
+ ...range !== null ? { filter: { whereBetween: { id: [range.lo, range.hi] } } } : {}
6674
+ });
6675
+ const result = {};
6676
+ for (const row of rows) {
6677
+ if (range !== null && (row.id < range.lo || row.id >= range.hi)) continue;
6678
+ if (!row.id.startsWith(prefix)) continue;
6679
+ result[row.id.slice(prefix.length)] = unwrapValue(row.data);
6680
+ }
6681
+ return result;
6682
+ }
6683
+ async function replacePrefixed(door, collection, prefix, values, wrap) {
6684
+ const range = prefixRange(prefix);
6685
+ if (range !== null) await door.deleteWhere({
6686
+ collection,
6687
+ filter: { whereBetween: { id: [range.lo, range.hi] } }
6688
+ });
6689
+ for (const [key, value] of Object.entries(values)) {
6690
+ if (value === void 0) continue;
6691
+ await door.set({
6692
+ collection,
6693
+ key: `${prefix}${key}`,
6694
+ value: wrap(key, value)
6695
+ });
6696
+ }
6697
+ }
6698
+ function createDoorSettingsView(addonId, door, sections) {
6699
+ const addonPrefix = `${addonId}.`;
6700
+ return {
6701
+ async readAddonStore() {
6702
+ return loadPrefixed(door, "addon-settings", addonPrefix);
6703
+ },
6704
+ async writeAddonStore(patch) {
6705
+ await replacePrefixed(door, "addon-settings", addonPrefix, {
6706
+ ...await loadPrefixed(door, "addon-settings", addonPrefix),
6707
+ ...patch
6708
+ }, (key, value) => ({
6709
+ addonId,
6710
+ key,
6711
+ value
6712
+ }));
6713
+ },
6714
+ async readDeviceStore(deviceId) {
6715
+ return loadPrefixed(door, "addon-device-settings", `${addonId}:${String(deviceId)}.`);
6716
+ },
6717
+ async writeDeviceStore(deviceId, patch) {
6718
+ const scope = `${addonId}:${String(deviceId)}.`;
6719
+ await replacePrefixed(door, "addon-device-settings", scope, {
6720
+ ...await loadPrefixed(door, "addon-device-settings", scope),
6721
+ ...patch
6722
+ }, (key, value) => ({
6723
+ addonId,
6724
+ deviceId: String(deviceId),
6725
+ key,
6726
+ value
6727
+ }));
6728
+ },
6729
+ async clearDeviceStore(deviceId) {
6730
+ const range = prefixRange(`${addonId}:${String(deviceId)}.`);
6731
+ if (range === null) return;
6732
+ await door.deleteWhere({
6733
+ collection: "addon-device-settings",
6734
+ filter: { whereBetween: { id: [range.lo, range.hi] } }
6735
+ });
6736
+ },
6737
+ async readDeviceRuntimeState(deviceId) {
6738
+ return asBlob(await door.get({
6739
+ collection: "device-runtime-state",
6740
+ key: String(deviceId)
6741
+ }));
6742
+ },
6743
+ async writeDeviceRuntimeState(deviceId, data) {
6744
+ await door.set({
6745
+ collection: "device-runtime-state",
6746
+ key: String(deviceId),
6747
+ value: data
6748
+ });
6749
+ },
6750
+ async clearDeviceRuntimeState(deviceId) {
6751
+ await door.delete({
6752
+ collection: "device-runtime-state",
6753
+ key: String(deviceId)
6754
+ });
6755
+ },
6756
+ async getSection(section) {
6757
+ return sections.getSection(section);
6758
+ },
6759
+ async setSection(section, patch) {
6760
+ await sections.setSection(section, patch);
6761
+ }
6762
+ };
6763
+ }
6764
+ //#endregion
6642
6765
  //#region ../../node_modules/js-yaml/dist/js-yaml.mjs
6643
6766
  /*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */
6644
6767
  var __create = Object.create;
@@ -9108,6 +9231,7 @@ var ConfigManager = class ConfigManager {
9108
9231
  configPath;
9109
9232
  bootstrapConfig;
9110
9233
  settingsStore = null;
9234
+ settingsDoor = null;
9111
9235
  runtimeState;
9112
9236
  runtimeStatePath;
9113
9237
  constructor(configPath) {
@@ -9128,6 +9252,14 @@ var ConfigManager = class ConfigManager {
9128
9252
  setSettingsStore(store) {
9129
9253
  this.settingsStore = store;
9130
9254
  }
9255
+ /**
9256
+ * Wire the async `settings-store` door. Used when the engine is isolated
9257
+ * (no sync `ISettingsStore` handle on hub-main). {@link createSettingsView}
9258
+ * prefers the sync store when both are present.
9259
+ */
9260
+ setSettingsDoor(door) {
9261
+ this.settingsDoor = door;
9262
+ }
9131
9263
  get(configPath) {
9132
9264
  return this.resolveConfigValue(configPath);
9133
9265
  }
@@ -9148,8 +9280,21 @@ var ConfigManager = class ConfigManager {
9148
9280
  * Throws if the settings store is not yet wired.
9149
9281
  */
9150
9282
  set(key, value) {
9151
- if (this.settingsStore === null) throw new Error("[ConfigManager] SettingsStore not initialized -- call setSettingsStore() first");
9152
- this.settingsStore.setSystem(key, value);
9283
+ if (this.settingsStore !== null) {
9284
+ this.settingsStore.setSystem(key, value);
9285
+ return;
9286
+ }
9287
+ if (this.settingsDoor !== null) {
9288
+ this.settingsDoor.set({
9289
+ collection: "system-settings",
9290
+ key,
9291
+ value
9292
+ }).catch((err) => {
9293
+ console.error("[ConfigManager] isolated settings-store write failed", err);
9294
+ });
9295
+ return;
9296
+ }
9297
+ throw new Error("[ConfigManager] SettingsStore not initialized -- call setSettingsStore() first");
9153
9298
  }
9154
9299
  /**
9155
9300
  * Bulk-read all keys that belong to a logical section.
@@ -9270,6 +9415,19 @@ var ConfigManager = class ConfigManager {
9270
9415
  this.settingsStore.clearDeviceRuntimeState(deviceId);
9271
9416
  }
9272
9417
  createSettingsView(addonId) {
9418
+ if (this.settingsStore === null && this.settingsDoor !== null) {
9419
+ const door = this.settingsDoor;
9420
+ return createDoorSettingsView(addonId, door, {
9421
+ getSection: (section) => this.getSection(section),
9422
+ setSection: async (section, patch) => {
9423
+ for (const [key, value] of Object.entries(patch)) await door.set({
9424
+ collection: "system-settings",
9425
+ key: `${section}.${key}`,
9426
+ value
9427
+ });
9428
+ }
9429
+ });
9430
+ }
9273
9431
  const cm = this;
9274
9432
  return {
9275
9433
  async readAddonStore() {
@@ -94816,4 +94974,4 @@ var LifecycleJobEngine = class {
94816
94974
  }
94817
94975
  };
94818
94976
  //#endregion
94819
- export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, proxyToUpstream, quarantineAddonResidue, readExtraSans, readLanHttpState, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runNpm, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, writeExtraSans, writePendingRestart, writeTlsMode };
94977
+ export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDoorSettingsView, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readLanHttpState, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runNpm, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, writeExtraSans, writePendingRestart, writeTlsMode };
@@ -1,5 +1,5 @@
1
1
  import { AppConfig } from './config-schema.js';
2
- import { FeatureManifest } from '@camstack/types';
2
+ import { FeatureManifest, ISettingsStoreProvider } from '@camstack/types';
3
3
  export interface AddonSettingsView {
4
4
  readAddonStore(): Promise<Record<string, unknown>>;
5
5
  writeAddonStore(patch: Record<string, unknown>): Promise<void>;
@@ -76,6 +76,7 @@ export declare class ConfigManager {
76
76
  private readonly configPath;
77
77
  private bootstrapConfig;
78
78
  private settingsStore;
79
+ private settingsDoor;
79
80
  private runtimeState;
80
81
  private readonly runtimeStatePath;
81
82
  constructor(configPath: string);
@@ -85,6 +86,12 @@ export declare class ConfigManager {
85
86
  * Before this call, runtime reads/writes fall back to bootstrap + defaults.
86
87
  */
87
88
  setSettingsStore(store: ISettingsStore): void;
89
+ /**
90
+ * Wire the async `settings-store` door. Used when the engine is isolated
91
+ * (no sync `ISettingsStore` handle on hub-main). {@link createSettingsView}
92
+ * prefers the sync store when both are present.
93
+ */
94
+ setSettingsDoor(door: ISettingsStoreProvider): void;
88
95
  /**
89
96
  * Get a config value by dot-notation path.
90
97
  * Priority: bootstrap config (yaml) → settings-store → RUNTIME_DEFAULTS fallback.
@@ -21,6 +21,9 @@ export type { CapabilityRouter, CapabilityRouterFactory, ConfigReader, ProviderO
21
21
  export { CustomActionRegistry, type CustomActionEntry } from './custom-action-registry.js';
22
22
  export { INFRA_CAPABILITIES, isInfraCapability } from './infra-capabilities.js';
23
23
  export type { InfraCapability } from './infra-capabilities.js';
24
+ export { isolatedBuiltinPhase, partitionIsolatedBuiltinIds, } from './isolated-builtin-phase.js';
25
+ export type { IsolatedBuiltinPhase, IsolatedBuiltinWaves, CapabilityName, } from './isolated-builtin-phase.js';
26
+ export { createDoorSettingsView } from './settings-door-view.js';
24
27
  export { ConfigManager } from './config-manager.js';
25
28
  export type { ISettingsStore } from './config-manager.js';
26
29
  export { bootstrapSchema, RUNTIME_DEFAULTS, DEFAULT_DATA_PATH } from './config-schema.js';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Isolated builtins are not one spawn wave.
3
+ *
4
+ * Snapshot (D123) persists behind `settings-store`, so it must boot AFTER
5
+ * the in-process door. sqlite-settings IS the engine behind that door: spawn
6
+ * it in the consumer wave and every in-process builtin initialises against a
7
+ * missing store — the D44 empty-read failure, just with a fork in the way.
8
+ *
9
+ * `infra` = provides a capability in {@link INFRA_CAPABILITIES} → spawn
10
+ * BEFORE in-process builtins. `consumer` = everything else → spawn AFTER.
11
+ */
12
+ export interface CapabilityName {
13
+ readonly name: string;
14
+ }
15
+ export type IsolatedBuiltinPhase = 'infra' | 'consumer';
16
+ export declare function isolatedBuiltinPhase(capabilities: readonly CapabilityName[]): IsolatedBuiltinPhase;
17
+ export interface IsolatedBuiltinWaves {
18
+ readonly infra: readonly string[];
19
+ readonly consumers: readonly string[];
20
+ }
21
+ export declare function partitionIsolatedBuiltinIds(ids: readonly string[], capabilitiesOf: (id: string) => readonly CapabilityName[]): IsolatedBuiltinWaves;
@@ -0,0 +1,7 @@
1
+ import { ISettingsStoreProvider } from '@camstack/types';
2
+ import { AddonSettingsView } from './config-manager.js';
3
+ export interface DoorSectionAccess {
4
+ getSection(section: string): Record<string, unknown>;
5
+ setSection(section: string, patch: Record<string, unknown>): void | Promise<void>;
6
+ }
7
+ export declare function createDoorSettingsView(addonId: string, door: ISettingsStoreProvider, sections: DoorSectionAccess): AddonSettingsView;