@camstack/system 1.2.441 → 1.2.443
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 +72 -2
- package/dist/addon-runner.mjs +72 -2
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/auth/totp-manager.d.ts +46 -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.d.ts +41 -1
- package/dist/builtins/alerts/alerts.addon.js +638 -26
- package/dist/builtins/alerts/alerts.addon.mjs +638 -26
- package/dist/builtins/alerts/critical-push.d.ts +86 -0
- package/dist/builtins/alerts/runner-alert.d.ts +71 -0
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- 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/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/block-package.d.ts +4 -2
- package/dist/builtins/core-blocks/block-settings-store.d.ts +65 -19
- package/dist/builtins/core-blocks/core-blocks.addon.js +365 -38
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +365 -38
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- 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 +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +226 -17
- package/dist/builtins/local-auth/local-auth.addon.mjs +226 -17
- 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 +2 -2
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
- package/dist/builtins/platform-probe/index.js +2 -2
- package/dist/builtins/platform-probe/index.mjs +2 -2
- 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/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/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- 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 +2 -2
- package/dist/builtins/system-config/system-config.addon.mjs +2 -2
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BG-W2U0d.js → composition-sources-BUXX1e8j.js} +1 -1
- package/dist/{composition-sources-ByNISOnW.mjs → composition-sources-C8tUG2uL.mjs} +1 -1
- package/dist/{constants-DJILnUSb.mjs → constants-CGwVaAV3.mjs} +1 -1
- package/dist/{constants-UojhAJcm.js → constants-DWmm7_of.js} +1 -1
- package/dist/{device-ca-D8Ri9TVz.mjs → device-ca-DBfiJ_SB.mjs} +1 -1
- package/dist/{device-ca-196DAEZT.js → device-ca-DGayRmC0.js} +1 -1
- package/dist/{dist-BWvkuc31.mjs → dist-Bxt_S-9a.mjs} +180 -13
- package/dist/{dist-BiTCcaf-.js → dist-D9qT3jHr.js} +203 -12
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-DOBTq8qr.js → hub-mdns-ciao-B-wk9nzx.js} +1 -1
- package/dist/{hub-mdns-ciao-Cnd0bTB9.mjs → hub-mdns-ciao-DpPcQDg-.mjs} +1 -1
- package/dist/index.js +145 -16
- package/dist/index.mjs +140 -17
- package/dist/kernel/addon-refused-error.d.ts +30 -0
- package/dist/kernel/index.d.ts +3 -0
- package/dist/kernel/legacy-blob-guard.d.ts +6 -1
- package/dist/kernel/moleculer/process-service.d.ts +16 -1
- package/dist/kernel/moleculer/runner-refusal.d.ts +27 -0
- package/dist/{restore-archive-4ziluTU3.mjs → restore-archive-9CGgeBzD.mjs} +1 -1
- package/dist/{restore-archive-CfSSjKnA.js → restore-archive-BMNXwWWD.js} +1 -1
- package/dist/{wal-maintenance-CgZTNWAz.js → wal-maintenance-cRHR4rUY.js} +0 -0
- package/dist/{wal-maintenance-B57SAp4a.mjs → wal-maintenance-sIB32ONp.mjs} +0 -0
- package/package.json +1 -1
- package/dist/{custom-action-registry-BKmoaqG0.js → custom-action-registry-COyb49zm.js} +1 -1
- package/dist/{custom-action-registry-CyUuhATc.mjs → custom-action-registry-stpC3Zy-.mjs} +1 -1
package/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-D9qT3jHr.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-DGayRmC0.js");
|
|
5
5
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
6
6
|
require("./builtins/alerts/index.js");
|
|
7
7
|
const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
|
|
@@ -25,21 +25,21 @@ require("./builtins/local-auth/index.js");
|
|
|
25
25
|
const require_builtins_loki_logging_index = require("./builtins/loki-logging/index.js");
|
|
26
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
27
27
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
28
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
28
|
+
const require_wal_maintenance = require("./wal-maintenance-cRHR4rUY.js");
|
|
29
29
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
30
30
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
31
31
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
32
32
|
require("./builtins/storage-orchestrator/index.js");
|
|
33
33
|
const require_agent_https = require("./agent-https-DlpTMDqA.js");
|
|
34
|
-
const require_constants = require("./constants-
|
|
34
|
+
const require_constants = require("./constants-DWmm7_of.js");
|
|
35
35
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
36
36
|
require("./builtins/system-config/index.js");
|
|
37
37
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
38
|
-
const require_custom_action_registry = require("./custom-action-registry-
|
|
39
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
38
|
+
const require_custom_action_registry = require("./custom-action-registry-COyb49zm.js");
|
|
39
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-B-wk9nzx.js");
|
|
40
40
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
41
41
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
42
|
-
const require_restore_archive = require("./restore-archive-
|
|
42
|
+
const require_restore_archive = require("./restore-archive-BMNXwWWD.js");
|
|
43
43
|
let zod = require("zod");
|
|
44
44
|
let node_crypto = require("node:crypto");
|
|
45
45
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -48,6 +48,8 @@ let node_net = require("node:net");
|
|
|
48
48
|
let node_fs_promises = require("node:fs/promises");
|
|
49
49
|
let node_path = require("node:path");
|
|
50
50
|
node_path = require_chunk.__toESM(node_path);
|
|
51
|
+
let node_util = require("node:util");
|
|
52
|
+
node_util = require_chunk.__toESM(node_util);
|
|
51
53
|
let node_os = require("node:os");
|
|
52
54
|
node_os = require_chunk.__toESM(node_os);
|
|
53
55
|
let node_url = require("node:url");
|
|
@@ -55,8 +57,6 @@ let _camstack_types_addon = require("@camstack/types/addon");
|
|
|
55
57
|
let node_fs = require("node:fs");
|
|
56
58
|
node_fs = require_chunk.__toESM(node_fs);
|
|
57
59
|
let node_child_process = require("node:child_process");
|
|
58
|
-
let node_util = require("node:util");
|
|
59
|
-
node_util = require_chunk.__toESM(node_util);
|
|
60
60
|
let node_events = require("node:events");
|
|
61
61
|
let node_http = require("node:http");
|
|
62
62
|
let node_v8 = require("node:v8");
|
|
@@ -23020,6 +23020,50 @@ function createRunnerAddonSettings(client, addonId, before = async () => {}) {
|
|
|
23020
23020
|
};
|
|
23021
23021
|
}
|
|
23022
23022
|
//#endregion
|
|
23023
|
+
//#region src/kernel/addon-refused-error.ts
|
|
23024
|
+
/**
|
|
23025
|
+
* A deterministic Init refusal (D877): an addon that says, in a typed way,
|
|
23026
|
+
* "I will not start, and here is why" - as opposed to a crash.
|
|
23027
|
+
*
|
|
23028
|
+
* The difference matters to the supervisor. A crash may be transient (a camera
|
|
23029
|
+
* dropping mid-handshake) and is bounded by the D6 circuit-breaker; a refusal
|
|
23030
|
+
* repeats identically until somebody changes the world (runs a migration,
|
|
23031
|
+
* fixes a setting), so counting it toward the breaker only turns "waiting for
|
|
23032
|
+
* the operator" into a terminal `failed` with a stack trace nobody needed.
|
|
23033
|
+
* On 2026-10-17 twenty-eight addons refused on an unmigrated store, exited five
|
|
23034
|
+
* times in ten seconds and were marked `failed` as if they had crashed.
|
|
23035
|
+
*
|
|
23036
|
+
* The runner reports a refusal to its parent (see `runner-refusal.ts`); the
|
|
23037
|
+
* process service parks the runner in `refused` with the reason and retries it
|
|
23038
|
+
* only when an operator acts.
|
|
23039
|
+
*/
|
|
23040
|
+
var AddonRefusedError = class extends Error {
|
|
23041
|
+
/** Stable, greppable cause, e.g. `unmigrated-settings`. */
|
|
23042
|
+
code;
|
|
23043
|
+
/** What the operator does about it. */
|
|
23044
|
+
remedy;
|
|
23045
|
+
constructor(code, message, remedy, options) {
|
|
23046
|
+
super(message, options);
|
|
23047
|
+
this.name = "AddonRefusedError";
|
|
23048
|
+
this.code = code;
|
|
23049
|
+
this.remedy = remedy;
|
|
23050
|
+
}
|
|
23051
|
+
};
|
|
23052
|
+
/**
|
|
23053
|
+
* The refusal in `err`'s cause chain, if any. An addon that wraps the error it
|
|
23054
|
+
* got from the kernel (`new Error('init failed', { cause })`) is still refusing.
|
|
23055
|
+
*/
|
|
23056
|
+
function findAddonRefusal(err) {
|
|
23057
|
+
const seen = /* @__PURE__ */ new Set();
|
|
23058
|
+
let current = err;
|
|
23059
|
+
while (current !== null && current !== void 0 && !seen.has(current)) {
|
|
23060
|
+
if (current instanceof AddonRefusedError) return current;
|
|
23061
|
+
seen.add(current);
|
|
23062
|
+
current = current instanceof Error ? current.cause : void 0;
|
|
23063
|
+
}
|
|
23064
|
+
return null;
|
|
23065
|
+
}
|
|
23066
|
+
//#endregion
|
|
23023
23067
|
//#region src/kernel/legacy-blob-guard.ts
|
|
23024
23068
|
/** Root keys retired long before D870: they never count as "settings still to migrate". */
|
|
23025
23069
|
var OWN_RETIRED_ROOT_KEYS = new Set([
|
|
@@ -23035,9 +23079,13 @@ function isRetiredRootKey(addonId, key) {
|
|
|
23035
23079
|
if (OWN_RETIRED_ROOT_KEYS.has(key)) return true;
|
|
23036
23080
|
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}@`))));
|
|
23037
23081
|
}
|
|
23038
|
-
|
|
23082
|
+
/** Stable `code` of the D870 refusal. */
|
|
23083
|
+
var UNMIGRATED_SETTINGS_CODE = "unmigrated-settings";
|
|
23084
|
+
/** The remedy the refusal (and the update pre-flight) names. */
|
|
23085
|
+
var UNMIGRATED_SETTINGS_REMEDY = "Run scripts/hub/migrate-device-store.ts --copy --apply (D870), then restart the addon.";
|
|
23086
|
+
var UnmigratedSettingsError = class extends AddonRefusedError {
|
|
23039
23087
|
constructor(addonId, what) {
|
|
23040
|
-
super(`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
|
|
23088
|
+
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);
|
|
23041
23089
|
this.name = "UnmigratedSettingsError";
|
|
23042
23090
|
}
|
|
23043
23091
|
};
|
|
@@ -25010,6 +25058,27 @@ var AddonHealthMonitor = class {
|
|
|
25010
25058
|
}
|
|
25011
25059
|
};
|
|
25012
25060
|
//#endregion
|
|
25061
|
+
//#region src/kernel/moleculer/runner-refusal.ts
|
|
25062
|
+
var REFUSED_PREFIX = "REFUSED:";
|
|
25063
|
+
function isReport(value) {
|
|
25064
|
+
if (typeof value !== "object" || value === null) return false;
|
|
25065
|
+
const rec = value;
|
|
25066
|
+
return typeof rec["addonId"] === "string" && typeof rec["code"] === "string" && typeof rec["reason"] === "string" && typeof rec["remedy"] === "string";
|
|
25067
|
+
}
|
|
25068
|
+
/** The refusals announced in a chunk of runner stdout; lines that are not one are ignored. */
|
|
25069
|
+
function parseRunnerRefusals(nodeId, chunk) {
|
|
25070
|
+
const prefix = `${REFUSED_PREFIX}${nodeId}:`;
|
|
25071
|
+
const out = [];
|
|
25072
|
+
for (const line of chunk.split("\n")) {
|
|
25073
|
+
if (!line.startsWith(prefix)) continue;
|
|
25074
|
+
try {
|
|
25075
|
+
const parsed = JSON.parse(line.slice(prefix.length));
|
|
25076
|
+
if (isReport(parsed)) out.push(parsed);
|
|
25077
|
+
} catch {}
|
|
25078
|
+
}
|
|
25079
|
+
return out;
|
|
25080
|
+
}
|
|
25081
|
+
//#endregion
|
|
25013
25082
|
//#region src/kernel/moleculer/crash-supervisor.ts
|
|
25014
25083
|
/** Per-runner crash circuit-breaker. Replaces the old infinite-respawn loop. */
|
|
25015
25084
|
var CrashSupervisor = class {
|
|
@@ -25648,6 +25717,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25648
25717
|
const groupOps = deps?.processGroups ?? defaultProcessGroupOps;
|
|
25649
25718
|
const runnersOwnGroups = runnerOwnsProcessGroup(deps?.platform ?? process.platform);
|
|
25650
25719
|
const processes = /* @__PURE__ */ new Map();
|
|
25720
|
+
const backingOff = /* @__PURE__ */ new Map();
|
|
25651
25721
|
const pendingGroupReaps = /* @__PURE__ */ new Map();
|
|
25652
25722
|
const runnerLocks = /* @__PURE__ */ new Map();
|
|
25653
25723
|
function withRunnerLock(runnerId, fn) {
|
|
@@ -25688,6 +25758,19 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25688
25758
|
}, data));
|
|
25689
25759
|
}
|
|
25690
25760
|
/**
|
|
25761
|
+
* Every transition a supervisor or a boot check can settle on (D877):
|
|
25762
|
+
* `running` (READY), `crashed`, `failed`, `refused`. In-process telemetry - the
|
|
25763
|
+
* boot check re-evaluates on it and the alert centre closes a recovered runner.
|
|
25764
|
+
*/
|
|
25765
|
+
function emitStateChange(entry) {
|
|
25766
|
+
emitRunnerEvent(require_dist.EventCategory.ProcessStateChanged, entry.name, {
|
|
25767
|
+
runnerId: entry.name,
|
|
25768
|
+
nodeId: parentNodeId,
|
|
25769
|
+
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
25770
|
+
state: entry.state
|
|
25771
|
+
});
|
|
25772
|
+
}
|
|
25773
|
+
/**
|
|
25691
25774
|
* One line per reap that found something, or that failed. An empty group is the
|
|
25692
25775
|
* normal case after a clean stop and stays quiet at debug. The kernel cannot say
|
|
25693
25776
|
* which device a child served — the runner id is the finest attribution it has.
|
|
@@ -25752,6 +25835,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25752
25835
|
*/
|
|
25753
25836
|
function spawnRunner(runnerId, addons, env) {
|
|
25754
25837
|
const nodeId = buildNodeId(runnerId);
|
|
25838
|
+
backingOff.delete(runnerId);
|
|
25755
25839
|
const runnerPath = node_path.resolve(__dirname, "addon-runner.js");
|
|
25756
25840
|
const heavy = isHeavyRunner(addons);
|
|
25757
25841
|
const rssBudgetMb = runnerRssBudgetMb(addons);
|
|
@@ -25792,6 +25876,8 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25792
25876
|
startedAt: Date.now(),
|
|
25793
25877
|
restartCount: 0,
|
|
25794
25878
|
state: "starting",
|
|
25879
|
+
refusal: null,
|
|
25880
|
+
announcedRefusal: null,
|
|
25795
25881
|
child,
|
|
25796
25882
|
ownsGroup,
|
|
25797
25883
|
groupReap: null
|
|
@@ -25801,7 +25887,13 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25801
25887
|
kill: groupOps.kill
|
|
25802
25888
|
});
|
|
25803
25889
|
child.stdout?.on("data", (data) => {
|
|
25804
|
-
|
|
25890
|
+
const text = data.toString();
|
|
25891
|
+
const refusals = parseRunnerRefusals(nodeId, text);
|
|
25892
|
+
if (refusals[0] !== void 0) entry.announcedRefusal = refusals[0];
|
|
25893
|
+
if (text.includes(`READY:${nodeId}`) && entry.state === "starting") {
|
|
25894
|
+
entry.state = "running";
|
|
25895
|
+
emitStateChange(entry);
|
|
25896
|
+
}
|
|
25805
25897
|
});
|
|
25806
25898
|
child.stderr?.on("data", (data) => {
|
|
25807
25899
|
process.stderr.write(`[${runnerId}] ${data.toString()}`);
|
|
@@ -25810,7 +25902,33 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25810
25902
|
console.error(`[process-service EXIT] runner=${runnerId} code=${String(code)} signal=${String(signal)} state=${entry.state}`);
|
|
25811
25903
|
const groupReap = reapRunnerGroup(entry);
|
|
25812
25904
|
if (entry.state === "stopped") return;
|
|
25905
|
+
const announced = entry.announcedRefusal;
|
|
25906
|
+
entry.announcedRefusal = null;
|
|
25907
|
+
if (code === 78) {
|
|
25908
|
+
const refusal = announced ?? {
|
|
25909
|
+
addonId: entry.runnerAddons[0]?.addonId ?? runnerId,
|
|
25910
|
+
code: "unknown",
|
|
25911
|
+
reason: "the runner exited with the refusal code without saying why",
|
|
25912
|
+
remedy: "Read the runner log, fix the cause, then restart the addon."
|
|
25913
|
+
};
|
|
25914
|
+
entry.refusal = refusal;
|
|
25915
|
+
entry.state = "refused";
|
|
25916
|
+
capturedBroker?.logger.error(`[${runnerId}] Addon refused to start (${refusal.code}): ${refusal.reason} Not respawning; ${refusal.remedy}`, { tags: { runnerId } });
|
|
25917
|
+
processes.set(runnerId, entry);
|
|
25918
|
+
if (capturedBroker) forceMoleculerDisconnect(capturedBroker, entry.nodeId);
|
|
25919
|
+
emitRunnerEvent(require_dist.EventCategory.AddonRunnerRefused, runnerId, {
|
|
25920
|
+
runnerId,
|
|
25921
|
+
nodeId: parentNodeId,
|
|
25922
|
+
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
25923
|
+
code: refusal.code,
|
|
25924
|
+
reason: refusal.reason,
|
|
25925
|
+
remedy: refusal.remedy
|
|
25926
|
+
});
|
|
25927
|
+
emitStateChange(entry);
|
|
25928
|
+
return;
|
|
25929
|
+
}
|
|
25813
25930
|
entry.state = "crashed";
|
|
25931
|
+
emitStateChange(entry);
|
|
25814
25932
|
capturedBroker?.logger.error(`[${runnerId}] Process exited (code=${code}, signal=${signal})`);
|
|
25815
25933
|
const decision = crashSupervisor.recordCrash(runnerId);
|
|
25816
25934
|
emitRunnerEvent(require_dist.EventCategory.ProcessCrashed, runnerId, {
|
|
@@ -25820,6 +25938,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25820
25938
|
});
|
|
25821
25939
|
if (decision.action === "failed") {
|
|
25822
25940
|
entry.state = "failed";
|
|
25941
|
+
emitStateChange(entry);
|
|
25823
25942
|
capturedBroker?.logger.error(`[${runnerId}] Crash circuit-breaker tripped — ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms. Not respawning.`);
|
|
25824
25943
|
processes.set(runnerId, entry);
|
|
25825
25944
|
if (capturedBroker) forceMoleculerDisconnect(capturedBroker, entry.nodeId);
|
|
@@ -25844,10 +25963,12 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25844
25963
|
delayMs: decision.backoffMs
|
|
25845
25964
|
});
|
|
25846
25965
|
processes.delete(runnerId);
|
|
25966
|
+
backingOff.set(runnerId, entry);
|
|
25847
25967
|
if (capturedBroker) forceMoleculerDisconnect(capturedBroker, entry.nodeId);
|
|
25848
25968
|
setTimeout(() => {
|
|
25849
25969
|
withRunnerLock(runnerId, async () => {
|
|
25850
25970
|
await groupReap;
|
|
25971
|
+
backingOff.delete(runnerId);
|
|
25851
25972
|
if (processes.has(runnerId)) return;
|
|
25852
25973
|
const restarted = spawnRunner(runnerId, addons, env);
|
|
25853
25974
|
restarted.restartCount = entry.restartCount + 1;
|
|
@@ -25887,7 +26008,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25887
26008
|
reason: "not found"
|
|
25888
26009
|
};
|
|
25889
26010
|
const deadNodeId = target.nodeId;
|
|
25890
|
-
const alreadyDead = target.state === "failed" || target.child.exitCode !== null || target.child.signalCode !== null;
|
|
26011
|
+
const alreadyDead = target.state === "failed" || target.state === "refused" || target.child.exitCode !== null || target.child.signalCode !== null;
|
|
25891
26012
|
target.state = "stopped";
|
|
25892
26013
|
if (!alreadyDead) {
|
|
25893
26014
|
target.child.kill("SIGTERM");
|
|
@@ -25924,7 +26045,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25924
26045
|
const { runnerAddons } = target;
|
|
25925
26046
|
const deadNodeId = target.nodeId;
|
|
25926
26047
|
const prevRestartCount = target.restartCount;
|
|
25927
|
-
const alreadyDead = target.state === "failed" || target.child.exitCode !== null || target.child.signalCode !== null;
|
|
26048
|
+
const alreadyDead = target.state === "failed" || target.state === "refused" || target.child.exitCode !== null || target.child.signalCode !== null;
|
|
25928
26049
|
target.state = "stopped";
|
|
25929
26050
|
if (!alreadyDead) {
|
|
25930
26051
|
target.child.kill("SIGTERM");
|
|
@@ -25953,7 +26074,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25953
26074
|
});
|
|
25954
26075
|
} },
|
|
25955
26076
|
list: { async handler() {
|
|
25956
|
-
const entries = [...processes.values()];
|
|
26077
|
+
const entries = [...processes.values(), ...backingOff.values()];
|
|
25957
26078
|
const stats = await getPidStats$1(entries.filter((p) => p.pid > 0).map((p) => p.pid));
|
|
25958
26079
|
return entries.map((p) => {
|
|
25959
26080
|
const s = stats.get(p.pid);
|
|
@@ -25969,6 +26090,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25969
26090
|
startedAt: p.startedAt,
|
|
25970
26091
|
restartCount: p.restartCount,
|
|
25971
26092
|
state: p.state,
|
|
26093
|
+
...p.refusal !== null ? { refusal: p.refusal } : {},
|
|
25972
26094
|
cpuPercent: s?.cpu ?? 0,
|
|
25973
26095
|
memoryRss: s?.memoryRss ?? 0,
|
|
25974
26096
|
uptimeSeconds: Math.floor((Date.now() - p.startedAt) / 1e3)
|
|
@@ -25985,7 +26107,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
25985
26107
|
if (!entry) return;
|
|
25986
26108
|
const { runnerAddons } = entry;
|
|
25987
26109
|
const prevRestartCount = entry.restartCount;
|
|
25988
|
-
if (!(entry.state === "failed" || entry.child.exitCode !== null || entry.child.signalCode !== null)) {
|
|
26110
|
+
if (!(entry.state === "failed" || entry.state === "refused" || entry.child.exitCode !== null || entry.child.signalCode !== null)) {
|
|
25989
26111
|
entry.state = "stopped";
|
|
25990
26112
|
entry.child.kill("SIGTERM");
|
|
25991
26113
|
await new Promise((resolve) => {
|
|
@@ -26040,6 +26162,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26040
26162
|
startedAt: p.startedAt,
|
|
26041
26163
|
restartCount: p.restartCount,
|
|
26042
26164
|
state: p.state,
|
|
26165
|
+
...p.refusal !== null ? { refusal: p.refusal } : {},
|
|
26043
26166
|
cpuPercent: s?.cpu ?? 0,
|
|
26044
26167
|
memoryRss: s?.memoryRss ?? 0,
|
|
26045
26168
|
uptimeSeconds: Math.floor((Date.now() - p.startedAt) / 1e3)
|
|
@@ -27176,6 +27299,7 @@ exports.AddonHealthMonitor = AddonHealthMonitor;
|
|
|
27176
27299
|
exports.AddonInstaller = AddonInstaller;
|
|
27177
27300
|
exports.AddonLoader = AddonLoader;
|
|
27178
27301
|
exports.AddonManifest = AddonManifest;
|
|
27302
|
+
exports.AddonRefusedError = AddonRefusedError;
|
|
27179
27303
|
exports.AddonRouteRegistry = AddonRouteRegistry;
|
|
27180
27304
|
exports.AdminTokenManager = require_builtins_local_auth_local_auth_addon.AdminTokenManager;
|
|
27181
27305
|
exports.AgentHttpsInstallError = require_agent_https.AgentHttpsInstallError;
|
|
@@ -27366,11 +27490,14 @@ exports.TlsTcpTransporter = require_builtins_system_config_system_config_addon.T
|
|
|
27366
27490
|
exports.ToastService = ToastService;
|
|
27367
27491
|
exports.UDS_NO_ROUTE_PREFIX = UDS_NO_ROUTE_PREFIX;
|
|
27368
27492
|
exports.UNCLAIMED = UNCLAIMED;
|
|
27493
|
+
exports.UNMIGRATED_SETTINGS_CODE = UNMIGRATED_SETTINGS_CODE;
|
|
27494
|
+
exports.UNMIGRATED_SETTINGS_REMEDY = UNMIGRATED_SETTINGS_REMEDY;
|
|
27369
27495
|
exports.UPLOADED_CA_FILE = require_hub_mdns_ciao.UPLOADED_CA_FILE;
|
|
27370
27496
|
exports.USER_MANAGEMENT_INTERNAL = require_builtins_local_auth_local_auth_addon.USER_MANAGEMENT_INTERNAL;
|
|
27371
27497
|
exports.UdsLocalTransportClient = UdsLocalTransportClient;
|
|
27372
27498
|
exports.UdsLocalTransportServer = UdsLocalTransportServer;
|
|
27373
27499
|
exports.UnlockTicketJtiStore = require_builtins_system_config_system_config_addon.UnlockTicketJtiStore;
|
|
27500
|
+
exports.UnmigratedSettingsError = UnmigratedSettingsError;
|
|
27374
27501
|
exports.UserManager = require_builtins_local_auth_local_auth_addon.UserManager;
|
|
27375
27502
|
exports.WinstonDestination = require_builtins_winston_logging_index.WinstonDestination$1;
|
|
27376
27503
|
exports.WinstonLoggingAddon = require_builtins_winston_logging_index.WinstonLoggingAddon$1;
|
|
@@ -27387,6 +27514,7 @@ exports.allFamiliesListenHost = require_hub_mdns_ciao.allFamiliesListenHost;
|
|
|
27387
27514
|
exports.answerClaimedGetStatus = answerClaimedGetStatus;
|
|
27388
27515
|
exports.applyCertificateToListener = require_hub_mdns_ciao.applyCertificateToListener;
|
|
27389
27516
|
exports.applyLanHttp = require_hub_mdns_ciao.applyLanHttp;
|
|
27517
|
+
exports.assertLegacyBlobsMigrated = assertLegacyBlobsMigrated;
|
|
27390
27518
|
exports.attachUserManagementInternal = require_builtins_local_auth_local_auth_addon.attachUserManagementInternal;
|
|
27391
27519
|
exports.attributeStall = require_custom_action_registry.attributeStall;
|
|
27392
27520
|
exports.bindPendingLanHttp = require_hub_mdns_ciao.bindPendingLanHttp;
|
|
@@ -27544,6 +27672,7 @@ exports.evaluateExistingCert = require_agent_https.evaluateExistingCert;
|
|
|
27544
27672
|
exports.expandCapMethods = require_dist.expandCapMethods;
|
|
27545
27673
|
exports.exportMeshPrivateKeyPem = require_builtins_system_config_system_config_addon.exportMeshPrivateKeyPem;
|
|
27546
27674
|
exports.fetchJson = require_custom_action_registry.fetchJson;
|
|
27675
|
+
exports.findAddonRefusal = findAddonRefusal;
|
|
27547
27676
|
Object.defineProperty(exports, "findInPath", {
|
|
27548
27677
|
enumerable: true,
|
|
27549
27678
|
get: function() {
|