@camstack/system 1.2.176 → 1.2.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/addon-runner.js +2 -3
  2. package/dist/addon-runner.mjs +2 -3
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +8 -4
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +8 -4
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  19. package/dist/builtins/hub-forwarder/index.js +1 -1
  20. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  21. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  23. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  25. package/dist/builtins/local-network/local-network.addon.js +1 -1
  26. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  27. package/dist/builtins/loki-logging/index.js +1 -1
  28. package/dist/builtins/loki-logging/index.mjs +1 -1
  29. package/dist/builtins/native-metrics/native-metrics.addon.d.ts +0 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +2 -40
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -40
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/filter-compiler.d.ts +10 -0
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  45. package/dist/builtins/system-config/system-config.addon.js +1 -1
  46. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  47. package/dist/builtins/winston-logging/index.js +1 -1
  48. package/dist/builtins/winston-logging/index.mjs +1 -1
  49. package/dist/{dist-KItAWyKG.js → dist-C0IXtI_E.js} +100 -32
  50. package/dist/{dist-BianbXLH.mjs → dist-DMJ-DM7n.mjs} +95 -33
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +2 -4
  53. package/dist/index.mjs +3 -3
  54. package/dist/kernel/heap-allocation-sample.d.ts +107 -0
  55. package/dist/kernel/heap-spaces.d.ts +1 -6
  56. package/dist/{manifest-system-deps-BPpzK6cH.mjs → manifest-system-deps-BMD6YE4f.mjs} +3 -36
  57. package/dist/{manifest-system-deps-DU0BvqV-.js → manifest-system-deps-D6ncx0jA.js} +2 -47
  58. package/dist/{retired-settings-keys-CXYnLa7d.mjs → retired-settings-keys-D66kBk8P.mjs} +1 -1
  59. package/dist/{retired-settings-keys-DfNTZPhu.js → retired-settings-keys-eLv_RCfp.js} +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import "./dist-BianbXLH.mjs";
1
+ import "./dist-DMJ-DM7n.mjs";
2
2
  import "./hub-cap-forward-BdT320dq.mjs";
3
3
  import * as crypto$1 from "node:crypto";
4
4
  import { randomBytes, randomUUID } from "node:crypto";
@@ -576,37 +576,14 @@ function formatHeapSpaces(spaces, minMb = 32) {
576
576
  if (selected.length === 0) return "";
577
577
  return ` ${selected.map((s) => `${heapSpaceField(s.name)}=${mb(s.usedBytes)}MB`).join(" ")}`;
578
578
  }
579
- /**
580
- * Env var that authorises a heap snapshot on SIGUSR2.
581
- *
582
- * A snapshot is an admin mutation on a production hub: `writeHeapSnapshot`
583
- * streams a file the size of the heap to `/tmp` and stops the world while it
584
- * walks it — on the recorder that is a multi-GB file and a stall measured in
585
- * seconds. The per-space breakdown is ~1.2 µs and changes nothing. Welding them
586
- * to one signal priced the free answer at the cost of the expensive one.
587
- */
588
- var RUNNER_HEAP_SNAPSHOT_ENV = "CAMSTACK_RUNNER_HEAP_SNAPSHOT";
589
- /**
590
- * Whether the operator has authorised the snapshot half of SIGUSR2.
591
- *
592
- * Explicit `'on'` only. Anything else — unset, empty, `'true'`, `'1'` — is NOT
593
- * authorisation: a multi-GB stop-the-world write must never be reachable by a
594
- * value someone set for a different purpose.
595
- */
596
- function heapSnapshotAuthorised(env = process.env) {
597
- return env[RUNNER_HEAP_SNAPSHOT_ENV] === "on";
598
- }
599
579
  var defaultDeps = {
600
580
  readMemory: () => process.memoryUsage(),
601
581
  readSpaces: readHeapSpaces,
602
- writeSnapshot: (path) => {
603
- v8.writeHeapSnapshot(path);
604
- },
605
582
  env: process.env
606
583
  };
