@camstack/system 1.2.271 → 1.2.273

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 (63) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/autotrack/index.js +1 -1
  8. package/dist/builtins/autotrack/index.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/camera-grid/addon.d.ts +13 -0
  12. package/dist/builtins/camera-grid/grid-canvas-seed.d.ts +62 -0
  13. package/dist/builtins/camera-grid/grid-canvas.d.ts +4 -2
  14. package/dist/builtins/camera-grid/grid-child.d.ts +10 -0
  15. package/dist/builtins/camera-grid/grid-compositor.d.ts +10 -0
  16. package/dist/builtins/camera-grid/index.js +322 -16
  17. package/dist/builtins/camera-grid/index.mjs +322 -16
  18. package/dist/builtins/console-logging/index.js +1 -1
  19. package/dist/builtins/console-logging/index.mjs +1 -1
  20. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  21. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  22. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  23. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  24. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  25. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  26. package/dist/builtins/hub-forwarder/index.js +1 -1
  27. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  28. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  30. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  32. package/dist/builtins/local-network/local-network.addon.js +1 -1
  33. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  34. package/dist/builtins/loki-logging/index.js +1 -1
  35. package/dist/builtins/loki-logging/index.mjs +1 -1
  36. package/dist/builtins/native-metrics/cgroup-pids.d.ts +112 -0
  37. package/dist/builtins/native-metrics/native-metrics.addon.d.ts +1 -0
  38. package/dist/builtins/native-metrics/native-metrics.addon.js +209 -1
  39. package/dist/builtins/native-metrics/native-metrics.addon.mjs +209 -1
  40. package/dist/builtins/platform-probe/index.js +1 -1
  41. package/dist/builtins/platform-probe/index.mjs +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  43. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/snapshot/index.js +1 -1
  45. package/dist/builtins/snapshot/index.mjs +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  47. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  48. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  49. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  50. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  51. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/system-config/system-config.addon.js +1 -1
  53. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  54. package/dist/builtins/winston-logging/index.js +1 -1
  55. package/dist/builtins/winston-logging/index.mjs +1 -1
  56. package/dist/{dist-_YWIPtUH.js → dist-D5ONNqL6.js} +187 -11
  57. package/dist/{dist-Diz59Dhi.mjs → dist-DrLhdcwI.mjs} +187 -11
  58. package/dist/index.js +12 -5
  59. package/dist/index.mjs +12 -5
  60. package/dist/kernel/moleculer/process-service.d.ts +54 -0
  61. package/dist/{retired-settings-keys-C2ocoH_l.js → retired-settings-keys-1686ou3s.js} +1 -1
  62. package/dist/{retired-settings-keys-C_Hg5d37.mjs → retired-settings-keys-Du_0qedo.mjs} +1 -1
  63. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-_YWIPtUH.js");
