@camstack/system 1.2.460 → 1.2.462
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/dist/addon-runner.js +21 -276
- package/dist/addon-runner.mjs +21 -276
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-Dnr_nIVx.js → agent-https-C6M6apPV.js} +1 -1
- package/dist/{agent-https-Iw3RSQup.mjs → agent-https-CC7jpktS.mjs} +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +1 -3
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +51 -502
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +51 -502
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +5 -21
- package/dist/builtins/backup-orchestrator/record-kinds.d.ts +0 -2
- package/dist/builtins/backup-orchestrator/schedule-store.d.ts +5 -13
- package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +9 -19
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/cluster-agent/record-kinds.d.ts +0 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +2 -12
- package/dist/builtins/local-auth/local-auth.addon.js +52 -191
- package/dist/builtins/local-auth/local-auth.addon.mjs +52 -191
- package/dist/builtins/local-auth/oauth-session-manager.d.ts +13 -4
- package/dist/builtins/local-auth/record-kinds.d.ts +1 -1
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +0 -9
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +0 -8
- package/dist/builtins/sqlite-storage/records/records-sql.d.ts +0 -2
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -28
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +1 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +6 -170
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +6 -170
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +3 -17
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +280 -280
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-b0e_2I-D.js → composition-sources-BPnpB9XG.js} +1 -1
- package/dist/{composition-sources-DNRZWR1j.mjs → composition-sources-BlcYzFwY.mjs} +1 -1
- package/dist/{constants-6OeJiZgi.js → constants-7ZMxWr8Z.js} +1 -1
- package/dist/{constants-BnkOdj9Q.mjs → constants-CH5UXe_G.mjs} +1 -1
- package/dist/{custom-action-registry-DStvrQKI.mjs → custom-action-registry-DZSCLBuT.mjs} +2 -0
- package/dist/{custom-action-registry-COyb49zm.js → custom-action-registry-MRyes5j0.js} +2 -0
- package/dist/{device-ca-Bnkw8GyU.mjs → device-ca-BU_gnd-q.mjs} +1 -1
- package/dist/{device-ca-CPTDs--d.js → device-ca-CUEx7sti.js} +1 -1
- package/dist/{dist-Wy8cTxg6.mjs → dist-8tWIDoWp.mjs} +15 -55
- package/dist/{dist-Bn-RNanh.js → dist-Ct-4tTeX.js} +14 -66
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-CJu0nhla.mjs → hub-mdns-ciao-Cuy7LUdz.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CTBTlia4.js → hub-mdns-ciao-DJ-Amqd7.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +89 -241
- package/dist/index.mjs +90 -237
- package/dist/kernel/index.d.ts +0 -1
- package/dist/kernel/moleculer/runner-addon-settings.d.ts +1 -6
- package/dist/kernel/moleculer/runner-device-settings.d.ts +2 -2
- package/dist/{restore-archive-CM23Pq9B.mjs → restore-archive-BDua3jO6.mjs} +78 -78
- package/dist/{restore-archive-DM1OBYq4.js → restore-archive-HwOA83v3.js} +1 -1
- package/dist/{retired-settings-keys-D_VwZiDt.js → retired-settings-keys-CGUqX-Oz.js} +0 -6
- package/dist/{retired-settings-keys-Bhwe4ymb.mjs → retired-settings-keys-C_Kjp-Bj.mjs} +1 -1
- package/dist/{wal-maintenance-Bj_MmDkr.mjs → wal-maintenance-BvzVehem.mjs} +0 -0
- package/dist/{wal-maintenance-CaJjuLHq.js → wal-maintenance-DBvuVU9s.js} +0 -0
- package/package.json +1 -1
- package/dist/builtins/sqlite-storage/retired-collections.d.ts +0 -146
- package/dist/kernel/legacy-blob-guard.d.ts +0 -63
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-Ct-4tTeX.js");
|
|
4
4
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
5
|
-
const require_device_ca = require("./device-ca-
|
|
5
|
+
const require_device_ca = require("./device-ca-CUEx7sti.js");
|
|
6
6
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
7
7
|
require("./builtins/alerts/index.js");
|
|
8
8
|
const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
|
|
@@ -11,11 +11,9 @@ const require_builtins_composer_composer_addon = require("./builtins/composer/co
|
|
|
11
11
|
require("./builtins/composer/index.js");
|
|
12
12
|
const require_formatter = require("./formatter-DqAKDlvN.js");
|
|
13
13
|
const require_builtins_console_logging_index = require("./builtins/console-logging/index.js");
|
|
14
|
-
const require_prefix_range = require("./prefix-range-D_KueXbQ.js");
|
|
15
14
|
const require_prefix_walk = require("./prefix-walk-Dv6MLZlM.js");
|
|
16
15
|
const require_builtins_core_blocks_core_blocks_addon = require("./builtins/core-blocks/core-blocks.addon.js");
|
|
17
16
|
require("./builtins/core-blocks/index.js");
|
|
18
|
-
const require_retired_settings_keys = require("./retired-settings-keys-D_VwZiDt.js");
|
|
19
17
|
const require_builtins_device_manager_device_manager_addon = require("./builtins/device-manager/device-manager.addon.js");
|
|
20
18
|
require("./builtins/device-manager/index.js");
|
|
21
19
|
const require_builtins_hub_forwarder_index = require("./builtins/hub-forwarder/index.js");
|
|
@@ -28,21 +26,21 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
28
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
29
27
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
30
28
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
31
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-DBvuVU9s.js");
|
|
32
30
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
33
31
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
34
32
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
35
33
|
require("./builtins/storage-orchestrator/index.js");
|
|
36
|
-
const require_agent_https = require("./agent-https-
|
|
37
|
-
const require_constants = require("./constants-
|
|
34
|
+
const require_agent_https = require("./agent-https-C6M6apPV.js");
|
|
35
|
+
const require_constants = require("./constants-7ZMxWr8Z.js");
|
|
38
36
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
39
37
|
require("./builtins/system-config/index.js");
|
|
40
38
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
41
|
-
const require_custom_action_registry = require("./custom-action-registry-
|
|
42
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
39
|
+
const require_custom_action_registry = require("./custom-action-registry-MRyes5j0.js");
|
|
40
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-DJ-Amqd7.js");
|
|
43
41
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
44
42
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
45
|
-
const require_restore_archive = require("./restore-archive-
|
|
43
|
+
const require_restore_archive = require("./restore-archive-HwOA83v3.js");
|
|
46
44
|
const require_coral_accelerators = require("./coral-accelerators-oUXmmbc2.js");
|
|
47
45
|
let zod = require("zod");
|
|
48
46
|
let node_crypto = require("node:crypto");
|
|
@@ -1181,23 +1179,23 @@ function formatSocketPlane(window) {
|
|
|
1181
1179
|
}
|
|
1182
1180
|
//#endregion
|
|
1183
1181
|
//#region src/kernel/moleculer/mesh-queue-report.ts
|
|
1184
|
-
function isRecord$
|
|
1182
|
+
function isRecord$6(value) {
|
|
1185
1183
|
return typeof value === "object" && value !== null;
|
|
1186
1184
|
}
|
|
1187
1185
|
/** The shape `TcpWriter` keeps its sockets in. Anything else is not a mesh. */
|
|
1188
1186
|
function writerSocketsOf(broker) {
|
|
1189
|
-
if (!isRecord$
|
|
1187
|
+
if (!isRecord$6(broker)) return void 0;
|
|
1190
1188
|
const transit = broker["transit"];
|
|
1191
|
-
if (!isRecord$
|
|
1189
|
+
if (!isRecord$6(transit)) return void 0;
|
|
1192
1190
|
const transporter = transit["tx"];
|
|
1193
|
-
if (!isRecord$
|
|
1191
|
+
if (!isRecord$6(transporter)) return void 0;
|
|
1194
1192
|
const writer = transporter["writer"];
|
|
1195
|
-
if (!isRecord$
|
|
1193
|
+
if (!isRecord$6(writer)) return void 0;
|
|
1196
1194
|
const sockets = writer["sockets"];
|
|
1197
1195
|
return sockets instanceof Map ? sockets : void 0;
|
|
1198
1196
|
}
|
|
1199
1197
|
function readSocket(nodeId, socket) {
|
|
1200
|
-
if (typeof nodeId !== "string" || !isRecord$
|
|
1198
|
+
if (typeof nodeId !== "string" || !isRecord$6(socket)) return void 0;
|
|
1201
1199
|
const queuedBytes = socket["writableLength"];
|
|
1202
1200
|
const bytesWritten = socket["bytesWritten"];
|
|
1203
1201
|
if (typeof queuedBytes !== "number" || typeof bytesWritten !== "number") return void 0;
|
|
@@ -6088,7 +6086,6 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
6088
6086
|
/**
|
|
6089
6087
|
* Record kinds owned by cluster-agent (phase 4 — hub-main).
|
|
6090
6088
|
*/
|
|
6091
|
-
var CLUSTER_NODE_HISTORY_COLLECTION = "cluster-node-history";
|
|
6092
6089
|
var NodePackageEntrySchema = zod.z.object({
|
|
6093
6090
|
name: zod.z.string(),
|
|
6094
6091
|
version: zod.z.string().nullable()
|
|
@@ -6550,7 +6547,7 @@ async function resolveUncached(options) {
|
|
|
6550
6547
|
}
|
|
6551
6548
|
//#endregion
|
|
6552
6549
|
//#region src/kernel/addon-class-resolver.ts
|
|
6553
|
-
function isRecord$
|
|
6550
|
+
function isRecord$5(value) {
|
|
6554
6551
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6555
6552
|
}
|
|
6556
6553
|
/**
|
|
@@ -6574,14 +6571,14 @@ function isRecord$6(value) {
|
|
|
6574
6571
|
function isAddonConstructor(fn) {
|
|
6575
6572
|
if (typeof fn !== "function") return false;
|
|
6576
6573
|
const proto = fn.prototype;
|
|
6577
|
-
if (!isRecord$
|
|
6574
|
+
if (!isRecord$5(proto)) return false;
|
|
6578
6575
|
return typeof proto["initialize"] === "function";
|
|
6579
6576
|
}
|
|
6580
6577
|
function resolveAddonClass(mod) {
|
|
6581
6578
|
let candidate = mod["default"];
|
|
6582
|
-
if (isRecord$
|
|
6579
|
+
if (isRecord$5(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
6583
6580
|
if (isAddonConstructor(candidate)) return candidate;
|
|
6584
|
-
if (isRecord$
|
|
6581
|
+
if (isRecord$5(candidate)) {
|
|
6585
6582
|
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
6586
6583
|
if (fn) return fn;
|
|
6587
6584
|
}
|
|
@@ -6590,7 +6587,7 @@ function resolveAddonClass(mod) {
|
|
|
6590
6587
|
}
|
|
6591
6588
|
//#endregion
|
|
6592
6589
|
//#region src/kernel/addon-loader.ts
|
|
6593
|
-
function isRecord$
|
|
6590
|
+
function isRecord$4(value) {
|
|
6594
6591
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6595
6592
|
}
|
|
6596
6593
|
/**
|
|
@@ -6688,12 +6685,12 @@ async function importAddonModuleFresh(entryPath) {
|
|
|
6688
6685
|
* AddonPackageManifest + AddonDeclaration.
|
|
6689
6686
|
*/
|
|
6690
6687
|
function isAddonPackageManifest(value) {
|
|
6691
|
-
if (!isRecord$
|
|
6688
|
+
if (!isRecord$4(value)) return false;
|
|
6692
6689
|
if (!Array.isArray(value.addons)) return false;
|
|
6693
|
-
return value.addons.every((a) => isRecord$
|
|
6690
|
+
return value.addons.every((a) => isRecord$4(a) && typeof a.id === "string");
|
|
6694
6691
|
}
|
|
6695
6692
|
function toAddonPackageManifest(value) {
|
|
6696
|
-
if (!isRecord$
|
|
6693
|
+
if (!isRecord$4(value)) return void 0;
|
|
6697
6694
|
if (!isAddonPackageManifest(value)) return void 0;
|
|
6698
6695
|
return value;
|
|
6699
6696
|
}
|
|
@@ -6858,7 +6855,7 @@ var AddonLoader = class {
|
|
|
6858
6855
|
}
|
|
6859
6856
|
if (!node_fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6860
6857
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6861
|
-
const mod = isRecord$
|
|
6858
|
+
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6862
6859
|
const AddonClass = resolveAddonClass(mod);
|
|
6863
6860
|
if (!AddonClass) throw new Error(`No addon class in ${entryPath}`);
|
|
6864
6861
|
this.addons.set(declaration.id, {
|
|
@@ -6874,7 +6871,7 @@ var AddonLoader = class {
|
|
|
6874
6871
|
/** Load addon from a direct path (for development/testing) */
|
|
6875
6872
|
async loadFromPath(addonId, modulePath, packageName, declaration, packageVersion = "0.0.0") {
|
|
6876
6873
|
const modUnknown = await importAddonModuleFresh(modulePath);
|
|
6877
|
-
const mod = isRecord$
|
|
6874
|
+
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6878
6875
|
const AddonClass = resolveAddonClass(mod);
|
|
6879
6876
|
if (!AddonClass) throw new Error(`Module ${modulePath} has no default export`);
|
|
6880
6877
|
this.addons.set(addonId, {
|
|
@@ -11805,11 +11802,11 @@ async function runHubAddonBoot(steps) {
|
|
|
11805
11802
|
}
|
|
11806
11803
|
//#endregion
|
|
11807
11804
|
//#region src/kernel/settings-door-view.ts
|
|
11808
|
-
function isRecord$
|
|
11805
|
+
function isRecord$3(value) {
|
|
11809
11806
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11810
11807
|
}
|
|
11811
11808
|
function asBlob(value) {
|
|
11812
|
-
return isRecord$
|
|
11809
|
+
return isRecord$3(value) ? value : {};
|
|
11813
11810
|
}
|
|
11814
11811
|
/**
|
|
11815
11812
|
* Every `system-settings` row under `prefix`, keyed by the suffix — or a throw.
|
|
@@ -14378,7 +14375,7 @@ import_js_yaml.default;
|
|
|
14378
14375
|
* so that file stays one class. The `console.*` calls are the documented
|
|
14379
14376
|
* residuals described on `ConfigManager` (no logger exists yet at boot).
|
|
14380
14377
|
*/
|
|
14381
|
-
function isRecord$
|
|
14378
|
+
function isRecord$2(value) {
|
|
14382
14379
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14383
14380
|
}
|
|
14384
14381
|
/** Sections that live in config.yaml. Everything else goes to the settings-store. */
|
|
@@ -14469,7 +14466,7 @@ function setNested(obj, configPath, value) {
|
|
|
14469
14466
|
[head]: value
|
|
14470
14467
|
};
|
|
14471
14468
|
const existing = obj[head];
|
|
14472
|
-
const child = isRecord$
|
|
14469
|
+
const child = isRecord$2(existing) ? existing : {};
|
|
14473
14470
|
return {
|
|
14474
14471
|
...obj,
|
|
14475
14472
|
[head]: setNested(child, rest.join("."), value)
|
|
@@ -14726,7 +14723,7 @@ var SystemSettingsMirror = class {
|
|
|
14726
14723
|
};
|
|
14727
14724
|
//#endregion
|
|
14728
14725
|
//#region src/kernel/config-manager.ts
|
|
14729
|
-
function isRecord$
|
|
14726
|
+
function isRecord$1(value) {
|
|
14730
14727
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14731
14728
|
}
|
|
14732
14729
|
function errorText(err) {
|
|
@@ -15085,7 +15082,7 @@ var ConfigManager = class {
|
|
|
15085
15082
|
const keys = configPath.split(".");
|
|
15086
15083
|
let current = this.bootstrapConfig;
|
|
15087
15084
|
for (const key of keys) {
|
|
15088
|
-
if (!isRecord$
|
|
15085
|
+
if (!isRecord$1(current)) return void 0;
|
|
15089
15086
|
current = current[key];
|
|
15090
15087
|
}
|
|
15091
15088
|
return current;
|
|
@@ -16154,7 +16151,7 @@ var RuntimeStateLoadError = class extends Error {
|
|
|
16154
16151
|
this.name = "RuntimeStateLoadError";
|
|
16155
16152
|
}
|
|
16156
16153
|
};
|
|
16157
|
-
function isRecord
|
|
16154
|
+
function isRecord(value) {
|
|
16158
16155
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16159
16156
|
}
|
|
16160
16157
|
function errorMessage(err) {
|
|
@@ -16185,7 +16182,7 @@ async function loadRuntimeStateOrRefuse(load, logger, target) {
|
|
|
16185
16182
|
} catch (err) {
|
|
16186
16183
|
return refuse(errorMessage(err), err);
|
|
16187
16184
|
}
|
|
16188
|
-
if (!isRecord
|
|
16185
|
+
if (!isRecord(answer)) return refuse(`answered ${answer === null ? "null" : typeof answer}`);
|
|
16189
16186
|
return answer;
|
|
16190
16187
|
}
|
|
16191
16188
|
//#endregion
|
|
@@ -23341,7 +23338,7 @@ function createSectionsStore(door) {
|
|
|
23341
23338
|
//#endregion
|
|
23342
23339
|
//#region src/kernel/moleculer/runner-addon-settings.ts
|
|
23343
23340
|
/** @param client the hub's `settingsStore` client; `undefined` makes every call THROW. */
|
|
23344
|
-
function createRunnerAddonSettings(client, addonId
|
|
23341
|
+
function createRunnerAddonSettings(client, addonId) {
|
|
23345
23342
|
if (client === void 0) {
|
|
23346
23343
|
const refuse = async () => {
|
|
23347
23344
|
throw new Error(`settings of "${addonId}": settings store not wired`);
|
|
@@ -23363,22 +23360,10 @@ function createRunnerAddonSettings(client, addonId, before = async () => {}) {
|
|
|
23363
23360
|
};
|
|
23364
23361
|
}
|
|
23365
23362
|
const door = {
|
|
23366
|
-
query:
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
get: async (input) => {
|
|
23371
|
-
await before();
|
|
23372
|
-
return client.get.query(input);
|
|
23373
|
-
},
|
|
23374
|
-
set: async (input) => {
|
|
23375
|
-
await before();
|
|
23376
|
-
return client.set.mutate(input);
|
|
23377
|
-
},
|
|
23378
|
-
transact: async (input) => {
|
|
23379
|
-
await before();
|
|
23380
|
-
return client.transact.mutate(input);
|
|
23381
|
-
}
|
|
23363
|
+
query: (input) => client.query.query(input),
|
|
23364
|
+
get: (input) => client.get.query(input),
|
|
23365
|
+
set: (input) => client.set.mutate(input),
|
|
23366
|
+
transact: (input) => client.transact.mutate(input)
|
|
23382
23367
|
};
|
|
23383
23368
|
const store = require_builtins_core_blocks_core_blocks_addon.createAddonSettingsStore(door, addonId);
|
|
23384
23369
|
const sections = createSectionsStore(door);
|
|
@@ -23419,159 +23404,6 @@ function createRunnerAddonSettings(client, addonId, before = async () => {}) {
|
|
|
23419
23404
|
};
|
|
23420
23405
|
}
|
|
23421
23406
|
//#endregion
|
|
23422
|
-
//#region src/kernel/addon-refused-error.ts
|
|
23423
|
-
/**
|
|
23424
|
-
* A deterministic Init refusal (D877): an addon that says, in a typed way,
|
|
23425
|
-
* "I will not start, and here is why" - as opposed to a crash.
|
|
23426
|
-
*
|
|
23427
|
-
* The difference matters to the supervisor. A crash may be transient (a camera
|
|
23428
|
-
* dropping mid-handshake) and is bounded by the D6 circuit-breaker; a refusal
|
|
23429
|
-
* repeats identically until somebody changes the world (runs a migration,
|
|
23430
|
-
* fixes a setting), so counting it toward the breaker only turns "waiting for
|
|
23431
|
-
* the operator" into a terminal `failed` with a stack trace nobody needed.
|
|
23432
|
-
* On 2026-10-17 twenty-eight addons refused on an unmigrated store, exited five
|
|
23433
|
-
* times in ten seconds and were marked `failed` as if they had crashed.
|
|
23434
|
-
*
|
|
23435
|
-
* The runner reports a refusal to its parent (see `runner-refusal.ts`); the
|
|
23436
|
-
* process service parks the runner in `refused` with the reason and retries it
|
|
23437
|
-
* only when an operator acts.
|
|
23438
|
-
*/
|
|
23439
|
-
var AddonRefusedError = class extends Error {
|
|
23440
|
-
/** Stable, greppable cause, e.g. `unmigrated-settings`. */
|
|
23441
|
-
code;
|
|
23442
|
-
/** What the operator does about it. */
|
|
23443
|
-
remedy;
|
|
23444
|
-
constructor(code, message, remedy, options) {
|
|
23445
|
-
super(message, options);
|
|
23446
|
-
this.name = "AddonRefusedError";
|
|
23447
|
-
this.code = code;
|
|
23448
|
-
this.remedy = remedy;
|
|
23449
|
-
}
|
|
23450
|
-
};
|
|
23451
|
-
/**
|
|
23452
|
-
* The refusal in `err`'s cause chain, if any. An addon that wraps the error it
|
|
23453
|
-
* got from the kernel (`new Error('init failed', { cause })`) is still refusing.
|
|
23454
|
-
*/
|
|
23455
|
-
function findAddonRefusal(err) {
|
|
23456
|
-
const seen = /* @__PURE__ */ new Set();
|
|
23457
|
-
let current = err;
|
|
23458
|
-
while (current !== null && current !== void 0 && !seen.has(current)) {
|
|
23459
|
-
if (current instanceof AddonRefusedError) return current;
|
|
23460
|
-
seen.add(current);
|
|
23461
|
-
current = current instanceof Error ? current.cause : void 0;
|
|
23462
|
-
}
|
|
23463
|
-
return null;
|
|
23464
|
-
}
|
|
23465
|
-
//#endregion
|
|
23466
|
-
//#region src/kernel/legacy-blob-guard.ts
|
|
23467
|
-
/** Root keys retired long before D870: they never count as "settings still to migrate". */
|
|
23468
|
-
var OWN_RETIRED_ROOT_KEYS = new Set([
|
|
23469
|
-
"recordingConfigs",
|
|
23470
|
-
"recordingExports",
|
|
23471
|
-
"recordingOpsLog",
|
|
23472
|
-
"probeSnapshots",
|
|
23473
|
-
"rtspTokens",
|
|
23474
|
-
"profileMap"
|
|
23475
|
-
]);
|
|
23476
|
-
/** Is `key` of `addonId` a root key that was retired (and must not be migrated)? */
|
|
23477
|
-
function isRetiredRootKey(addonId, key) {
|
|
23478
|
-
if (OWN_RETIRED_ROOT_KEYS.has(key)) return true;
|
|
23479
|
-
return require_retired_settings_keys.RETIRED_SETTINGS_KEYS.some((spec) => spec.namespace === addonId && (spec.keys.includes(key) || spec.perNodeKeys.some((k) => key === k || key.startsWith(`${k}@`))));
|
|
23480
|
-
}
|
|
23481
|
-
/** Stable `code` of the D870 refusal. */
|
|
23482
|
-
var UNMIGRATED_SETTINGS_CODE = "unmigrated-settings";
|
|
23483
|
-
/** The remedy the refusal (and the update pre-flight) names. */
|
|
23484
|
-
var UNMIGRATED_SETTINGS_REMEDY = "Run scripts/hub/migrate-device-store.ts --copy --apply (D870), then restart the addon.";
|
|
23485
|
-
var UnmigratedSettingsError = class extends AddonRefusedError {
|
|
23486
|
-
constructor(addonId, what) {
|
|
23487
|
-
super(UNMIGRATED_SETTINGS_CODE, `addon "${addonId}" refuses to start: ${what} - the settings it had are still in the per-addon tables and the standard store holds none. Run scripts/hub/migrate-device-store.ts --copy --apply (D870) before starting it.`, UNMIGRATED_SETTINGS_REMEDY);
|
|
23488
|
-
this.name = "UnmigratedSettingsError";
|
|
23489
|
-
}
|
|
23490
|
-
};
|
|
23491
|
-
async function countOf(client, input) {
|
|
23492
|
-
const n = await client.count.query(input);
|
|
23493
|
-
if (typeof n !== "number") throw new Error("settings store answered a non-number to a count");
|
|
23494
|
-
return n;
|
|
23495
|
-
}
|
|
23496
|
-
var LEGACY_PAGE = 500;
|
|
23497
|
-
var LEGACY_PAGE_BUDGET = 200;
|
|
23498
|
-
var ID_TAIL = "";
|
|
23499
|
-
function isRecord(value) {
|
|
23500
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23501
|
-
}
|
|
23502
|
-
/**
|
|
23503
|
-
* Does the addon's per-device blob table hold a row the copy would actually
|
|
23504
|
-
* migrate - a positive numeric id with a non-empty record? An addon whose rows
|
|
23505
|
-
* the copy skips anyway must not be refused for them.
|
|
23506
|
-
*/
|
|
23507
|
-
async function hasMigratableDeviceRow(client, addonId) {
|
|
23508
|
-
let cursor = "";
|
|
23509
|
-
for (let page = 0; page < LEGACY_PAGE_BUDGET; page++) {
|
|
23510
|
-
const rows = await client.query.query({
|
|
23511
|
-
namespace: addonId,
|
|
23512
|
-
collection: "addon-devices",
|
|
23513
|
-
filter: {
|
|
23514
|
-
whereBetween: { id: [cursor, ID_TAIL] },
|
|
23515
|
-
orderBy: {
|
|
23516
|
-
field: "id",
|
|
23517
|
-
direction: "asc"
|
|
23518
|
-
},
|
|
23519
|
-
limit: LEGACY_PAGE
|
|
23520
|
-
}
|
|
23521
|
-
});
|
|
23522
|
-
if (!Array.isArray(rows)) throw new Error("settings store answered a non-list to a query");
|
|
23523
|
-
let lastId = cursor;
|
|
23524
|
-
for (const row of rows) {
|
|
23525
|
-
if (!isRecord(row) || typeof row["id"] !== "string") continue;
|
|
23526
|
-
lastId = row["id"];
|
|
23527
|
-
const id = Number(row["id"]);
|
|
23528
|
-
const data = row["data"];
|
|
23529
|
-
if (Number.isInteger(id) && id > 0 && isRecord(data) && Object.keys(data).length > 0) return true;
|
|
23530
|
-
}
|
|
23531
|
-
if (rows.length < LEGACY_PAGE || lastId === cursor) return false;
|
|
23532
|
-
cursor = lastId;
|
|
23533
|
-
}
|
|
23534
|
-
throw new Error(`addon "${addonId}": more legacy blob pages than the guard will read`);
|
|
23535
|
-
}
|
|
23536
|
-
/**
|
|
23537
|
-
* THROWS when the addon has blob settings and the standard store has none of
|
|
23538
|
-
* its own. A store that cannot be asked also throws: it is not "no blobs".
|
|
23539
|
-
*/
|
|
23540
|
-
async function assertLegacyBlobsMigrated(client, addonId, logger) {
|
|
23541
|
-
const legacyDevices = await hasMigratableDeviceRow(client, addonId);
|
|
23542
|
-
const root = await client.get.query({
|
|
23543
|
-
namespace: addonId,
|
|
23544
|
-
collection: "addon-settings",
|
|
23545
|
-
key: "root"
|
|
23546
|
-
});
|
|
23547
|
-
const legacySettings = isRecord(root) && Object.keys(root).some((key) => !isRetiredRootKey(addonId, key));
|
|
23548
|
-
if (!legacyDevices && !legacySettings) return;
|
|
23549
|
-
const rangeOf = (prefix) => {
|
|
23550
|
-
const range = require_prefix_range.prefixRange(prefix);
|
|
23551
|
-
if (range === null) throw new Error(`no id range for addon "${addonId}"`);
|
|
23552
|
-
return { whereBetween: { id: [range.lo, range.hi] } };
|
|
23553
|
-
};
|
|
23554
|
-
const newDevices = await countOf(client, {
|
|
23555
|
-
collection: "addon-device-settings",
|
|
23556
|
-
filter: rangeOf(`${addonId}:`)
|
|
23557
|
-
});
|
|
23558
|
-
const newSettings = await countOf(client, {
|
|
23559
|
-
collection: "addon-settings",
|
|
23560
|
-
filter: rangeOf(`${addonId}.`)
|
|
23561
|
-
});
|
|
23562
|
-
const problems = [];
|
|
23563
|
-
if (legacyDevices && newDevices === 0) problems.push("per-device blobs");
|
|
23564
|
-
if (legacySettings && newSettings === 0) problems.push("an addon settings blob");
|
|
23565
|
-
if (problems.length === 0) return;
|
|
23566
|
-
const error = new UnmigratedSettingsError(addonId, problems.join(" and "));
|
|
23567
|
-
logger.error(error.message, { meta: {
|
|
23568
|
-
addonId,
|
|
23569
|
-
newDevices,
|
|
23570
|
-
newSettings
|
|
23571
|
-
} });
|
|
23572
|
-
throw error;
|
|
23573
|
-
}
|
|
23574
|
-
//#endregion
|
|
23575
23407
|
//#region src/kernel/moleculer/runner-device-settings.ts
|
|
23576
23408
|
/**
|
|
23577
23409
|
* The forked runner's `ctx.settings` device methods (D870).
|
|
@@ -23584,20 +23416,11 @@ async function assertLegacyBlobsMigrated(client, addonId, logger) {
|
|
|
23584
23416
|
* blob per device; a hub-side write to the rows was invisible to it.
|
|
23585
23417
|
*/
|
|
23586
23418
|
/** The door slice the per-device store needs, over a tRPC client. */
|
|
23587
|
-
function doorOverClient(client
|
|
23419
|
+
function doorOverClient(client) {
|
|
23588
23420
|
return {
|
|
23589
|
-
query:
|
|
23590
|
-
|
|
23591
|
-
|
|
23592
|
-
},
|
|
23593
|
-
transact: async (input) => {
|
|
23594
|
-
await before();
|
|
23595
|
-
return client.transact.mutate(input);
|
|
23596
|
-
},
|
|
23597
|
-
deleteWhere: async (input) => {
|
|
23598
|
-
await before();
|
|
23599
|
-
return client.deleteWhere.mutate(input);
|
|
23600
|
-
}
|
|
23421
|
+
query: (input) => client.query.query(input),
|
|
23422
|
+
transact: (input) => client.transact.mutate(input),
|
|
23423
|
+
deleteWhere: (input) => client.deleteWhere.mutate(input)
|
|
23601
23424
|
};
|
|
23602
23425
|
}
|
|
23603
23426
|
/**
|
|
@@ -23605,7 +23428,7 @@ function doorOverClient(client, before = async () => {}) {
|
|
|
23605
23428
|
* runner has none — every call then THROWS: a store that could not be asked
|
|
23606
23429
|
* is not an empty one.
|
|
23607
23430
|
*/
|
|
23608
|
-
function createRunnerDeviceSettings(client, addonId
|
|
23431
|
+
function createRunnerDeviceSettings(client, addonId) {
|
|
23609
23432
|
if (client === void 0) {
|
|
23610
23433
|
const refuse = () => {
|
|
23611
23434
|
throw new Error(`device settings of "${addonId}": settings store not wired`);
|
|
@@ -23618,7 +23441,7 @@ function createRunnerDeviceSettings(client, addonId, before = async () => {}) {
|
|
|
23618
23441
|
clearDeviceStore: async () => refuse()
|
|
23619
23442
|
};
|
|
23620
23443
|
}
|
|
23621
|
-
const store = require_builtins_device_manager_device_manager_addon.createDeviceSettingsStore(doorOverClient(client
|
|
23444
|
+
const store = require_builtins_device_manager_device_manager_addon.createDeviceSettingsStore(doorOverClient(client), addonId);
|
|
23622
23445
|
return {
|
|
23623
23446
|
readDeviceStore: (deviceId) => require_builtins_device_manager_device_manager_addon.readDeviceOrThrow(store, deviceId),
|
|
23624
23447
|
readDeviceStoreBatch: (ids) => store.readBatch(ids),
|
|
@@ -23917,23 +23740,9 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
23917
23740
|
}
|
|
23918
23741
|
};
|
|
23919
23742
|
const deviceSettingsClient = Reflect.get(api, "settingsStore");
|
|
23920
|
-
let blobsChecked = null;
|
|
23921
|
-
const bootGuard = () => {
|
|
23922
|
-
const client = deviceSettingsClient;
|
|
23923
|
-
if (client === void 0) return Promise.resolve();
|
|
23924
|
-
blobsChecked ??= assertLegacyBlobsMigrated({
|
|
23925
|
-
get: { query: (input) => client.get.query(input) },
|
|
23926
|
-
query: { query: (input) => client.query.query(input) },
|
|
23927
|
-
count: { query: (input) => client.count.query(input) }
|
|
23928
|
-
}, addonId, scopedLogger).catch((err) => {
|
|
23929
|
-
blobsChecked = null;
|
|
23930
|
-
throw err;
|
|
23931
|
-
});
|
|
23932
|
-
return blobsChecked;
|
|
23933
|
-
};
|
|
23934
23743
|
const settingsView = {
|
|
23935
|
-
...createRunnerAddonSettings(deviceSettingsClient, addonId
|
|
23936
|
-
...createRunnerDeviceSettings(deviceSettingsClient, addonId
|
|
23744
|
+
...createRunnerAddonSettings(deviceSettingsClient, addonId),
|
|
23745
|
+
...createRunnerDeviceSettings(deviceSettingsClient, addonId),
|
|
23937
23746
|
async readDeviceRuntimeState(deviceId) {
|
|
23938
23747
|
return readBlob("device-runtime-state", String(deviceId));
|
|
23939
23748
|
},
|
|
@@ -26607,6 +26416,50 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26607
26416
|
};
|
|
26608
26417
|
}
|
|
26609
26418
|
//#endregion
|
|
26419
|
+
//#region src/kernel/addon-refused-error.ts
|
|
26420
|
+
/**
|
|
26421
|
+
* A deterministic Init refusal (D877): an addon that says, in a typed way,
|
|
26422
|
+
* "I will not start, and here is why" - as opposed to a crash.
|
|
26423
|
+
*
|
|
26424
|
+
* The difference matters to the supervisor. A crash may be transient (a camera
|
|
26425
|
+
* dropping mid-handshake) and is bounded by the D6 circuit-breaker; a refusal
|
|
26426
|
+
* repeats identically until somebody changes the world (runs a migration,
|
|
26427
|
+
* fixes a setting), so counting it toward the breaker only turns "waiting for
|
|
26428
|
+
* the operator" into a terminal `failed` with a stack trace nobody needed.
|
|
26429
|
+
* On 2026-10-17 twenty-eight addons refused on an unmigrated store, exited five
|
|
26430
|
+
* times in ten seconds and were marked `failed` as if they had crashed.
|
|
26431
|
+
*
|
|
26432
|
+
* The runner reports a refusal to its parent (see `runner-refusal.ts`); the
|
|
26433
|
+
* process service parks the runner in `refused` with the reason and retries it
|
|
26434
|
+
* only when an operator acts.
|
|
26435
|
+
*/
|
|
26436
|
+
var AddonRefusedError = class extends Error {
|
|
26437
|
+
/** Stable, greppable cause, e.g. `unmigrated-settings`. */
|
|
26438
|
+
code;
|
|
26439
|
+
/** What the operator does about it. */
|
|
26440
|
+
remedy;
|
|
26441
|
+
constructor(code, message, remedy, options) {
|
|
26442
|
+
super(message, options);
|
|
26443
|
+
this.name = "AddonRefusedError";
|
|
26444
|
+
this.code = code;
|
|
26445
|
+
this.remedy = remedy;
|
|
26446
|
+
}
|
|
26447
|
+
};
|
|
26448
|
+
/**
|
|
26449
|
+
* The refusal in `err`'s cause chain, if any. An addon that wraps the error it
|
|
26450
|
+
* got from the kernel (`new Error('init failed', { cause })`) is still refusing.
|
|
26451
|
+
*/
|
|
26452
|
+
function findAddonRefusal(err) {
|
|
26453
|
+
const seen = /* @__PURE__ */ new Set();
|
|
26454
|
+
let current = err;
|
|
26455
|
+
while (current !== null && current !== void 0 && !seen.has(current)) {
|
|
26456
|
+
if (current instanceof AddonRefusedError) return current;
|
|
26457
|
+
seen.add(current);
|
|
26458
|
+
current = current instanceof Error ? current.cause : void 0;
|
|
26459
|
+
}
|
|
26460
|
+
return null;
|
|
26461
|
+
}
|
|
26462
|
+
//#endregion
|
|
26610
26463
|
//#region src/kernel/moleculer/process-context.ts
|
|
26611
26464
|
function createScopedProcessManager(broker, addonId) {
|
|
26612
26465
|
return {
|
|
@@ -27731,7 +27584,6 @@ exports.CAP_ACTION_UNLABELLED = CAP_ACTION_UNLABELLED;
|
|
|
27731
27584
|
exports.CAP_METHOD_NOT_IMPLEMENTED = CAP_METHOD_NOT_IMPLEMENTED;
|
|
27732
27585
|
exports.CA_COMMON_NAME = require_agent_https.CA_COMMON_NAME;
|
|
27733
27586
|
exports.CA_VALIDITY_DAYS = require_agent_https.CA_VALIDITY_DAYS;
|
|
27734
|
-
exports.CLUSTER_NODE_HISTORY_COLLECTION = CLUSTER_NODE_HISTORY_COLLECTION;
|
|
27735
27587
|
exports.CORE_CAP_SERVICE_NAME = CORE_CAP_SERVICE_NAME;
|
|
27736
27588
|
exports.CalendarsAddon = require_builtins_calendars_calendars_addon.CalendarsAddon;
|
|
27737
27589
|
exports.CapRouteError = CapRouteError;
|
|
@@ -27907,14 +27759,11 @@ exports.TlsTcpTransporter = require_builtins_system_config_system_config_addon.T
|
|
|
27907
27759
|
exports.ToastService = ToastService;
|
|
27908
27760
|
exports.UDS_NO_ROUTE_PREFIX = UDS_NO_ROUTE_PREFIX;
|
|
27909
27761
|
exports.UNCLAIMED = UNCLAIMED;
|
|
27910
|
-
exports.UNMIGRATED_SETTINGS_CODE = UNMIGRATED_SETTINGS_CODE;
|
|
27911
|
-
exports.UNMIGRATED_SETTINGS_REMEDY = UNMIGRATED_SETTINGS_REMEDY;
|
|
27912
27762
|
exports.UPLOADED_CA_FILE = require_hub_mdns_ciao.UPLOADED_CA_FILE;
|
|
27913
27763
|
exports.USER_MANAGEMENT_INTERNAL = require_builtins_local_auth_local_auth_addon.USER_MANAGEMENT_INTERNAL;
|
|
27914
27764
|
exports.UdsLocalTransportClient = UdsLocalTransportClient;
|
|
27915
27765
|
exports.UdsLocalTransportServer = UdsLocalTransportServer;
|
|
27916
27766
|
exports.UnlockTicketJtiStore = require_builtins_system_config_system_config_addon.UnlockTicketJtiStore;
|
|
27917
|
-
exports.UnmigratedSettingsError = UnmigratedSettingsError;
|
|
27918
27767
|
exports.UserManager = require_builtins_local_auth_local_auth_addon.UserManager;
|
|
27919
27768
|
exports.WinstonDestination = require_builtins_winston_logging_index.WinstonDestination$1;
|
|
27920
27769
|
exports.WinstonLoggingAddon = require_builtins_winston_logging_index.WinstonLoggingAddon$1;
|
|
@@ -27932,7 +27781,6 @@ exports.answerClaimedGetStatus = answerClaimedGetStatus;
|
|
|
27932
27781
|
exports.applyCertificateToListener = require_hub_mdns_ciao.applyCertificateToListener;
|
|
27933
27782
|
exports.applyLanHttp = require_hub_mdns_ciao.applyLanHttp;
|
|
27934
27783
|
exports.asBrokerLike = asBrokerLike;
|
|
27935
|
-
exports.assertLegacyBlobsMigrated = assertLegacyBlobsMigrated;
|
|
27936
27784
|
exports.attachUserManagementInternal = require_builtins_local_auth_local_auth_addon.attachUserManagementInternal;
|
|
27937
27785
|
exports.attributeStall = require_custom_action_registry.attributeStall;
|
|
27938
27786
|
exports.backupOrchestratorRecordKinds = require_restore_archive.backupOrchestratorRecordKinds;
|