@camstack/server 1.2.783 → 1.2.785

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +12 -11
  3. package/system/dist/addon-utils.js +1 -1
  4. package/system/dist/addon-utils.mjs +1 -1
  5. package/system/dist/{agent-https-kG6BvwKf.js → agent-https-B7lqIrF1.js} +2 -2
  6. package/system/dist/{agent-https-CEBLv9BA.mjs → agent-https-CACfLh65.mjs} +2 -2
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +3 -3
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +2 -2
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +3 -3
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +2 -2
  11. package/system/dist/builtins/alerts/alerts.addon.d.ts +6 -0
  12. package/system/dist/builtins/alerts/alerts.addon.js +241 -18
  13. package/system/dist/builtins/alerts/alerts.addon.mjs +264 -50
  14. package/system/dist/builtins/alerts/runner-alert.d.ts +6 -1
  15. package/system/dist/builtins/autotrack/index.js +1 -1
  16. package/system/dist/builtins/autotrack/index.mjs +1 -1
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +6 -6
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
  19. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/system/dist/builtins/camera-grid/index.js +2 -2
  22. package/system/dist/builtins/camera-grid/index.mjs +2 -2
  23. package/system/dist/builtins/composer/composer.addon.js +9 -8
  24. package/system/dist/builtins/composer/composer.addon.mjs +9 -8
  25. package/system/dist/builtins/composer/composition-evaluation.d.ts +2 -2
  26. package/system/dist/builtins/console-logging/index.js +1 -1
  27. package/system/dist/builtins/console-logging/index.mjs +1 -1
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.js +6 -6
  29. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +5 -5
  30. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +5 -5
  37. package/system/dist/builtins/keychain/index.mjs +5 -5
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +4 -4
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +3 -3
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +4 -4
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  42. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  43. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  44. package/system/dist/builtins/loki-logging/index.js +1 -1
  45. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  46. package/system/dist/builtins/native-metrics/native-metrics.addon.js +3 -3
  47. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +3 -3
  48. package/system/dist/builtins/platform-probe/index.js +3 -3
  49. package/system/dist/builtins/platform-probe/index.mjs +2 -2
  50. package/system/dist/builtins/record-entries/index.js +1 -1
  51. package/system/dist/builtins/record-entries/index.mjs +1 -1
  52. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/system/dist/builtins/snapshot/index.js +2 -2
  55. package/system/dist/builtins/snapshot/index.mjs +2 -2
  56. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -4
  57. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +3 -3
  58. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +5 -5
  61. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +5 -5
  62. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -3
  63. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +3 -3
  64. package/system/dist/builtins/system-config/system-config.addon.js +6 -6
  65. package/system/dist/builtins/system-config/system-config.addon.mjs +286 -286
  66. package/system/dist/builtins/winston-logging/index.js +2 -2
  67. package/system/dist/builtins/winston-logging/index.mjs +2 -2
  68. package/system/dist/{capture-engine-7_Barr9F.mjs → capture-engine-Dw82x5UW.mjs} +1 -1
  69. package/system/dist/{capture-engine-cNrHuwWH.js → capture-engine-n5mJUHzf.js} +1 -1
  70. package/system/dist/{composition-sources-7wEQtB6b.js → composition-sources-Cdow6PNn.js} +1 -1
  71. package/system/dist/{composition-sources-QUbTSbQL.mjs → composition-sources-D-bbLadz.mjs} +1 -1
  72. package/system/dist/{constants-BmX7aeHq.mjs → constants-C6UsfDdP.mjs} +1 -1
  73. package/system/dist/{constants-_Zq5aGIs.js → constants-Dmc-T4Zw.js} +1 -1
  74. package/system/dist/{device-ca-DqNfUZx4.mjs → device-ca-OQqtK7Yy.mjs} +1 -1
  75. package/system/dist/{device-ca-D9nNDHW_.js → device-ca-v8lGdWVk.js} +1 -1
  76. package/system/dist/{dist-CA672buZ.js → dist-1X5ccoX2.js} +70 -22
  77. package/system/dist/{dist-W0Eyg7Fm.mjs → dist-CRWinpyX.mjs} +70 -22
  78. package/system/dist/file-host-worker.js +1 -1
  79. package/system/dist/file-host-worker.mjs +1 -1
  80. package/system/dist/{hub-mdns-ciao-DWzAoaKF.mjs → hub-mdns-ciao-BQqm5eSM.mjs} +4 -4
  81. package/system/dist/{hub-mdns-ciao-DHlokCDH.js → hub-mdns-ciao-hBZgojNT.js} +4 -4
  82. package/system/dist/index.js +33 -116
  83. package/system/dist/index.mjs +27 -110
  84. package/system/dist/kernel/moleculer/process-service.d.ts +3 -0
  85. package/system/dist/kernel/moleculer/runner-failure-info.d.ts +13 -0
  86. package/system/dist/{legacy-integration-rows-door-CF_0_-U9.mjs → legacy-integration-rows-door-B7bwfRev.mjs} +1 -1
  87. package/system/dist/{legacy-integration-rows-door-BzVepX_e.js → legacy-integration-rows-door-BUjw8YoW.js} +1 -1
  88. package/system/dist/log-file-read-worker.js +1 -1
  89. package/system/dist/log-file-read-worker.mjs +1 -1
  90. package/system/dist/{restore-archive-ChBlqNSj.js → restore-archive-D9vM-Kzb.js} +7 -7
  91. package/system/dist/{restore-archive-CfET1ups.mjs → restore-archive-TST7tvBk.mjs} +84 -84
  92. package/system/dist/{wal-maintenance-Bg3rwpny.mjs → wal-maintenance-C7dJSaPS.mjs} +0 -0
  93. package/system/dist/{wal-maintenance-CNSrfmr8.js → wal-maintenance-wfVwXxO4.js} +0 -0
  94. package/system/package.json +1 -1
  95. package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-B9zFBNVa.mjs} +3 -3
  96. package/system/dist/{custom-action-registry-JuMHGKEc.js → custom-action-registry-CmWpSeMS.js} +3 -3
  97. package/system/dist/{log-file-read-protocol-D0WcLbIV.js → log-file-read-protocol-DSV_vQRb.js} +2 -2
  98. package/system/dist/{log-file-read-protocol-B7M3X3bT.mjs → log-file-read-protocol-hTaAsYlX.mjs} +1 -1