607
584
  /**
608
585
  * The SIGUSR2 report — memory + the FULL per-space breakdown, always; the
609
- * snapshot only when {@link heapSnapshotAuthorised}.
586
+ * snapshot NEVER see the note in the body.
610
587
  *
611
588
  * The breakdown here keeps every non-empty space at 0.1 MB, unlike the
612
589
  * heartbeat's filtered whole-MB pair: this is a hand-fired diagnostic read once
@@ -625,16 +602,6 @@ function emitHeapDiagnosticReport(request, deps = defaultDeps) {
625
602
  } catch (error) {
626
603
  request.sink.warn(`[mem] node="${request.label}" space report failed: ${error instanceof Error ? error.message : String(error)}`);
627
604
  }
628
- if (!heapSnapshotAuthorised(deps.env)) {
629
- request.sink.info(`[mem] node="${request.label}" heap snapshot NOT taken — it is an admin mutation (a multi-GB write and a stop-the-world walk of the heap). The per-space breakdown above is the free half and needs no authorisation. Set ${RUNNER_HEAP_SNAPSHOT_ENV}=on for this runner and signal again to take one.`);
630
- return;
631
- }
632
- try {
633
- deps.writeSnapshot(request.snapshotPath);
634
- request.sink.info(`[mem] node="${request.label}" heap snapshot written -> ${request.snapshotPath}`);
635
- } catch (error) {
636
- request.sink.warn(`[mem] node="${request.label}" snapshot failed: ${error instanceof Error ? error.message : String(error)}`);
637
- }
638
605
  }
639
606
  //#endregion
640
607
  //#region src/kernel/heap-watch.ts
@@ -9968,4 +9935,4 @@ async function defaultRun(command, args) {
9968
9935
  await execFileAsync(command, [...args], { timeout: INSTALL_TIMEOUT_MS });
9969
9936
  }
9970
9937
  //#endregion
9971
- export { buildUdsNativeCapProxy as $, emitHeapDiagnosticReport as $t, createUdsLoggerWithControl as A, HUB_MAIN_RSS_BUDGET_MB as At, readMoleculerFanoutMode as B, createV8Reclaimer as Bt, ipcParentLink as C, createAddonDataPlaneFacility as Ct, createUdsEventBus as D, HEAP_WATCH_INTERVAL_MS as Dt, createUdsEventBridge as E, HEAP_RECLAIM_TRIGGER_MB as Et, AGENT_CAP_FWD_SERVICE as F, RUNNER_RSS_BUDGET_ENV as Ft, createLocalTransport as G, reclaimIntervalMs as Gt, PARENT_ROUTED_PROVIDER_ADDON_ID as H, hubMainRssBudget as Ht, CapRouteResolver as I, ZERO_LOOP_DELAY as It, SocketChannel as J, startRunnerHeapWatch as Jt, UdsLocalTransportClient as K, shouldReclaim as Kt, CapRouteError as L, buildHeapSample as Lt, LocalChildRegistry as M, RSS_BUDGET_REANNOUNCE_MIN_MS as Mt, UDS_NO_ROUTE_PREFIX as N, RSS_BUDGET_RELEASE_RATIO as Nt, udsChildLogToWorkerEntry as O, HEAP_WATCH_WARN_RATIO as Ot, AGENT_CAP_FWD_ACTION as P, RUNNER_HEAP_WATCH_INTERVAL_MS as Pt, buildNativeCapProxy as Q, RUNNER_HEAP_SNAPSHOT_ENV as Qt, classifyCapRoute as R, createDeferredHeapWatchSink as Rt, buildLinkChain as S, runNpm as St, createParentUnownedCallHandler as T, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Tt, __resetCapUsageRegistryForTests as U, nextRssBudgetState as Ut, CapUsageRegistry as V, describeRss as Vt, getCapUsageRegistry as W, parseRssBudgetMb as Wt, FrameDecoder as X, DECISIVE_HEAP_SPACES as Xt, localEndpointPath as Y, strandedMb as Yt, encodeFrame as Z, HEAP_SPACE_REPORT_MIN_MB as Zt, AddonDepsManager as _, EVENT_PLANE_TOP_N as _n, CapabilityUnavailableError as _t, createUdsAddonContext as a, EMPTY_SOCKET_PLANE_BASELINE as an, createAddonService as at, brokerCallForCap as b, diffEventPlane as bn, resolveAddonClass as bt, getOrInitReadinessRegistryForClient as c, createSocketPlaneReader as cn, capActionName as ct, clusterEventTopic as d, EMPTY_SOCKET_DIRECTION as dn, capServiceName as dt, formatHeapSpaces as en, createBrokerDeviceManagerApi as et, getBrokerEventBus as f, createSocketDirectionCounters as fn, parseCapAction as ft, subscribePassthrough as g, socketDirectionMessages as gn, CapabilityHandle as gt, setNodeEventInterest as h, socketDirectionBytes as hn, DeviceRegistry as ht, createAddonContext as i, selectReportedSpaces as in, setWorkerNativeCapsChangeListener as it, LocalChildClient as j, HUB_RSS_BUDGET_ENV as jt, createUdsLogger as k, HUB_MAIN_HEAP_WATCH_LABEL as kt, setHubConnected as l, diffSocketPlane as ln, capActionSuffix as lt, registerEventBusService as m, sampleSocketDirection as mn, serializeTypedArrays as mt, installManifestPythonDeps as n, heapSpaceField as nn, getWorkerNativeCapSnapshot as nt, getWorkerDeviceRegistry as o, SOCKET_PLANE_TOP_N as on, validateProviderRegistrations as ot, getMoleculerEventStats as p, recordSocketFrame as pn, deserializeTypedArrays as pt, UdsLocalTransportServer as q, startHeapWatch as qt, adaptBrokerToCluster as r, readHeapSpaces as rn, mountNativeCapService as rt, getOrInitReadinessRegistry as s, createSocketPlaneMeter as sn, NATIVE_PROVIDER_SERVICE_INFIX as st, installManifestSystemDeps as t, heapSnapshotAuthorised as tn, getWorkerNativeCapProvider as tt, EVENT_TOPIC_PREFIX as u, formatSocketPlane as un, capBareAction as ut, createKernelHwAccel as v, createEventPlaneMeter as vn, copyBundledNativeModules as vt, localProviderLink as w, HEAP_RECLAIM_MIN_INTERVAL_MS as wt, brokerTransportLink as x, formatEventPlane as xn, resolveNpmInvocation as xt, resolveHwAccel as y, createEventPlaneReader as yn, installManifestNativeDeps as yt, callWithServiceDiscovery as z, createLoopDelayMeter as zt };
9938
+ export { buildUdsNativeCapProxy as $, formatHeapSpaces as $t, createUdsLoggerWithControl as A, HUB_MAIN_RSS_BUDGET_MB as At, readMoleculerFanoutMode as B, createV8Reclaimer as Bt, ipcParentLink as C, createAddonDataPlaneFacility as Ct, createUdsEventBus as D, HEAP_WATCH_INTERVAL_MS as Dt, createUdsEventBridge as E, HEAP_RECLAIM_TRIGGER_MB as Et, AGENT_CAP_FWD_SERVICE as F, RUNNER_RSS_BUDGET_ENV as Ft, createLocalTransport as G, reclaimIntervalMs as Gt, PARENT_ROUTED_PROVIDER_ADDON_ID as H, hubMainRssBudget as Ht, CapRouteResolver as I, ZERO_LOOP_DELAY as It, SocketChannel as J, startRunnerHeapWatch as Jt, UdsLocalTransportClient as K, shouldReclaim as Kt, CapRouteError as L, buildHeapSample as Lt, LocalChildRegistry as M, RSS_BUDGET_REANNOUNCE_MIN_MS as Mt, UDS_NO_ROUTE_PREFIX as N, RSS_BUDGET_RELEASE_RATIO as Nt, udsChildLogToWorkerEntry as O, HEAP_WATCH_WARN_RATIO as Ot, AGENT_CAP_FWD_ACTION as P, RUNNER_HEAP_WATCH_INTERVAL_MS as Pt, buildNativeCapProxy as Q, emitHeapDiagnosticReport as Qt, classifyCapRoute as R, createDeferredHeapWatchSink as Rt, buildLinkChain as S, runNpm as St, createParentUnownedCallHandler as T, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Tt, __resetCapUsageRegistryForTests as U, nextRssBudgetState as Ut, CapUsageRegistry as V, describeRss as Vt, getCapUsageRegistry as W, parseRssBudgetMb as Wt, FrameDecoder as X, DECISIVE_HEAP_SPACES as Xt, localEndpointPath as Y, strandedMb as Yt, encodeFrame as Z, HEAP_SPACE_REPORT_MIN_MB as Zt, AddonDepsManager as _, createEventPlaneReader as _n, CapabilityUnavailableError as _t, createUdsAddonContext as a, createSocketPlaneMeter as an, createAddonService as at, brokerCallForCap as b, resolveAddonClass as bt, getOrInitReadinessRegistryForClient as c, formatSocketPlane as cn, capActionName as ct, clusterEventTopic as d, recordSocketFrame as dn, capServiceName as dt, heapSpaceField as en, createBrokerDeviceManagerApi as et, getBrokerEventBus as f, sampleSocketDirection as fn, parseCapAction as ft, subscribePassthrough as g, createEventPlaneMeter as gn, CapabilityHandle as gt, setNodeEventInterest as h, EVENT_PLANE_TOP_N as hn, DeviceRegistry as ht, createAddonContext as i, SOCKET_PLANE_TOP_N as in, setWorkerNativeCapsChangeListener as it, LocalChildClient as j, HUB_RSS_BUDGET_ENV as jt, createUdsLogger as k, HUB_MAIN_HEAP_WATCH_LABEL as kt, setHubConnected as l, EMPTY_SOCKET_DIRECTION as ln, capActionSuffix as lt, registerEventBusService as m, socketDirectionMessages as mn, serializeTypedArrays as mt, installManifestPythonDeps as n, selectReportedSpaces as nn, getWorkerNativeCapSnapshot as nt, getWorkerDeviceRegistry as o, createSocketPlaneReader as on, validateProviderRegistrations as ot, getMoleculerEventStats as p, socketDirectionBytes as pn, deserializeTypedArrays as pt, UdsLocalTransportServer as q, startHeapWatch as qt, adaptBrokerToCluster as r, EMPTY_SOCKET_PLANE_BASELINE as rn, mountNativeCapService as rt, getOrInitReadinessRegistry as s, diffSocketPlane as sn, NATIVE_PROVIDER_SERVICE_INFIX as st, installManifestSystemDeps as t, readHeapSpaces as tn, getWorkerNativeCapProvider as tt, EVENT_TOPIC_PREFIX as u, createSocketDirectionCounters as un, capBareAction as ut, createKernelHwAccel as v, diffEventPlane as vn, copyBundledNativeModules as vt, localProviderLink as w, HEAP_RECLAIM_MIN_INTERVAL_MS as wt, brokerTransportLink as x, resolveNpmInvocation as xt, resolveHwAccel as y, formatEventPlane as yn, installManifestNativeDeps as yt, callWithServiceDiscovery as z, createLoopDelayMeter as zt };
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- require("./dist-KItAWyKG.js");
2
+ require("./dist-C0IXtI_E.js");
3
3
  require("./hub-cap-forward-DmHNjbB0.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -579,37 +579,14 @@ function formatHeapSpaces(spaces, minMb = 32) {
579
579
  if (selected.length === 0) return "";
580
580
  return ` ${selected.map((s) => `${heapSpaceField(s.name)}=${mb(s.usedBytes)}MB`).join(" ")}`;
581
581
  }
582
- /**
583
- * Env var that authorises a heap snapshot on SIGUSR2.
584
- *
585
- * A snapshot is an admin mutation on a production hub: `writeHeapSnapshot`
586
- * streams a file the size of the heap to `/tmp` and stops the world while it
587
- * walks it — on the recorder that is a multi-GB file and a stall measured in
588
- * seconds. The per-space breakdown is ~1.2 µs and changes nothing. Welding them
589
- * to one signal priced the free answer at the cost of the expensive one.
590
- */
591
- var RUNNER_HEAP_SNAPSHOT_ENV = "CAMSTACK_RUNNER_HEAP_SNAPSHOT";
592
- /**
593
- * Whether the operator has authorised the snapshot half of SIGUSR2.
594
- *
595
- * Explicit `'on'` only. Anything else — unset, empty, `'true'`, `'1'` — is NOT
596
- * authorisation: a multi-GB stop-the-world write must never be reachable by a
597
- * value someone set for a different purpose.
598
- */
599
- function heapSnapshotAuthorised(env = process.env) {
600
- return env[RUNNER_HEAP_SNAPSHOT_ENV] === "on";
601
- }
602
582
  var defaultDeps = {
603
583
  readMemory: () => process.memoryUsage(),
604
584
  readSpaces: readHeapSpaces,
605
- writeSnapshot: (path) => {
606
- node_v8.writeHeapSnapshot(path);
607
- },
608
585
  env: process.env
609
586
  };