3
+ const require_dist = require("./dist-D5ONNqL6.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
6
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -94942,14 +94942,19 @@ function runnerRssBudgetMb(addons) {
94942
94942
  return declared.length === 0 ? void 0 : Math.max(...declared);
94943
94943
  }
94944
94944
  /**
94945
- * Per-placement V8 heap flags (Block D). LIGHT runners cap their young generation
94946
- * (`--max-semi-space-size`) to reclaim V8's over-reservation — a measured ~15 MB/runner win — and
94947
- * keep an opt-in old-space cap (`CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`, unset = uncapped). HEAVY
94945
+ * Per-placement V8 flags (Block D). LIGHT runners cap their young generation
94946
+ * (`--max-semi-space-size`) to reclaim V8's over-reservation — a measured ~15 MB/runner win — bound
94947
+ * V8's platform thread pool (`--v8-pool-size`, see {@link LIGHT_V8_POOL_SIZE_DEFAULT}: a measured
94948
+ * ~58 threads across the hub's 29 light runners, against a cgroup `pids.max` this host has already
94949
+ * hit) and keep an opt-in old-space cap (`CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`, unset = uncapped). HEAVY
94948
94950
  * runners keep V8's default young generation but ALWAYS carry an old-space ceiling; see
94949
94951
  * {@link HEAVY_MAX_OLD_MB_DEFAULT} for why, and how a runner declares its own.
94950
94952
  *
94951
94953
  * Kill-switch: `CAMSTACK_RUNNER_HEAP_TUNING=off` disables all flags (recover without a rebuild).
94952
- * Overrides: `CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB` (default 2), `CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`
94954
+ * Overrides: `CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB` (default 2),
94955
+ * `CAMSTACK_RUNNER_LIGHT_V8_POOL_SIZE` (default {@link LIGHT_V8_POOL_SIZE_DEFAULT}; below 1 omits
94956
+ * the flag — `0` means "size from the CPU count" to V8, not "off"),
94957
+ * `CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`
94953
94958
  * (default unset = no old-space cap), `CAMSTACK_RUNNER_HEAVY_MAX_OLD_MB`
94954
94959
  * (default {@link HEAVY_MAX_OLD_MB_DEFAULT}; `0` restores the old uncapped behaviour).
94955
94960
  */
@@ -94960,6 +94965,8 @@ function runnerHeapFlags(addons) {
94960
94965
  if (!heavy) {
94961
94966
  const semiMb = positiveIntEnv("CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB", 2);
94962
94967
  if (semiMb > 0) flags.push(`--max-semi-space-size=${semiMb}`);
94968
+ const v8Pool = positiveIntEnv("CAMSTACK_RUNNER_LIGHT_V8_POOL_SIZE", 2);
94969
+ if (v8Pool > 0) flags.push(`--v8-pool-size=${v8Pool}`);
94963
94970
  }
94964
94971
  const oldMb = runnerMaxOldSpaceMb(addons, heavy);
94965
94972
  if (oldMb > 0) flags.push(`--max-old-space-size=${oldMb}`);
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { An as readinessKey, Cn as expandCapMethods, F as addonSettingsCapability, Ft as procedureAuthKey, Mn as scopeKey, Mt as objectInputDeclaresAddonId, On as parseJsonObject, Pn as EventCategory$1, S as RUNTIME_DEFAULTS, Tt as looseSchema, Ut as scopesAllowAddon, Vt as resolveMethodAuth, Wt as scopesAllowDeviceCap, _n as asJsonObject$1, _t as isVoidInput, an as errMsg$1, bn as createEvent, bt as lifecycleJobSchema, cn as DATAPLANE_SECRET_HEADER$1, dt as isArrayOutputSchema, ft as isCollectionArrayMethod, g as LOG_LEVEL_RANK, hn as ReadinessTimeoutError, jn as resolveCapMount, kn as parseJsonUnknown, ln as DEVICE_SETTINGS_CONTRIBUTION_METHODS, mn as ReadinessRegistry, mt as isObjectInput, st as extractNestedAddonId, t as ALL_CAPABILITY_DEFINITIONS, un as DEVICE_STATUS_METHOD, vn as asNumber, vt as kebabToCamel, wt as logLevelAtMost, xn as emitDownForOwnedCaps, y as METHOD_ACCESS_MAP, yn as asString$1 } from "./dist-Diz59Dhi.mjs";
2
+ import { An as readinessKey, Cn as expandCapMethods, F as addonSettingsCapability, Ft as procedureAuthKey, Mn as scopeKey, Mt as objectInputDeclaresAddonId, On as parseJsonObject, Pn as EventCategory$1, S as RUNTIME_DEFAULTS, Tt as looseSchema, Ut as scopesAllowAddon, Vt as resolveMethodAuth, Wt as scopesAllowDeviceCap, _n as asJsonObject$1, _t as isVoidInput, an as errMsg$1, bn as createEvent, bt as lifecycleJobSchema, cn as DATAPLANE_SECRET_HEADER$1, dt as isArrayOutputSchema, ft as isCollectionArrayMethod, g as LOG_LEVEL_RANK, hn as ReadinessTimeoutError, jn as resolveCapMount, kn as parseJsonUnknown, ln as DEVICE_SETTINGS_CONTRIBUTION_METHODS, mn as ReadinessRegistry, mt as isObjectInput, st as extractNestedAddonId, t as ALL_CAPABILITY_DEFINITIONS, un as DEVICE_STATUS_METHOD, vn as asNumber, vt as kebabToCamel, wt as logLevelAtMost, xn as emitDownForOwnedCaps, y as METHOD_ACCESS_MAP, yn as asString$1 } from "./dist-DrLhdcwI.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -94935,14 +94935,19 @@ function runnerRssBudgetMb(addons) {
94935
94935
  return declared.length === 0 ? void 0 : Math.max(...declared);
94936
94936
  }
94937
94937
  /**
94938
- * Per-placement V8 heap flags (Block D). LIGHT runners cap their young generation
94939
- * (`--max-semi-space-size`) to reclaim V8's over-reservation — a measured ~15 MB/runner win — and
94940
- * keep an opt-in old-space cap (`CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`, unset = uncapped). HEAVY
94938
+ * Per-placement V8 flags (Block D). LIGHT runners cap their young generation
94939
+ * (`--max-semi-space-size`) to reclaim V8's over-reservation — a measured ~15 MB/runner win — bound
94940
+ * V8's platform thread pool (`--v8-pool-size`, see {@link LIGHT_V8_POOL_SIZE_DEFAULT}: a measured
94941
+ * ~58 threads across the hub's 29 light runners, against a cgroup `pids.max` this host has already
94942
+ * hit) and keep an opt-in old-space cap (`CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`, unset = uncapped). HEAVY
94941
94943
  * runners keep V8's default young generation but ALWAYS carry an old-space ceiling; see
94942
94944
  * {@link HEAVY_MAX_OLD_MB_DEFAULT} for why, and how a runner declares its own.
94943
94945
  *
94944
94946
  * Kill-switch: `CAMSTACK_RUNNER_HEAP_TUNING=off` disables all flags (recover without a rebuild).
94945
- * Overrides: `CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB` (default 2), `CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`
94947
+ * Overrides: `CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB` (default 2),
94948
+ * `CAMSTACK_RUNNER_LIGHT_V8_POOL_SIZE` (default {@link LIGHT_V8_POOL_SIZE_DEFAULT}; below 1 omits
94949
+ * the flag — `0` means "size from the CPU count" to V8, not "off"),
94950
+ * `CAMSTACK_RUNNER_LIGHT_MAX_OLD_MB`
94946
94951
  * (default unset = no old-space cap), `CAMSTACK_RUNNER_HEAVY_MAX_OLD_MB`
94947
94952
  * (default {@link HEAVY_MAX_OLD_MB_DEFAULT}; `0` restores the old uncapped behaviour).
94948
94953
  */
@@ -94953,6 +94958,8 @@ function runnerHeapFlags(addons) {
94953
94958
  if (!heavy) {
94954
94959
  const semiMb = positiveIntEnv("CAMSTACK_RUNNER_LIGHT_SEMI_SPACE_MB", 2);
94955
94960
  if (semiMb > 0) flags.push(`--max-semi-space-size=${semiMb}`);
94961
+ const v8Pool = positiveIntEnv("CAMSTACK_RUNNER_LIGHT_V8_POOL_SIZE", 2);
94962
+ if (v8Pool > 0) flags.push(`--v8-pool-size=${v8Pool}`);
94956
94963
  }
94957
94964
  const oldMb = runnerMaxOldSpaceMb(addons, heavy);
94958
94965
  if (oldMb > 0) flags.push(`--max-old-space-size=${oldMb}`);
@@ -59,6 +59,60 @@ interface RunnerAddonSpec {
59
59
  * Reaching for a bigger number here when RSS is the complaint is the standard wrong move.
60
60
  */
61
61
  export declare const HEAVY_MAX_OLD_MB_DEFAULT = 1024;
62
+ /**
63
+ * V8 platform worker threads for a LIGHT runner (`--v8-pool-size`).
64
+ *
65
+ * ## What this bounds
66
+ *
67
+ * Node gives every process a V8 platform thread pool — background compilation,
68
+ * parallel marking and sweeping — defaulted to 4. It is not the libuv pool
69
+ * (`UV_THREADPOOL_SIZE`, which serves `fs`/`dns`/`zlib`/`crypto`) and it is
70
+ * deliberately not touched here; see below.
71
+ *
72
+ * ## Why it is worth a flag
73
+ *
74
+ * A container cgroup counts THREADS, not processes, and this cluster forks a
75
+ * runner per addon (D2). Measured on the live hub 2026-09-18 (20 cores,
76
+ * `pids.max=2048`), after 22 fork refusals in 45 minutes earlier that day:
77
+ *
78
+ * pids.current 991 · 47 node processes holding 469 threads
79
+ * of those, 29 LIGHT runners holding 274 (mean 9.4 threads each)
80
+ *
81
+ * A light runner is a control-plane addon with a 2 MB young generation. It does
82
+ * not generate the background GC work four marking threads exist for, and it
83
+ * pays 4 threads of the cgroup's pid budget for them anyway. Two returns ~58
84
+ * threads — ~6% of the container's live thread count — for background GC that
85
+ * is, on these heaps, a few milliseconds a cycle.
86
+ *
87
+ * ## Why TWO and never ZERO
88
+ *
89
+ * `--v8-pool-size=0` does not disable the pool: it tells V8 to size it from the
90
+ * detected parallelism. Measured locally 2026-09-18 on a node process holding
91
+ * the libuv pool open:
92
+ *
93
+ * default 11 threads
94
+ * --v8-pool-size=2 9 threads
95
+ * --v8-pool-size=0 18 threads
96
+ *
97
+ * So a value below 1 omits the flag entirely rather than being passed through —
98
+ * the same trap as `MALLOC_ARENA_MAX=0` in `runner-native-allocator.ts`. To turn
99
+ * the tuning off, use `CAMSTACK_RUNNER_HEAP_TUNING=off`.
100
+ *
101
+ * ## What is deliberately NOT bounded
102
+ *
103
+ * HEAVY runners keep V8's default: they hold real heaps (the recorder declares
104
+ * 3072 MB) where parallel marking is the difference between a pause and a stall.
105
+ *
106
+ * `UV_THREADPOOL_SIZE` is left alone on every runner. Its 4 threads are lazily
107
+ * spawned, and the measurement above says most light runners have spawned all
108
+ * four — i.e. they really do run concurrent `fs` work. Halving that would trade
109
+ * ~58 more threads for serialized filesystem I/O in runners whose I/O profile
110
+ * has not been measured, on a media system. A thread saving is not worth a
111
+ * media gap.
112
+ *
113
+ * Override: `CAMSTACK_RUNNER_LIGHT_V8_POOL_SIZE`.
114
+ */
115
+ export declare const LIGHT_V8_POOL_SIZE_DEFAULT = 2;
62
116
  interface SpawnedProcess {
63
117
  readonly pid: number;
64
118
  readonly nodeId: string;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-_YWIPtUH.js");
1
+ const require_dist = require("./dist-D5ONNqL6.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?
@@ -1,4 +1,4 @@
1
- import { _n as asJsonObject } from "./dist-Diz59Dhi.mjs";
1
+ import { _n as asJsonObject } from "./dist-DrLhdcwI.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?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.271",
3
+ "version": "1.2.273",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",