@@ -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-CA672buZ.js");
4
- const require_device_ca = require("./device-ca-D9nNDHW_.js");
3
+ const require_dist = require("./dist-1X5ccoX2.js");
4
+ const require_device_ca = require("./device-ca-v8lGdWVk.js");
5
5
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
6
6
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
7
7
  require("./builtins/alerts/index.js");
@@ -26,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-CNSrfmr8.js");
30
- const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BzVepX_e.js");
29
+ const require_wal_maintenance = require("./wal-maintenance-wfVwXxO4.js");
30
+ const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BUjw8YoW.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-kG6BvwKf.js");
36
- const require_constants = require("./constants-_Zq5aGIs.js");
35
+ const require_agent_https = require("./agent-https-B7lqIrF1.js");
36
+ const require_constants = require("./constants-Dmc-T4Zw.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-JuMHGKEc.js");
41
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-DHlokCDH.js");
40
+ const require_custom_action_registry = require("./custom-action-registry-CmWpSeMS.js");
41
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-hBZgojNT.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-ChBlqNSj.js");
44
+ const require_restore_archive = require("./restore-archive-D9vM-Kzb.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 node_fs_promises = require("node:fs/promises");
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
- process.stderr.write(`[${runnerId}] ${data.toString()}`);
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: `Crash circuit-breaker tripped after ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms`
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;
@@ -1,8 +1,8 @@
1
1
  import { i as __require } from "./chunk-CNf5ZN-e.mjs";
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
- 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";
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-CRWinpyX.mjs";
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-OQqtK7Yy.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-Bg3rwpny.mjs";
29
- import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-CF_0_-U9.mjs";
28
+ import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-C7dJSaPS.mjs";
29
+ import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-B7bwfRev.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-CEBLv9BA.mjs";
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";
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-CACfLh65.mjs";
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-C6UsfDdP.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-oHl1xltx.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-DWzAoaKF.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-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-BQqm5eSM.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-CfET1ups.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-TST7tvBk.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 { mkdir, rm, stat, unlink } from "node:fs/promises";
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
- process.stderr.write(`[${runnerId}] ${data.toString()}`);
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: `Crash circuit-breaker tripped after ${decision.crashesInWindow} crashes in ${CRASH_WINDOW_MS}ms`
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,4 +1,4 @@
1
- import { vs as collectSecretMarkerRefs } from "./dist-W0Eyg7Fm.mjs";
1
+ import { vs as collectSecretMarkerRefs } from "./dist-CRWinpyX.mjs";
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CA672buZ.js");
1
+ const require_dist = require("./dist-1X5ccoX2.js");
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_log_file_read_protocol = require("./log-file-read-protocol-D0WcLbIV.js");
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-B7M3X3bT.mjs";
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
  /**
@@ -1,17 +1,17 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-CA672buZ.js");
2
+ const require_dist = require("./dist-1X5ccoX2.js");
3
3
  let zod = require("zod");
4
4
  let node_crypto = require("node:crypto");
5
5
  let buffer = require("buffer");
6
- let node_fs_promises = require("node:fs/promises");
7
- let node_fs_promises$1 = require_chunk.__toESM(node_fs_promises, 1);
8
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
9
- let node_path = require("node:path");
10
- let node_path$1 = require_chunk.__toESM(node_path, 1);
11
- node_path = require_chunk.__toESM(node_path);
12
6
  let node_fs = require("node:fs");
13
7
  let node_fs$1 = require_chunk.__toESM(node_fs, 1);
14
8
  node_fs = require_chunk.__toESM(node_fs);
9
+ let node_path = require("node:path");
10
+ let node_path$1 = require_chunk.__toESM(node_path, 1);
11
+ node_path = require_chunk.__toESM(node_path);
12
+ let node_fs_promises = require("node:fs/promises");
13
+ let node_fs_promises$1 = require_chunk.__toESM(node_fs_promises, 1);
14
+ node_fs_promises = require_chunk.__toESM(node_fs_promises);
15
15
  let node_events = require("node:events");
16
16
  let node_stream = require("node:stream");
17
17
  node_stream = require_chunk.__toESM(node_stream, 1);