610
587
  /**
611
588
  * The SIGUSR2 report — memory + the FULL per-space breakdown, always; the
612
- * snapshot only when {@link heapSnapshotAuthorised}.
589
+ * snapshot NEVER see the note in the body.
613
590
  *
614
591
  * The breakdown here keeps every non-empty space at 0.1 MB, unlike the
615
592
  * heartbeat's filtered whole-MB pair: this is a hand-fired diagnostic read once
@@ -628,16 +605,6 @@ function emitHeapDiagnosticReport(request, deps = defaultDeps) {
628
605
  } catch (error) {
629
606
  request.sink.warn(`[mem] node="${request.label}" space report failed: ${error instanceof Error ? error.message : String(error)}`);
630
607
  }
631
- if (!heapSnapshotAuthorised(deps.env)) {
632
- request.sink.info(`[mem] node="${request.label}" heap snapshot NOT taken — it is an admin mutation (a multi-GB write and a stop-the-world walk of the heap). The per-space breakdown above is the free half and needs no authorisation. Set ${RUNNER_HEAP_SNAPSHOT_ENV}=on for this runner and signal again to take one.`);
633
- return;
634
- }
635
- try {
636
- deps.writeSnapshot(request.snapshotPath);
637
- request.sink.info(`[mem] node="${request.label}" heap snapshot written -> ${request.snapshotPath}`);
638
- } catch (error) {
639
- request.sink.warn(`[mem] node="${request.label}" snapshot failed: ${error instanceof Error ? error.message : String(error)}`);
640
- }
641
608
  }
642
609
  //#endregion
643
610
  //#region src/kernel/heap-watch.ts
@@ -10151,12 +10118,6 @@ Object.defineProperty(exports, "RSS_BUDGET_RELEASE_RATIO", {
10151
10118
  return RSS_BUDGET_RELEASE_RATIO;
10152
10119
  }
10153
10120
  });
10154
- Object.defineProperty(exports, "RUNNER_HEAP_SNAPSHOT_ENV", {
10155
- enumerable: true,
10156
- get: function() {
10157
- return RUNNER_HEAP_SNAPSHOT_ENV;
10158
- }
10159
- });
10160
10121
  Object.defineProperty(exports, "RUNNER_HEAP_WATCH_INTERVAL_MS", {
10161
10122
  enumerable: true,
10162
10123
  get: function() {
@@ -10523,12 +10484,6 @@ Object.defineProperty(exports, "getWorkerNativeCapSnapshot", {
10523
10484
  return getWorkerNativeCapSnapshot;
10524
10485
  }
10525
10486
  });
10526
- Object.defineProperty(exports, "heapSnapshotAuthorised", {
10527
- enumerable: true,
10528
- get: function() {
10529
- return heapSnapshotAuthorised;
10530
- }
10531
- });
10532
10487
  Object.defineProperty(exports, "heapSpaceField", {
10533
10488
  enumerable: true,
10534
10489
  get: function() {
@@ -1,4 +1,4 @@
1
- import { Wt as asJsonObject } from "./dist-BianbXLH.mjs";
1
+ import { Gt as asJsonObject } from "./dist-DMJ-DM7n.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-KItAWyKG.js");
1
+ const require_dist = require("./dist-C0IXtI_E.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.176",
3
+ "version": "1.2.178",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",