@camstack/server 1.2.783 → 1.2.784
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +14 -10
- package/system/dist/addon-utils.js +1 -1
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +2 -2
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +2 -2
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.d.ts +6 -0
- package/system/dist/builtins/alerts/alerts.addon.js +240 -17
- package/system/dist/builtins/alerts/alerts.addon.mjs +264 -50
- package/system/dist/builtins/alerts/runner-alert.d.ts +6 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +5 -5
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +3 -3
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/keychain/index.js +1 -1
- package/system/dist/builtins/keychain/index.mjs +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +3 -3
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
- package/system/dist/builtins/platform-probe/index.js +2 -2
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -2
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +2 -2
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/system-config/system-config.addon.js +4 -4
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DHlokCDH.js → hub-mdns-ciao-DYD3STlf.js} +3 -3
- package/system/dist/{hub-mdns-ciao-DWzAoaKF.mjs → hub-mdns-ciao-VOfs7CqC.mjs} +3 -3
- package/system/dist/index.js +29 -112
- package/system/dist/index.mjs +23 -106
- package/system/dist/kernel/moleculer/process-service.d.ts +3 -0
- package/system/dist/kernel/moleculer/runner-failure-info.d.ts +13 -0
- package/system/dist/log-file-read-worker.js +1 -1
- package/system/dist/log-file-read-worker.mjs +1 -1
- package/system/package.json +1 -1
- package/system/dist/{agent-https-kG6BvwKf.js → agent-https-BobAhSU6.js} +1 -1
- package/system/dist/{agent-https-CEBLv9BA.mjs → agent-https-Ds3-zbz-.mjs} +1 -1
- package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-B9zFBNVa.mjs} +3 -3
- package/system/dist/{custom-action-registry-JuMHGKEc.js → custom-action-registry-CmWpSeMS.js} +3 -3
- package/system/dist/{log-file-read-protocol-D0WcLbIV.js → log-file-read-protocol-DSV_vQRb.js} +2 -2
- package/system/dist/{log-file-read-protocol-B7M3X3bT.mjs → log-file-read-protocol-hTaAsYlX.mjs} +1 -1
- package/system/dist/{restore-archive-CfET1ups.mjs → restore-archive-B2l00XlI.mjs} +4 -4
- package/system/dist/{restore-archive-ChBlqNSj.js → restore-archive-BCXQaw89.js} +6 -6
- package/system/dist/{wal-maintenance-CNSrfmr8.js → wal-maintenance-Z4MNv6Vn.js} +0 -0
- package/system/dist/{wal-maintenance-Bg3rwpny.mjs → wal-maintenance-bvjbNKbx.mjs} +0 -0
package/system/dist/index.js
CHANGED
|
@@ -26,39 +26,39 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
26
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
27
27
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
28
28
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
29
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-Z4MNv6Vn.js");
|
|
30
30
|
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BzVepX_e.js");
|
|
31
31
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
32
32
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
33
33
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
34
34
|
require("./builtins/storage-orchestrator/index.js");
|
|
35
|
-
const require_agent_https = require("./agent-https-
|
|
35
|
+
const require_agent_https = require("./agent-https-BobAhSU6.js");
|
|
36
36
|
const require_constants = require("./constants-_Zq5aGIs.js");
|
|
37
37
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
38
38
|
require("./builtins/system-config/index.js");
|
|
39
39
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
40
|
-
const require_custom_action_registry = require("./custom-action-registry-
|
|
41
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
40
|
+
const require_custom_action_registry = require("./custom-action-registry-CmWpSeMS.js");
|
|
41
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-DYD3STlf.js");
|
|
42
42
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
43
43
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
44
|
-
const require_restore_archive = require("./restore-archive-
|
|
44
|
+
const require_restore_archive = require("./restore-archive-BCXQaw89.js");
|
|
45
45
|
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
46
46
|
let zod = require("zod");
|
|
47
47
|
let node_crypto = require("node:crypto");
|
|
48
48
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
49
49
|
let _camstack_types_node = require("@camstack/types/node");
|
|
50
50
|
let node_net = require("node:net");
|
|
51
|
-
let
|
|
51
|
+
let node_fs = require("node:fs");
|
|
52
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
52
53
|
let node_path = require("node:path");
|
|
53
54
|
node_path = require_chunk.__toESM(node_path);
|
|
55
|
+
let _camstack_types_addon = require("@camstack/types/addon");
|
|
56
|
+
let node_fs_promises = require("node:fs/promises");
|
|
54
57
|
let node_util = require("node:util");
|
|
55
58
|
node_util = require_chunk.__toESM(node_util);
|
|
56
|
-
let _camstack_types_addon = require("@camstack/types/addon");
|
|
57
59
|
let node_os = require("node:os");
|
|
58
60
|
node_os = require_chunk.__toESM(node_os);
|
|
59
61
|
let node_url = require("node:url");
|
|
60
|
-
let node_fs = require("node:fs");
|
|
61
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
62
62
|
let node_child_process = require("node:child_process");
|
|
63
63
|
let node_events = require("node:events");
|
|
64
64
|
let node_http = require("node:http");
|
|
@@ -3848,100 +3848,6 @@ var LifecycleStateMachine = class {
|
|
|
3848
3848
|
}
|
|
3849
3849
|
};
|
|
3850
3850
|
//#endregion
|
|
3851
|
-
//#region src/logging/log-redactor.ts
|
|
3852
|
-
var REDACTED = "***";
|
|
3853
|
-
/** Credential-named keys. Substring, case-insensitive; only STRING values are replaced. */
|
|
3854
|
-
var SECRET_KEY_SUBSTRINGS = [
|
|
3855
|
-
"password",
|
|
3856
|
-
"passwd",
|
|
3857
|
-
"secret",
|
|
3858
|
-
"token",
|
|
3859
|
-
"apikey",
|
|
3860
|
-
"api_key",
|
|
3861
|
-
"authkey",
|
|
3862
|
-
"auth_key",
|
|
3863
|
-
"privatekey",
|
|
3864
|
-
"private_key",
|
|
3865
|
-
"passphrase",
|
|
3866
|
-
"credential",
|
|
3867
|
-
"cookie"
|
|
3868
|
-
];
|
|
3869
|
-
/** True when a meta key names a credential. */
|
|
3870
|
-
function isCredentialKeyName(key) {
|
|
3871
|
-
const lower = key.toLowerCase();
|
|
3872
|
-
return SECRET_KEY_SUBSTRINGS.some((needle) => lower.includes(needle));
|
|
3873
|
-
}
|
|
3874
|
-
var URL_IN_TEXT = /\b[a-z][a-z0-9+.-]*:\/\/[^\s"'<>`]+/gi;
|
|
3875
|
-
/** A root-relative path WITH a query, as request logs print it. */
|
|
3876
|
-
var RELATIVE_URL_IN_TEXT = /(^|[\s"'(=])(\/[^\s"'<>`?]*\?[^\s"'<>`]+)/g;
|
|
3877
|
-
var CREDENTIAL_FLAG = /(--(?:token|auth-?key|password|passwd|pass|secret|api-?key|access-?token|refresh-?token)(?:=|\s+))(\S+)/gi;
|
|
3878
|
-
/** Redact one free-form string. */
|
|
3879
|
-
function redactLogText(text) {
|
|
3880
|
-
let out = (0, _camstack_types_addon.scrubKnownSecrets)(text);
|
|
3881
|
-
if (out.includes("://")) out = out.replace(URL_IN_TEXT, (url) => (0, _camstack_types_addon.maskUrlCredentials)(url));
|
|
3882
|
-
if (out.includes("/") && out.includes("?") && out.includes("=")) out = out.replace(RELATIVE_URL_IN_TEXT, (_m, lead, path) => `${lead}${(0, _camstack_types_addon.maskUrlCredentials)(path)}`);
|
|
3883
|
-
if (out.includes("--")) out = out.replace(CREDENTIAL_FLAG, (_m, flag, value) => value.startsWith("‹secret:") ? `${flag}${value}` : `${flag}${REDACTED}`);
|
|
3884
|
-
return out;
|
|
3885
|
-
}
|
|
3886
|
-
/** Bounds on the meta walk — a log line is not a place to traverse a graph. */
|
|
3887
|
-
var MAX_DEPTH = 8;
|
|
3888
|
-
var MAX_NODES = 2e3;
|
|
3889
|
-
/**
|
|
3890
|
-
* Redact a value, returning the SAME reference when nothing in it changed —
|
|
3891
|
-
* most lines carry clean meta, and copying every one would put an allocation
|
|
3892
|
-
* per log line on hub-main's event loop.
|
|
3893
|
-
*/
|
|
3894
|
-
function redactValue(value, depth, budget, seen) {
|
|
3895
|
-
if (budget.nodes++ > MAX_NODES) return value;
|
|
3896
|
-
if (typeof value === "string") return redactLogText(value);
|
|
3897
|
-
if (value === null || typeof value !== "object") return value;
|
|
3898
|
-
if (depth >= MAX_DEPTH || seen.has(value)) return value;
|
|
3899
|
-
if (value instanceof Error) {
|
|
3900
|
-
const message = redactLogText(value.message);
|
|
3901
|
-
return message === value.message ? value : message;
|
|
3902
|
-
}
|
|
3903
|
-
if (value instanceof Date || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
3904
|
-
seen.add(value);
|
|
3905
|
-
if (Array.isArray(value)) {
|
|
3906
|
-
let copy = null;
|
|
3907
|
-
for (let i = 0; i < value.length; i++) {
|
|
3908
|
-
const item = value[i];
|
|
3909
|
-
const next = redactValue(item, depth + 1, budget, seen);
|
|
3910
|
-
if (next !== item) {
|
|
3911
|
-
copy ??= [...value];
|
|
3912
|
-
copy[i] = next;
|
|
3913
|
-
}
|
|
3914
|
-
}
|
|
3915
|
-
return copy ?? value;
|
|
3916
|
-
}
|
|
3917
|
-
let copy = null;
|
|
3918
|
-
for (const [key, child] of Object.entries(value)) {
|
|
3919
|
-
const next = typeof child === "string" && child.length > 0 && isCredentialKeyName(key) ? REDACTED : redactValue(child, depth + 1, budget, seen);
|
|
3920
|
-
if (next !== child) {
|
|
3921
|
-
copy ??= { ...value };
|
|
3922
|
-
copy[key] = next;
|
|
3923
|
-
}
|
|
3924
|
-
}
|
|
3925
|
-
return copy ?? value;
|
|
3926
|
-
}
|
|
3927
|
-
/** Redact a `meta` record; the same object back when it was already clean. */
|
|
3928
|
-
function redactLogMeta(meta) {
|
|
3929
|
-
const out = redactValue(meta, 0, { nodes: 0 }, /* @__PURE__ */ new WeakSet());
|
|
3930
|
-
if (out === meta) return meta;
|
|
3931
|
-
return out !== null && typeof out === "object" && !Array.isArray(out) ? Object.fromEntries(Object.entries(out)) : meta;
|
|
3932
|
-
}
|
|
3933
|
-
/** Redact a whole entry: message and meta. Tags are identifiers, left alone. */
|
|
3934
|
-
function redactLogEntry(entry) {
|
|
3935
|
-
const message = redactLogText(entry.message);
|
|
3936
|
-
const meta = entry.meta !== void 0 ? redactLogMeta(entry.meta) : void 0;
|
|
3937
|
-
if (message === entry.message && meta === entry.meta) return entry;
|
|
3938
|
-
return {
|
|
3939
|
-
...entry,
|
|
3940
|
-
message,
|
|
3941
|
-
...meta !== void 0 ? { meta } : {}
|
|
3942
|
-
};
|
|
3943
|
-
}
|
|
3944
|
-
//#endregion
|
|
3945
3851
|
//#region src/logging/log-ring-buffer.ts
|
|
3946
3852
|
/**
|
|
3947
3853
|
* Per-tag filter matcher with semantic-aware comparisons:
|
|
@@ -4611,7 +4517,7 @@ var LogManager = class {
|
|
|
4611
4517
|
createLogger(scope) {
|
|
4612
4518
|
return new ScopedLogger(scope, (entry) => {
|
|
4613
4519
|
const enriched = {
|
|
4614
|
-
...redactLogEntry(this.enrichDeviceName(entry)),
|
|
4520
|
+
...require_builtins_alerts_alerts_addon.redactLogEntry(this.enrichDeviceName(entry)),
|
|
4615
4521
|
id: `${this.bootId}.${String(++this.seq)}`
|
|
4616
4522
|
};
|
|
4617
4523
|
if (this.isDestinationEnabled?.("log-buffer") !== false) this.ringBuffer.push(enriched);
|
|
@@ -21921,12 +21827,12 @@ function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, ta
|
|
|
21921
21827
|
} : baseTags;
|
|
21922
21828
|
const entry = {
|
|
21923
21829
|
level,
|
|
21924
|
-
message: redactLogText(message),
|
|
21830
|
+
message: require_builtins_alerts_alerts_addon.redactLogText(message),
|
|
21925
21831
|
addonId,
|
|
21926
21832
|
nodeId,
|
|
21927
21833
|
...scope !== void 0 ? { scope } : {},
|
|
21928
21834
|
tags: mergedTags,
|
|
21929
|
-
...extras?.meta !== void 0 ? { meta: redactLogMeta(extras.meta) } : {}
|
|
21835
|
+
...extras?.meta !== void 0 ? { meta: require_builtins_alerts_alerts_addon.redactLogMeta(extras.meta) } : {}
|
|
21930
21836
|
};
|
|
21931
21837
|
client.sendLog(entry);
|
|
21932
21838
|
}
|
|
@@ -26766,6 +26672,11 @@ async function getPidStats$1(pids) {
|
|
|
26766
26672
|
});
|
|
26767
26673
|
return result;
|
|
26768
26674
|
}
|
|
26675
|
+
/** `{ displayName }` from the runner's package manifests, or nothing when it names none. */
|
|
26676
|
+
function runnerDisplayNameField(entry, runnerId) {
|
|
26677
|
+
const displayName = require_builtins_alerts_alerts_addon.readRunnerDisplayName(entry.runnerAddons.map((a) => a.addonDir), runnerId);
|
|
26678
|
+
return displayName === void 0 ? {} : { displayName };
|
|
26679
|
+
}
|
|
26769
26680
|
var MAX_BACKOFF_MS = 3e4;
|
|
26770
26681
|
var CRASH_WINDOW_MS = 6e4;
|
|
26771
26682
|
var MAX_CRASHES_IN_WINDOW = 5;
|
|
@@ -26936,6 +26847,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26936
26847
|
state: "starting",
|
|
26937
26848
|
refusal: null,
|
|
26938
26849
|
announcedRefusal: null,
|
|
26850
|
+
lastCause: void 0,
|
|
26939
26851
|
child,
|
|
26940
26852
|
ownsGroup,
|
|
26941
26853
|
groupReap: null
|
|
@@ -26954,7 +26866,9 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26954
26866
|
}
|
|
26955
26867
|
});
|
|
26956
26868
|
child.stderr?.on("data", (data) => {
|
|
26957
|
-
|
|
26869
|
+
const text = data.toString();
|
|
26870
|
+
entry.lastCause = require_builtins_alerts_alerts_addon.lastCauseAfterChunk(entry.lastCause, text);
|
|
26871
|
+
process.stderr.write(`[${runnerId}] ${text}`);
|
|
26958
26872
|
});
|
|
26959
26873
|
child.on("exit", (code, signal) => {
|
|
26960
26874
|
console.error(`[process-service EXIT] runner=${runnerId} code=${String(code)} signal=${String(signal)} state=${entry.state}`);
|
|
@@ -26984,6 +26898,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26984
26898
|
runnerId,
|
|
26985
26899
|
nodeId: parentNodeId,
|
|
26986
26900
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
26901
|
+
...runnerDisplayNameField(entry, runnerId),
|
|
26987
26902
|
code: refusal.code,
|
|
26988
26903
|
reason: refusal.reason,
|
|
26989
26904
|
remedy: refusal.remedy
|
|
@@ -27015,12 +26930,14 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
27015
26930
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
27016
26931
|
crashesInWindow: decision.crashesInWindow,
|
|
27017
26932
|
windowMs: CRASH_WINDOW_MS,
|
|
26933
|
+
...runnerDisplayNameField(entry, runnerId),
|
|
26934
|
+
...entry.lastCause !== void 0 ? { lastError: entry.lastCause.text } : {},
|
|
27018
26935
|
...code !== null ? { exitCode: code } : {},
|
|
27019
26936
|
...signal !== null ? { signal } : {}
|
|
27020
26937
|
});
|
|
27021
26938
|
for (const addon of entry.runnerAddons) emitRunnerEvent(require_dist.EventCategory.AddonCrashed, addon.addonId, {
|
|
27022
26939
|
addonId: addon.addonId,
|
|
27023
|
-
error:
|
|
26940
|
+
error: `${require_builtins_alerts_alerts_addon.CRASH_BREAKER_ERROR_PREFIX} after ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms`
|
|
27024
26941
|
});
|
|
27025
26942
|
return;
|
|
27026
26943
|
}
|
|
@@ -28951,7 +28868,7 @@ exports.isArrayOutputSchema = require_dist.isArrayOutputSchema;
|
|
|
28951
28868
|
exports.isCollectionArrayMethod = require_dist.isCollectionArrayMethod;
|
|
28952
28869
|
exports.isConstrainedCa = require_agent_https.isConstrainedCa;
|
|
28953
28870
|
exports.isContainerBridgeAddress = require_agent_https.isContainerBridgeAddress;
|
|
28954
|
-
exports.isCredentialKeyName = isCredentialKeyName;
|
|
28871
|
+
exports.isCredentialKeyName = require_builtins_alerts_alerts_addon.isCredentialKeyName;
|
|
28955
28872
|
exports.isInfraCapability = isInfraCapability;
|
|
28956
28873
|
exports.isInsecureOrigin = require_builtins_system_config_system_config_addon.isInsecureOrigin;
|
|
28957
28874
|
exports.isInstalledTransporter = isInstalledTransporter;
|
|
@@ -29041,9 +28958,9 @@ exports.readinessKey = require_dist.readinessKey;
|
|
|
29041
28958
|
exports.reclaimIntervalMs = reclaimIntervalMs;
|
|
29042
28959
|
exports.recordHeldInstall = recordHeldInstall;
|
|
29043
28960
|
exports.recordSocketFrame = recordSocketFrame;
|
|
29044
|
-
exports.redactLogEntry = redactLogEntry;
|
|
29045
|
-
exports.redactLogMeta = redactLogMeta;
|
|
29046
|
-
exports.redactLogText = redactLogText;
|
|
28961
|
+
exports.redactLogEntry = require_builtins_alerts_alerts_addon.redactLogEntry;
|
|
28962
|
+
exports.redactLogMeta = require_builtins_alerts_alerts_addon.redactLogMeta;
|
|
28963
|
+
exports.redactLogText = require_builtins_alerts_alerts_addon.redactLogText;
|
|
29047
28964
|
exports.regenerateCertificate = require_hub_mdns_ciao.regenerateCertificate;
|
|
29048
28965
|
exports.registerEventBusService = registerEventBusService;
|
|
29049
28966
|
exports.registerHttpsListener = require_hub_mdns_ciao.registerHttpsListener;
|
package/system/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
|
2
2
|
import { $s as readinessKey, As as getDebugInterest, At as PackageRequiresSchema, Bi as procedureAuthKey, Ca as splitTranslationRef, Cr as extractNestedAddonId, Di as objectInputDeclaresRequiredDeviceId, E as CatalogFileSchema, Ei as objectInputDeclaresAddonId, Es as emitDownForOwnedCaps, Fo as DEVICE_STATUS_METHOD, Hr as isCollectionArrayMethod, La as unmetRequirements, Lr as interpolate, Mo as CALLER_STAMPED_CAPABILITIES$1, No as DATAPLANE_SECRET_HEADER$1, Os as expandCapMethods, Po as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Ps as isDebugChannelName, Qo as ReadinessTimeoutError, Rn as compareVersions, Ts as defineRecordKinds, Vr as isArrayOutputSchema, Xo as RUNTIME_DEFAULTS, Xr as kebabToCamel$1, Xs as parseJsonObject, Yr as isVoidInput, Zo as ReadinessRegistry, Zs as parseJsonUnknown, _c as EventCategory$1, a as AGENT_MDNS_TXT_KEYS, bn as bareAddonId, bs as createEvent$1, bt as METHOD_ACCESS_MAP, ci as logLevelAtMost, dc as userError, dn as addonSettingsCapability, ds as asNumber, fa as scopesAllowAddon, fc as withoutCallerStamp, fs as asString$1, gc as errMsg$1, i as AGENT_MDNS_SERVICE_TYPE, ja as supportedRuntimes, li as looseSchema, o as ALL_CAPABILITY_DEFINITIONS, or as describeUnmet, pa as scopesAllowDeviceCap, qr as isObjectInput, ra as resolveMethodAuth, rc as scopeKey, tc as resolveCapMount, ti as lifecycleJobSchema, us as asJsonObject$1, vs as collectSecretMarkerRefs, vt as LOG_LEVEL_RANK, y as CATALOG_LANGS } from "./dist-W0Eyg7Fm.mjs";
|
|
3
3
|
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-DqNfUZx4.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
|
-
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
5
|
+
import { AlertCenterAddon, a as redactLogEntry, i as isCredentialKeyName, n as lastCauseAfterChunk, o as redactLogMeta, r as readRunnerDisplayName, s as redactLogText, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
|
|
6
6
|
import "./builtins/alerts/index.mjs";
|
|
7
7
|
import { CalendarsAddon } from "./builtins/calendars/calendars.addon.mjs";
|
|
8
8
|
import "./builtins/calendars/index.mjs";
|
|
@@ -25,39 +25,39 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
25
25
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
26
26
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
27
27
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
28
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
28
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-bvjbNKbx.mjs";
|
|
29
29
|
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-CF_0_-U9.mjs";
|
|
30
30
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
31
31
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
32
32
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, l as STORAGE_DRAIN_STATE_LEGACY, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
33
33
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
34
|
-
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-
|
|
34
|
+
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-Ds3-zbz-.mjs";
|
|
35
35
|
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-BmX7aeHq.mjs";
|
|
36
36
|
import { $ as caFingerprintCompact, A as getProcessNodeMeshTransport, B as MESH_NODE_CERTIFICATES_COLLECTION, C as MESH_TLS_PORT_HELLO_FIELD, Ct as readOriginSetting, D as setProcessMeshTlsEnabler, Dt as readCidrSetting, E as ServiceBroker, Et as parseCidrList, F as renewMeshCertificate, G as getProcessMeshCertificateRegistry, H as MeshCertificateRegistry, I as revokeMeshCertificate, J as processMeshCrl, K as setProcessMeshCertificateRegistry, L as getProcessMeshTlsListenerState, M as isProcessVerifiedMeshPeer, N as onProcessNodeRegistered, O as dropProcessPeer, P as setProcessMeshPeerTransportLookup, Q as caFingerprint, R as openMeshTlsWhenRevocationsLoaded, S as verifyMembershipAnswer, St as parseOriginList, SystemConfigAddon, T as Errors, Tt as normalizeIp, U as RENEWAL_ABANDONED, V as MESH_NODE_CERTIFICATES_COLUMNS, W as describeMeshLeaf, X as getProcessMeshCaState, Y as MeshCaKeeper, Z as requireProcessMeshCa, _ as signPairingProof, _t as verifyAgentUiUnlockTicket, a as hubHostFromMeshAddress, at as issueMeshLeafForNode, b as MembershipResponder, bt as isInsecureOrigin, c as PAIRING_MAX_SESSIONS, ct as AGENT_DASHBOARD_ORIGINS_FIELD, d as PAIRING_PROTOCOL, dt as AGENT_UI_UNLOCK_USE, et as createMeshCsrPem, f as PAIRING_TTL_MS, ft as AGENT_UI_UNLOCK_VERSION, g as keyFingerprintShort, gt as parseAgentDashboardOrigins, h as describeCsr, ht as mintAgentUiUnlockTicket, i as AgentPairing, it as isValidAgentNodeId, j as getProcessPeerLeaf, k as emitProcessNodeRegistered, l as PAIRING_PATHS, lt as AGENT_UI_UNLOCK_TTL_MS, m as computePairingSas, mt as isAllowedAgentDashboardReturnTo, n as HubPairing, nt as generateMeshCa, o as PAIRING_CODE_DIGITS, ot as issueMeshLeafFromCsr, p as computePairingCommitment, pt as UnlockTicketJtiStore, q as MeshCrl, r as PairingHttpError, rt as generateMeshKeyPair, s as PAIRING_MAX_CODE_ATTEMPTS, st as loadMeshCa, tt as exportMeshPrivateKeyPem, u as PAIRING_PIN_DIGITS, ut as AGENT_UI_UNLOCK_TYP, v as verifyPairingProof, vt as InvalidCorsOriginError, w as TlsTcpTransporter, wt as createCidrMatcher, x as signMembershipProof, xt as normalizeOrigin, y as MEMBERSHIP_PATHS, yt as OPAQUE_ORIGIN, z as setProcessMeshTlsListenerState } from "./builtins/system-config/system-config.addon.mjs";
|
|
37
37
|
import "./builtins/system-config/index.mjs";
|
|
38
38
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
39
|
-
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
40
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
39
|
+
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
|
|
40
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-VOfs7CqC.mjs";
|
|
41
41
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
42
42
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
43
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
43
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-B2l00XlI.mjs";
|
|
44
44
|
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
import * as crypto$1 from "node:crypto";
|
|
47
47
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
48
48
|
import { PYTHON_VERSION, buildBinaryPath, declaresEdgetpuDelegate, downloadBinary, ensureBinary, ensureBinary as ensureBinary$1, ensureEdgetpuDelegate, ensureFfmpeg, ensureFfmpeg as ensureFfmpeg$1, ensurePython, ensurePython as ensurePython$1, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonPackages as installPythonPackages$1, installPythonRequirements, installPythonRequirements as installPythonRequirements$1 } from "@camstack/types/node";
|
|
49
49
|
import { connect, createConnection, createServer } from "node:net";
|
|
50
|
-
import
|
|
50
|
+
import * as fs$1 from "node:fs";
|
|
51
|
+
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
51
52
|
import * as path$1 from "node:path";
|
|
52
53
|
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
54
|
+
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, readErrorI18n, readNodePin, resolveDeviceSettings, scopeKey as scopeKey$1, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
55
|
+
import { mkdir, rm, stat, unlink } from "node:fs/promises";
|
|
53
56
|
import * as util from "node:util";
|
|
54
57
|
import { promisify } from "node:util";
|
|
55
|
-
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readErrorI18n, readNodePin, resolveDeviceSettings, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
56
58
|
import * as os$1 from "node:os";
|
|
57
59
|
import { tmpdir } from "node:os";
|
|
58
60
|
import { pathToFileURL } from "node:url";
|
|
59
|
-
import * as fs$1 from "node:fs";
|
|
60
|
-
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
61
61
|
import { execFile, spawn } from "node:child_process";
|
|
62
62
|
import { once } from "node:events";
|
|
63
63
|
import { createServer as createServer$1, request } from "node:http";
|
|
@@ -3845,100 +3845,6 @@ var LifecycleStateMachine = class {
|
|
|
3845
3845
|
}
|
|
3846
3846
|
};
|
|
3847
3847
|
//#endregion
|
|
3848
|
-
//#region src/logging/log-redactor.ts
|
|
3849
|
-
var REDACTED = "***";
|
|
3850
|
-
/** Credential-named keys. Substring, case-insensitive; only STRING values are replaced. */
|
|
3851
|
-
var SECRET_KEY_SUBSTRINGS = [
|
|
3852
|
-
"password",
|
|
3853
|
-
"passwd",
|
|
3854
|
-
"secret",
|
|
3855
|
-
"token",
|
|
3856
|
-
"apikey",
|
|
3857
|
-
"api_key",
|
|
3858
|
-
"authkey",
|
|
3859
|
-
"auth_key",
|
|
3860
|
-
"privatekey",
|
|
3861
|
-
"private_key",
|
|
3862
|
-
"passphrase",
|
|
3863
|
-
"credential",
|
|
3864
|
-
"cookie"
|
|
3865
|
-
];
|
|
3866
|
-
/** True when a meta key names a credential. */
|
|
3867
|
-
function isCredentialKeyName(key) {
|
|
3868
|
-
const lower = key.toLowerCase();
|
|
3869
|
-
return SECRET_KEY_SUBSTRINGS.some((needle) => lower.includes(needle));
|
|
3870
|
-
}
|
|
3871
|
-
var URL_IN_TEXT = /\b[a-z][a-z0-9+.-]*:\/\/[^\s"'<>`]+/gi;
|
|
3872
|
-
/** A root-relative path WITH a query, as request logs print it. */
|
|
3873
|
-
var RELATIVE_URL_IN_TEXT = /(^|[\s"'(=])(\/[^\s"'<>`?]*\?[^\s"'<>`]+)/g;
|
|
3874
|
-
var CREDENTIAL_FLAG = /(--(?:token|auth-?key|password|passwd|pass|secret|api-?key|access-?token|refresh-?token)(?:=|\s+))(\S+)/gi;
|
|
3875
|
-
/** Redact one free-form string. */
|
|
3876
|
-
function redactLogText(text) {
|
|
3877
|
-
let out = scrubKnownSecrets(text);
|
|
3878
|
-
if (out.includes("://")) out = out.replace(URL_IN_TEXT, (url) => maskUrlCredentials(url));
|
|
3879
|
-
if (out.includes("/") && out.includes("?") && out.includes("=")) out = out.replace(RELATIVE_URL_IN_TEXT, (_m, lead, path) => `${lead}${maskUrlCredentials(path)}`);
|
|
3880
|
-
if (out.includes("--")) out = out.replace(CREDENTIAL_FLAG, (_m, flag, value) => value.startsWith("‹secret:") ? `${flag}${value}` : `${flag}${REDACTED}`);
|
|
3881
|
-
return out;
|
|
3882
|
-
}
|
|
3883
|
-
/** Bounds on the meta walk — a log line is not a place to traverse a graph. */
|
|
3884
|
-
var MAX_DEPTH = 8;
|
|
3885
|
-
var MAX_NODES = 2e3;
|
|
3886
|
-
/**
|
|
3887
|
-
* Redact a value, returning the SAME reference when nothing in it changed —
|
|
3888
|
-
* most lines carry clean meta, and copying every one would put an allocation
|
|
3889
|
-
* per log line on hub-main's event loop.
|
|
3890
|
-
*/
|
|
3891
|
-
function redactValue(value, depth, budget, seen) {
|
|
3892
|
-
if (budget.nodes++ > MAX_NODES) return value;
|
|
3893
|
-
if (typeof value === "string") return redactLogText(value);
|
|
3894
|
-
if (value === null || typeof value !== "object") return value;
|
|
3895
|
-
if (depth >= MAX_DEPTH || seen.has(value)) return value;
|
|
3896
|
-
if (value instanceof Error) {
|
|
3897
|
-
const message = redactLogText(value.message);
|
|
3898
|
-
return message === value.message ? value : message;
|
|
3899
|
-
}
|
|
3900
|
-
if (value instanceof Date || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
3901
|
-
seen.add(value);
|
|
3902
|
-
if (Array.isArray(value)) {
|
|
3903
|
-
let copy = null;
|
|
3904
|
-
for (let i = 0; i < value.length; i++) {
|
|
3905
|
-
const item = value[i];
|
|
3906
|
-
const next = redactValue(item, depth + 1, budget, seen);
|
|
3907
|
-
if (next !== item) {
|
|
3908
|
-
copy ??= [...value];
|
|
3909
|
-
copy[i] = next;
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
return copy ?? value;
|
|
3913
|
-
}
|
|
3914
|
-
let copy = null;
|
|
3915
|
-
for (const [key, child] of Object.entries(value)) {
|
|
3916
|
-
const next = typeof child === "string" && child.length > 0 && isCredentialKeyName(key) ? REDACTED : redactValue(child, depth + 1, budget, seen);
|
|
3917
|
-
if (next !== child) {
|
|
3918
|
-
copy ??= { ...value };
|
|
3919
|
-
copy[key] = next;
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
3922
|
-
return copy ?? value;
|
|
3923
|
-
}
|
|
3924
|
-
/** Redact a `meta` record; the same object back when it was already clean. */
|
|
3925
|
-
function redactLogMeta(meta) {
|
|
3926
|
-
const out = redactValue(meta, 0, { nodes: 0 }, /* @__PURE__ */ new WeakSet());
|
|
3927
|
-
if (out === meta) return meta;
|
|
3928
|
-
return out !== null && typeof out === "object" && !Array.isArray(out) ? Object.fromEntries(Object.entries(out)) : meta;
|
|
3929
|
-
}
|
|
3930
|
-
/** Redact a whole entry: message and meta. Tags are identifiers, left alone. */
|
|
3931
|
-
function redactLogEntry(entry) {
|
|
3932
|
-
const message = redactLogText(entry.message);
|
|
3933
|
-
const meta = entry.meta !== void 0 ? redactLogMeta(entry.meta) : void 0;
|
|
3934
|
-
if (message === entry.message && meta === entry.meta) return entry;
|
|
3935
|
-
return {
|
|
3936
|
-
...entry,
|
|
3937
|
-
message,
|
|
3938
|
-
...meta !== void 0 ? { meta } : {}
|
|
3939
|
-
};
|
|
3940
|
-
}
|
|
3941
|
-
//#endregion
|
|
3942
3848
|
//#region src/logging/log-ring-buffer.ts
|
|
3943
3849
|
/**
|
|
3944
3850
|
* Per-tag filter matcher with semantic-aware comparisons:
|
|
@@ -26762,6 +26668,11 @@ async function getPidStats$1(pids) {
|
|
|
26762
26668
|
});
|
|
26763
26669
|
return result;
|
|
26764
26670
|
}
|
|
26671
|
+
/** `{ displayName }` from the runner's package manifests, or nothing when it names none. */
|
|
26672
|
+
function runnerDisplayNameField(entry, runnerId) {
|
|
26673
|
+
const displayName = readRunnerDisplayName(entry.runnerAddons.map((a) => a.addonDir), runnerId);
|
|
26674
|
+
return displayName === void 0 ? {} : { displayName };
|
|
26675
|
+
}
|
|
26765
26676
|
var MAX_BACKOFF_MS = 3e4;
|
|
26766
26677
|
var CRASH_WINDOW_MS = 6e4;
|
|
26767
26678
|
var MAX_CRASHES_IN_WINDOW = 5;
|
|
@@ -26932,6 +26843,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26932
26843
|
state: "starting",
|
|
26933
26844
|
refusal: null,
|
|
26934
26845
|
announcedRefusal: null,
|
|
26846
|
+
lastCause: void 0,
|
|
26935
26847
|
child,
|
|
26936
26848
|
ownsGroup,
|
|
26937
26849
|
groupReap: null
|
|
@@ -26950,7 +26862,9 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26950
26862
|
}
|
|
26951
26863
|
});
|
|
26952
26864
|
child.stderr?.on("data", (data) => {
|
|
26953
|
-
|
|
26865
|
+
const text = data.toString();
|
|
26866
|
+
entry.lastCause = lastCauseAfterChunk(entry.lastCause, text);
|
|
26867
|
+
process.stderr.write(`[${runnerId}] ${text}`);
|
|
26954
26868
|
});
|
|
26955
26869
|
child.on("exit", (code, signal) => {
|
|
26956
26870
|
console.error(`[process-service EXIT] runner=${runnerId} code=${String(code)} signal=${String(signal)} state=${entry.state}`);
|
|
@@ -26980,6 +26894,7 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26980
26894
|
runnerId,
|
|
26981
26895
|
nodeId: parentNodeId,
|
|
26982
26896
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
26897
|
+
...runnerDisplayNameField(entry, runnerId),
|
|
26983
26898
|
code: refusal.code,
|
|
26984
26899
|
reason: refusal.reason,
|
|
26985
26900
|
remedy: refusal.remedy
|
|
@@ -27011,12 +26926,14 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
27011
26926
|
addonIds: entry.runnerAddons.map((addon) => addon.addonId),
|
|
27012
26927
|
crashesInWindow: decision.crashesInWindow,
|
|
27013
26928
|
windowMs: CRASH_WINDOW_MS,
|
|
26929
|
+
...runnerDisplayNameField(entry, runnerId),
|
|
26930
|
+
...entry.lastCause !== void 0 ? { lastError: entry.lastCause.text } : {},
|
|
27014
26931
|
...code !== null ? { exitCode: code } : {},
|
|
27015
26932
|
...signal !== null ? { signal } : {}
|
|
27016
26933
|
});
|
|
27017
26934
|
for (const addon of entry.runnerAddons) emitRunnerEvent(EventCategory$1.AddonCrashed, addon.addonId, {
|
|
27018
26935
|
addonId: addon.addonId,
|
|
27019
|
-
error:
|
|
26936
|
+
error: `${CRASH_BREAKER_ERROR_PREFIX} after ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms`
|
|
27020
26937
|
});
|
|
27021
26938
|
return;
|
|
27022
26939
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type RunnerRefusalReport } from "./runner-refusal.js";
|
|
2
2
|
import { type ChildProcess, type SpawnOptions } from "node:child_process";
|
|
3
3
|
import type { ServiceSchema } from "moleculer";
|
|
4
|
+
import { type RunnerCause } from "./runner-failure-info.js";
|
|
4
5
|
import { type RunnerAddonSpec } from "./runner-heap-flags.js";
|
|
5
6
|
import { type ProcessGroupOps } from "./runner-process-group.js";
|
|
6
7
|
interface SpawnedProcess {
|
|
@@ -38,6 +39,8 @@ interface SpawnedProcess {
|
|
|
38
39
|
* refusal and then died of something else did not refuse).
|
|
39
40
|
*/
|
|
40
41
|
announcedRefusal: RunnerRefusalReport | null;
|
|
42
|
+
/** The runner's own last stderr cause (an `Init failed` line outranks later noise); carried on the give-up event. */
|
|
43
|
+
lastCause: RunnerCause | undefined;
|
|
41
44
|
child: ChildProcess;
|
|
42
45
|
/** The runner leads its own process group (POSIX, D668); its pgid is its `pid`. */
|
|
43
46
|
readonly ownsGroup: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Opening words of the breaker's own `addon.crashed` text. It describes the breaker, never the cause. */
|
|
2
|
+
export declare const CRASH_BREAKER_ERROR_PREFIX = "Crash circuit-breaker tripped";
|
|
3
|
+
/** The cause out of one stderr line: the text after `Init failed for "<id>":`, else the line itself. */
|
|
4
|
+
export declare function causeOfStderrLine(line: string): string | undefined;
|
|
5
|
+
/** What stderr has said so far: the cause, and whether it came from an `Init failed` line. */
|
|
6
|
+
export interface RunnerCause {
|
|
7
|
+
readonly text: string;
|
|
8
|
+
readonly fromInit: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Fold a stderr chunk into the runner's last known cause. An `Init failed` line outranks later noise. */
|
|
11
|
+
export declare function lastCauseAfterChunk(previous: RunnerCause | undefined, chunk: string): RunnerCause | undefined;
|
|
12
|
+
/** Manifest display name of the runner: the addon whose id is the runner's, else the only addon hosted. */
|
|
13
|
+
export declare function readRunnerDisplayName(addonDirs: readonly string[], runnerId: string): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_log_file_read_protocol = require("./log-file-read-protocol-
|
|
2
|
+
const require_log_file_read_protocol = require("./log-file-read-protocol-DSV_vQRb.js");
|
|
3
3
|
let node_worker_threads = require("node:worker_threads");
|
|
4
4
|
//#region src/builtins/winston-logging/log-file-read-worker.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as LogFileIndexStore, i as serveRead, r as isToReader, t as CancelBook } from "./log-file-read-protocol-
|
|
1
|
+
import { a as LogFileIndexStore, i as serveRead, r as isToReader, t as CancelBook } from "./log-file-read-protocol-hTaAsYlX.mjs";
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
3
|
//#region src/builtins/winston-logging/log-file-read-worker.ts
|
|
4
4
|
/**
|
package/system/package.json
CHANGED
|
@@ -5,10 +5,10 @@ let zod = require("zod");
|
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
6
|
let _camstack_types_node = require("@camstack/types/node");
|
|
7
7
|
let node_net = require("node:net");
|
|
8
|
+
let node_fs = require("node:fs");
|
|
8
9
|
let node_path = require("node:path");
|
|
9
10
|
let node_os = require("node:os");
|
|
10
11
|
node_os = require_chunk.__toESM(node_os);
|
|
11
|
-
let node_fs = require("node:fs");
|
|
12
12
|
var MeshNodeCertificateBodySchema = zod.z.object({
|
|
13
13
|
nodeId: zod.z.string(),
|
|
14
14
|
serial: zod.z.string(),
|
|
@@ -4,9 +4,9 @@ import { z } from "zod";
|
|
|
4
4
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
|
|
5
5
|
import { writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
7
8
|
import { join } from "node:path";
|
|
8
9
|
import * as os$1 from "node:os";
|
|
9
|
-
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
10
10
|
var MeshNodeCertificateBodySchema = z.object({
|
|
11
11
|
nodeId: z.string(),
|
|
12
12
|
serial: z.string(),
|
package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-B9zFBNVa.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import * as fs$1 from "node:fs";
|
|
3
|
+
import { createReadStream, promises } from "node:fs";
|
|
2
4
|
import * as path$1 from "node:path";
|
|
3
5
|
import path from "node:path";
|
|
4
|
-
import { promisify } from "node:util";
|
|
5
6
|
import { HF_REPO, MODEL_FORMATS, describeCustomActions, hfModelUrl } from "@camstack/types/addon";
|
|
6
|
-
import
|
|
7
|
-
import { createReadStream, promises } from "node:fs";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
8
|
import { createServer } from "node:http";
|
|
9
9
|
import { brotliCompress, constants as constants$1, gzip } from "node:zlib";
|
|
10
10
|
import { PerformanceObserver } from "node:perf_hooks";
|
package/system/dist/{custom-action-registry-JuMHGKEc.js → custom-action-registry-CmWpSeMS.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
2
|
let node_crypto = require("node:crypto");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
3
5
|
let node_path = require("node:path");
|
|
4
6
|
node_path = require_chunk.__toESM(node_path);
|
|
5
|
-
let node_util = require("node:util");
|
|
6
7
|
let _camstack_types_addon = require("@camstack/types/addon");
|
|
7
|
-
let
|
|
8
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
8
|
+
let node_util = require("node:util");
|
|
9
9
|
let node_http = require("node:http");
|
|
10
10
|
let node_zlib = require("node:zlib");
|
|
11
11
|
let node_perf_hooks = require("node:perf_hooks");
|
package/system/dist/{log-file-read-protocol-D0WcLbIV.js → log-file-read-protocol-DSV_vQRb.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
2
|
const require_log_read_filter = require("./log-read-filter-Bi066jwU.js");
|
|
3
3
|
let zod = require("zod");
|
|
4
|
-
let node_fs_promises = require("node:fs/promises");
|
|
5
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
6
4
|
let node_path = require("node:path");
|
|
7
5
|
node_path = require_chunk.__toESM(node_path);
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
7
|
+
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
8
8
|
//#region src/builtins/winston-logging/log-file-cursor.ts
|
|
9
9
|
/**
|
|
10
10
|
* The rotated-file cursor (D898): a byte position in one daily file.
|
package/system/dist/{log-file-read-protocol-B7M3X3bT.mjs → log-file-read-protocol-hTaAsYlX.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as compileLogFilter, o as lineMatches } from "./log-read-filter-D7Ev3zm-.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import * as fs from "node:fs/promises";
|
|
4
3
|
import * as path$1 from "node:path";
|
|
4
|
+
import * as fs from "node:fs/promises";
|
|
5
5
|
//#region src/builtins/winston-logging/log-file-cursor.ts
|
|
6
6
|
/**
|
|
7
7
|
* The rotated-file cursor (D898): a byte position in one daily file.
|
|
@@ -2,12 +2,12 @@ import { G as DataStoreDatabaseSchema, M as DATABASE_SNAPSHOT_SUFFIX, Ts as defi
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createCipheriv, createDecipheriv, createHash, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from "node:crypto";
|
|
4
4
|
import { Buffer as Buffer$1 } from "buffer";
|
|
5
|
-
import * as fsp from "node:fs/promises";
|
|
6
|
-
import jn from "node:fs/promises";
|
|
7
|
-
import * as path$1 from "node:path";
|
|
8
|
-
import path, { basename, join, posix, win32 } from "node:path";
|
|
9
5
|
import * as fs$2 from "node:fs";
|
|
10
6
|
import fs from "node:fs";
|
|
7
|
+
import * as path$1 from "node:path";
|
|
8
|
+
import path, { basename, join, posix, win32 } from "node:path";
|
|
9
|
+
import * as fsp from "node:fs/promises";
|
|
10
|
+
import jn from "node:fs/promises";
|
|
11
11
|
import { EventEmitter } from "node:events";
|
|
12
12
|
import As, { Transform } from "node:stream";
|
|
13
13
|
import { StringDecoder } from "node:string_decoder";
|