@camstack/server 1.2.927 → 1.2.929

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 (235) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +11 -14
  3. package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
  4. package/system/dist/addon-id-Di0lNJ89.js +50 -0
  5. package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
  6. package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
  7. package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
  8. package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
  9. package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
  10. package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
  11. package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
  12. package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
  13. package/system/dist/base-device-2sL1DMm1.js +1103 -0
  14. package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
  15. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -1
  17. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +3 -1
  19. package/system/dist/builtins/alerts/alerts.addon.js +113 -56
  20. package/system/dist/builtins/alerts/alerts.addon.mjs +58 -1
  21. package/system/dist/builtins/autotrack/index.js +21 -17
  22. package/system/dist/builtins/autotrack/index.mjs +5 -1
  23. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -2
  25. package/system/dist/builtins/calendars/calendars.addon.js +8 -6
  26. package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
  27. package/system/dist/builtins/camera-grid/index.js +615 -58
  28. package/system/dist/builtins/camera-grid/index.mjs +558 -1
  29. package/system/dist/builtins/composer/composer.addon.js +788 -209
  30. package/system/dist/builtins/composer/composer.addon.mjs +583 -4
  31. package/system/dist/builtins/console-logging/index.js +4 -3
  32. package/system/dist/builtins/console-logging/index.mjs +2 -1
  33. package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
  35. package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
  36. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
  37. package/system/dist/builtins/device-history/device-history.addon.js +110 -31
  38. package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
  39. package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
  40. package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
  41. package/system/dist/builtins/hub-forwarder/index.js +4 -3
  42. package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
  43. package/system/dist/builtins/keychain/index.js +31 -28
  44. package/system/dist/builtins/keychain/index.mjs +7 -4
  45. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
  47. package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
  48. package/system/dist/builtins/local-auth/local-auth.addon.mjs +103 -3
  49. package/system/dist/builtins/local-network/local-network.addon.js +43 -39
  50. package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
  51. package/system/dist/builtins/loki-logging/index.js +23 -17
  52. package/system/dist/builtins/loki-logging/index.mjs +7 -1
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +142 -1
  55. package/system/dist/builtins/platform-probe/index.js +25 -23
  56. package/system/dist/builtins/platform-probe/index.mjs +4 -2
  57. package/system/dist/builtins/record-entries/index.js +9 -7
  58. package/system/dist/builtins/record-entries/index.mjs +3 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/snapshot/index.js +97 -44
  62. package/system/dist/builtins/snapshot/index.mjs +54 -1
  63. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +2 -1
  65. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +17 -14
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +6 -3
  73. package/system/dist/builtins/winston-logging/index.js +7 -5
  74. package/system/dist/builtins/winston-logging/index.mjs +3 -1
  75. package/system/dist/calendars.cap-CaFlShS9.js +155 -0
  76. package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
  77. package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
  78. package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
  79. package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
  80. package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
  81. package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
  82. package/system/dist/capability-definition-HCmTem8c.js +242 -0
  83. package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
  84. package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
  85. package/system/dist/command-origin-claim-Cief660O.js +35 -0
  86. package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
  87. package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
  88. package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
  89. package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
  90. package/system/dist/constants-C860Y6U4.js +26 -0
  91. package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
  92. package/system/dist/constants-DCLpoF4L.mjs +21 -0
  93. package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
  94. package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
  95. package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
  96. package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
  97. package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
  98. package/system/dist/custom-actions-D92NRi2c.js +36 -0
  99. package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
  100. package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
  101. package/system/dist/declared-device-BWphj9WE.js +303 -0
  102. package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
  103. package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
  104. package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
  105. package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
  106. package/system/dist/device-certificate-CguVACQO.js +162 -0
  107. package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
  108. package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
  109. package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
  110. package/system/dist/device-kind-CsSiv_YF.js +101 -0
  111. package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
  112. package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
  113. package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
  114. package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
  115. package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
  116. package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
  117. package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
  118. package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
  119. package/system/dist/device-type-CbQsnFdC.js +477 -0
  120. package/system/dist/device-type-DgEvK3ch.mjs +454 -0
  121. package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
  122. package/system/dist/entry-kind-cq90c--V.js +55 -0
  123. package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
  124. package/system/dist/error.cap-DBhgPeWK.js +3848 -0
  125. package/system/dist/file-host-worker.js +1 -1
  126. package/system/dist/file-host-worker.mjs +1 -1
  127. package/system/dist/history-catalog-BKRarIL_.js +831 -0
  128. package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
  129. package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
  130. package/system/dist/{hub-identity-BBXzP6Ve.mjs → hub-identity-DjMN9Ac2.mjs} +1 -1
  131. package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
  132. package/system/dist/{hub-mdns-ciao-DG17NbGU.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
  133. package/system/dist/index.js +763 -151
  134. package/system/dist/index.mjs +624 -12
  135. package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
  136. package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
  137. package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
  138. package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
  139. package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
  140. package/system/dist/l10n-CGMvp7NF.js +15 -0
  141. package/system/dist/labels-DX5S8deC.js +81 -0
  142. package/system/dist/labels-DsBcU7md.mjs +64 -0
  143. package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
  144. package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
  145. package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
  146. package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
  147. package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
  148. package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
  149. package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
  150. package/system/dist/mask-shape-CmPA2fst.js +92 -0
  151. package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
  152. package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
  153. package/system/dist/migration-BMjgkyG2.js +380 -0
  154. package/system/dist/migration-DRJAtdy7.mjs +321 -0
  155. package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
  156. package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
  157. package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
  158. package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
  159. package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
  160. package/system/dist/ops-log-pxt9176Z.js +81 -0
  161. package/system/dist/pinned-binary-BOhOSNff.js +28 -0
  162. package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
  163. package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
  164. package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
  165. package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
  166. package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
  167. package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
  168. package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
  169. package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
  170. package/system/dist/quantity-lY1KiTSZ.js +143 -0
  171. package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
  172. package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
  173. package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
  174. package/system/dist/record-entries.cap-ti1C046R.js +80 -0
  175. package/system/dist/record-kind-DoBfYHCs.js +203 -0
  176. package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
  177. package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
  178. package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
  179. package/system/dist/records.cap-ClcWV64i.js +329 -0
  180. package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
  181. package/system/dist/relocate-CdVQAk-w.js +804 -0
  182. package/system/dist/relocate-CoZZTui1.mjs +661 -0
  183. package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
  184. package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
  185. package/system/dist/{restore-archive-kwtBd00M.mjs → restore-archive-CjAyKpgX.mjs} +3 -1
  186. package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
  187. package/system/dist/scoped-settings-CylSSq_8.js +955 -0
  188. package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
  189. package/system/dist/server-name-BIhLuHvX.mjs +35 -0
  190. package/system/dist/server-name-OALNvpqC.js +52 -0
  191. package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
  192. package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
  193. package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
  194. package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
  195. package/system/dist/source-info-DGB7SdB_.mjs +190 -0
  196. package/system/dist/source-info-DtWf4k2j.js +225 -0
  197. package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
  198. package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
  199. package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
  200. package/system/dist/storage-location-CTweDMZf.js +198 -0
  201. package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
  202. package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
  203. package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
  204. package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
  205. package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
  206. package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
  207. package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
  208. package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
  209. package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
  210. package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
  211. package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
  212. package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
  213. package/system/dist/system-reasons-Be_k1W8g.js +25 -0
  214. package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
  215. package/system/dist/tag-BxLazvVb.js +2138 -0
  216. package/system/dist/tag-uZBAq6ox.mjs +2073 -0
  217. package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
  218. package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
  219. package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
  220. package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
  221. package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
  222. package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
  223. package/system/dist/zod-secret-DS7mj1bk.js +78 -0
  224. package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
  225. package/system/package.json +1 -1
  226. package/system/dist/composition-sources-BI614LJx.mjs +0 -141
  227. package/system/dist/composition-sources-v_kkb8A9.js +0 -152
  228. package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
  229. package/system/dist/coral-accelerators-DBlgWB8k.mjs +0 -231
  230. package/system/dist/dist-BCHMSqzc.mjs +0 -143467
  231. package/system/dist/dist-BZfvhfS1.js +0 -146970
  232. package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
  233. package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
  234. package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
  235. package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
@@ -3,7 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BZfvhfS1.js");
6
+ const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
7
+ const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
8
+ const require_metrics_provider_cap = require("../../metrics-provider.cap-BcmQUt6l.js");
7
9
  let node_fs = require("node:fs");
8
10
  node_fs = require_chunk.__toESM(node_fs);
9
11
  let node_fs_promises = require("node:fs/promises");
@@ -11,6 +13,145 @@ let node_util = require("node:util");
11
13
  let node_os = require("node:os");
12
14
  node_os = require_chunk.__toESM(node_os);
13
15
  let node_child_process = require("node:child_process");
16
+ //#region ../types/dist/esm/metrics/load-series-fold.mjs
17
+ /** Bucket key for rows no addon owns. Stable, so its series is continuous. */
18
+ var UNATTRIBUTED_BUCKET_KEY = "__unattributed__";
19
+ var ROOT_BUCKET_KEY = "__root__";
20
+ function bucketFor(row) {
21
+ if (row.addonId !== null) return {
22
+ key: row.addonId,
23
+ kind: "addon"
24
+ };
25
+ if (row.classification === "root") return {
26
+ key: ROOT_BUCKET_KEY,
27
+ kind: "root"
28
+ };
29
+ return {
30
+ key: UNATTRIBUTED_BUCKET_KEY,
31
+ kind: "unattributed"
32
+ };
33
+ }
34
+ /** Round to one decimal — the precision both producers already emit at. */
35
+ function deci(value) {
36
+ return Math.round(value * 10) / 10;
37
+ }
38
+ /**
39
+ * Fold one snapshot into one point per function.
40
+ *
41
+ * Produces a ONE-SAMPLE point: `min === max` on every field, `samples === 1`.
42
+ * That is what lets a live event and a reduced server bucket sit in the same
43
+ * series without the consumer knowing which is which.
44
+ */
45
+ function foldSnapshotByFunction(rows, atMs) {
46
+ const acc = /* @__PURE__ */ new Map();
47
+ for (const row of rows) {
48
+ const { key, kind } = bucketFor(row);
49
+ const cur = acc.get(key) ?? {
50
+ kind,
51
+ main: 0,
52
+ gc: 0,
53
+ lifetime: 0,
54
+ memory: 0,
55
+ count: 0,
56
+ splitKnown: true
57
+ };
58
+ const known = row.cpuMainPercent !== null && row.cpuGcPercent !== null;
59
+ acc.set(key, {
60
+ kind: cur.kind,
61
+ main: cur.main + (row.cpuMainPercent ?? 0),
62
+ gc: cur.gc + (row.cpuGcPercent ?? 0),
63
+ lifetime: cur.lifetime + row.cpuPercent,
64
+ memory: cur.memory + row.memoryRssBytes,
65
+ count: cur.count + 1,
66
+ splitKnown: cur.splitKnown && known
67
+ });
68
+ }
69
+ return [...acc.entries()].map(([key, a]) => {
70
+ const main = a.splitKnown ? deci(a.main) : null;
71
+ const gc = a.splitKnown ? deci(a.gc) : null;
72
+ const lifetime = deci(a.lifetime);
73
+ return {
74
+ key,
75
+ kind: a.kind,
76
+ point: {
77
+ atMs,
78
+ samples: 1,
79
+ cpuMainPercent: main,
80
+ cpuMainPercentMin: main,
81
+ cpuGcPercent: gc,
82
+ cpuGcPercentMin: gc,
83
+ cpuLifetimePercent: lifetime,
84
+ cpuLifetimePercentMin: lifetime,
85
+ memoryRssBytes: a.memory,
86
+ memoryRssBytesMin: a.memory,
87
+ processCount: a.count,
88
+ processCountMin: a.count
89
+ }
90
+ };
91
+ });
92
+ }
93
+ /** The narrower of two bounds, treating `null` (UNKNOWN) as absorbing. */
94
+ function minNullable(a, b) {
95
+ if (a === null || b === null) return null;
96
+ return a < b ? a : b;
97
+ }
98
+ function maxNullable(a, b) {
99
+ if (a === null || b === null) return null;
100
+ return a > b ? a : b;
101
+ }
102
+ /** Merge `next` into `held`, keeping the widest [min, max] of each field. */
103
+ function mergePoints(held, next, atMs) {
104
+ return {
105
+ atMs,
106
+ samples: held.samples + next.samples,
107
+ cpuMainPercent: maxNullable(held.cpuMainPercent, next.cpuMainPercent),
108
+ cpuMainPercentMin: minNullable(held.cpuMainPercentMin, next.cpuMainPercentMin),
109
+ cpuGcPercent: maxNullable(held.cpuGcPercent, next.cpuGcPercent),
110
+ cpuGcPercentMin: minNullable(held.cpuGcPercentMin, next.cpuGcPercentMin),
111
+ cpuLifetimePercent: Math.max(held.cpuLifetimePercent, next.cpuLifetimePercent),
112
+ cpuLifetimePercentMin: Math.min(held.cpuLifetimePercentMin, next.cpuLifetimePercentMin),
113
+ memoryRssBytes: Math.max(held.memoryRssBytes, next.memoryRssBytes),
114
+ memoryRssBytesMin: Math.min(held.memoryRssBytesMin, next.memoryRssBytesMin),
115
+ processCount: Math.max(held.processCount, next.processCount),
116
+ processCountMin: Math.min(held.processCountMin, next.processCountMin)
117
+ };
118
+ }
119
+ /**
120
+ * The bucket width that brings `spanMs` down to at most `maxPoints` points,
121
+ * snapped up to a whole multiple of the sampling cadence.
122
+ *
123
+ * Returns `cadenceMs` (no reduction) when the span already fits. A caller that
124
+ * asks for a `maxPoints` of 0 or less gets no reduction rather than an
125
+ * infinite bucket — a nonsensical request must not produce a plausible chart.
126
+ */
127
+ function resolveBucketMs(spanMs, cadenceMs, maxPoints) {
128
+ if (maxPoints <= 0 || cadenceMs <= 0 || spanMs <= 0) return Math.max(cadenceMs, 1);
129
+ const wanted = spanMs / maxPoints;
130
+ if (wanted <= cadenceMs) return cadenceMs;
131
+ return Math.ceil(wanted / cadenceMs) * cadenceMs;
132
+ }
133
+ /**
134
+ * Reduce one function's points into buckets of `bucketMs`, preserving the
135
+ * extremes.
136
+ *
137
+ * Points are expected oldest-first and are returned oldest-first. A bucket
138
+ * with no samples is ABSENT — not zero, not interpolated, not the previous
139
+ * value held over.
140
+ */
141
+ function reducePoints(points, bucketMs, origin) {
142
+ if (bucketMs <= 0 || points.length === 0) return points;
143
+ const buckets = /* @__PURE__ */ new Map();
144
+ for (const point of points) {
145
+ const start = origin + Math.floor((point.atMs - origin) / bucketMs) * bucketMs;
146
+ const held = buckets.get(start);
147
+ buckets.set(start, held === void 0 ? {
148
+ ...point,
149
+ atMs: start
150
+ } : mergePoints(held, point, start));
151
+ }
152
+ return [...buckets.values()].toSorted((a, b) => a.atMs - b.atMs);
153
+ }
154
+ //#endregion
14
155
  //#region src/builtins/native-metrics/cgroup-memory.ts
15
156
  /** `readFileSync`, with every failure flattened to `null`. */
16
157
  var nodeCgroupFileReader = { read(path) {
@@ -300,7 +441,7 @@ var ContainerMemoryProbe = class {
300
441
  this.layout = resolveCgroupMemoryLayout(this.fs);
301
442
  } catch (err) {
302
443
  this.layout = null;
303
- this.logger.warn("cgroup memory resolution failed — container memory will be ABSENT", { meta: { error: require_dist.errMsg(err) } });
444
+ this.logger.warn("cgroup memory resolution failed — container memory will be ABSENT", { meta: { error: require_scoped_settings.errMsg(err) } });
304
445
  return null;
305
446
  }
306
447
  if (this.layout === null) {
@@ -494,7 +635,7 @@ var ContainerPidsProbe = class {
494
635
  this.layout = resolveCgroupPidsLayout(this.fs);
495
636
  } catch (err) {
496
637
  this.layout = null;
497
- this.logger.warn("cgroup pids resolution failed — the pid ceiling will be ABSENT", { meta: { error: require_dist.errMsg(err) } });
638
+ this.logger.warn("cgroup pids resolution failed — the pid ceiling will be ABSENT", { meta: { error: require_scoped_settings.errMsg(err) } });
498
639
  return null;
499
640
  }
500
641
  if (this.layout === null) {
@@ -989,7 +1130,7 @@ function mergeLoadSeries(input) {
989
1130
  oldestAtMs: null
990
1131
  };
991
1132
  const byKey = /* @__PURE__ */ new Map();
992
- for (const sample of samples) for (const bucket of require_dist.foldSnapshotByFunction(toFoldRows(sample.processes), sample.atMs)) {
1133
+ for (const sample of samples) for (const bucket of foldSnapshotByFunction(toFoldRows(sample.processes), sample.atMs)) {
993
1134
  const held = byKey.get(bucket.key);
994
1135
  if (held === void 0) byKey.set(bucket.key, {
995
1136
  kind: bucket.kind,
@@ -1000,12 +1141,12 @@ function mergeLoadSeries(input) {
1000
1141
  const oldestAtMs = samples[0]?.atMs ?? null;
1001
1142
  const newestAtMs = samples.at(-1)?.atMs ?? oldestAtMs;
1002
1143
  const spanMs = oldestAtMs === null || newestAtMs === null ? 0 : newestAtMs - oldestAtMs + input.cadenceMs;
1003
- const bucketMs = input.maxPoints === void 0 ? input.cadenceMs : require_dist.resolveBucketMs(spanMs, input.cadenceMs, input.maxPoints);
1144
+ const bucketMs = input.maxPoints === void 0 ? input.cadenceMs : resolveBucketMs(spanMs, input.cadenceMs, input.maxPoints);
1004
1145
  const origin = oldestAtMs ?? 0;
1005
1146
  const series = [...byKey.entries()].map(([key, held]) => ({
1006
1147
  key,
1007
1148
  kind: held.kind,
1008
- points: bucketMs > input.cadenceMs ? require_dist.reducePoints(held.points, bucketMs, origin) : held.points
1149
+ points: bucketMs > input.cadenceMs ? reducePoints(held.points, bucketMs, origin) : held.points
1009
1150
  }));
1010
1151
  const weight = (s) => {
1011
1152
  const last = s.points.at(-1);
@@ -1174,7 +1315,7 @@ function refusalCounts(result) {
1174
1315
  /** The fold's function key of a process: the same rule as `foldSnapshotByFunction`. */
1175
1316
  function runnerScopeOf(process) {
1176
1317
  if (process.addonId !== null) return process.addonId;
1177
- return process.classification === "root" ? require_dist.ROOT_BUCKET_KEY : require_dist.UNATTRIBUTED_BUCKET_KEY;
1318
+ return process.classification === "root" ? ROOT_BUCKET_KEY : UNATTRIBUTED_BUCKET_KEY;
1178
1319
  }
1179
1320
  function round1(value) {
1180
1321
  return Math.round(value * 10) / 10;
@@ -1406,8 +1547,8 @@ function assembleRunnerSamples(answers) {
1406
1547
  const m = main.get(atMs)?.get(scope);
1407
1548
  const g = gc.get(atMs)?.get(scope);
1408
1549
  const split = m !== void 0 && g !== void 0;
1409
- const isRoot = scope === require_dist.ROOT_BUCKET_KEY;
1410
- const isUnattributed = scope === require_dist.UNATTRIBUTED_BUCKET_KEY;
1550
+ const isRoot = scope === ROOT_BUCKET_KEY;
1551
+ const isUnattributed = scope === UNATTRIBUTED_BUCKET_KEY;
1411
1552
  for (let i = 0; i < n; i += 1) processes.push({
1412
1553
  pid: 0,
1413
1554
  addonId: isRoot || isUnattributed ? null : scope,
@@ -2502,7 +2643,7 @@ function narrowWorkerState(state) {
2502
2643
  * Native metrics — CPU, memory, disk usage sampling.
2503
2644
  * Settings appear under Cluster → NodeDetail → Settings.
2504
2645
  */
2505
- var NativeMetricsAddon = class NativeMetricsAddon extends require_dist.BaseAddon {
2646
+ var NativeMetricsAddon = class NativeMetricsAddon extends require_base_addon.BaseAddon {
2506
2647
  provider = null;
2507
2648
  startedAtMs = Date.now();
2508
2649
  snapshotTimer = null;
@@ -2649,13 +2790,13 @@ var NativeMetricsAddon = class NativeMetricsAddon extends require_dist.BaseAddon
2649
2790
  this.startProcessSnapshotTimer();
2650
2791
  if (this.metricsHistory !== null) {
2651
2792
  const history = this.metricsHistory;
2652
- this.ctx.addDisposer(this.ctx.eventBus.subscribe({ category: require_dist.EventCategory.MetricsNodeResourcesSnapshot }, (event) => {
2793
+ this.ctx.addDisposer(this.ctx.eventBus.subscribe({ category: require_base_addon.EventCategory.MetricsNodeResourcesSnapshot }, (event) => {
2653
2794
  history.recordTotals(event.data.nodeId, event.data.timestamp, event.data.snapshot);
2654
2795
  }));
2655
2796
  }
2656
- this.ctx.addDisposer(this.ctx.eventBus.subscribe({ category: require_dist.EventCategory.MetricsNodeProcessesSnapshot }, (event) => this.retainSnapshot(event.data.nodeId, event.data.timestamp, event.data.processes, event.data.containerMemory)));
2797
+ this.ctx.addDisposer(this.ctx.eventBus.subscribe({ category: require_base_addon.EventCategory.MetricsNodeProcessesSnapshot }, (event) => this.retainSnapshot(event.data.nodeId, event.data.timestamp, event.data.processes, event.data.containerMemory)));
2657
2798
  return [{
2658
- capability: require_dist.metricsProviderCapability,
2799
+ capability: require_metrics_provider_cap.metricsProviderCapability,
2659
2800
  provider: composed
2660
2801
  }];
2661
2802
  }
@@ -2872,7 +3013,7 @@ var NativeMetricsAddon = class NativeMetricsAddon extends require_dist.BaseAddon
2872
3013
  coarse,
2873
3014
  emittedAt: timestamp
2874
3015
  };
2875
- eventBus.emit(require_dist.createEvent(require_dist.EventCategory.MetricsNodeResourcesSnapshot, {
3016
+ eventBus.emit(require_base_addon.createEvent(require_base_addon.EventCategory.MetricsNodeResourcesSnapshot, {
2876
3017
  type: "node",
2877
3018
  id: nodeId,
2878
3019
  nodeId
@@ -2910,7 +3051,7 @@ var NativeMetricsAddon = class NativeMetricsAddon extends require_dist.BaseAddon
2910
3051
  }
2911
3052
  const containerMemory = this.memoryProbe?.sample() ?? null;
2912
3053
  this.pidsProbe?.sample();
2913
- eventBus.emit(require_dist.createEvent(require_dist.EventCategory.MetricsNodeProcessesSnapshot, {
3054
+ eventBus.emit(require_base_addon.createEvent(require_base_addon.EventCategory.MetricsNodeProcessesSnapshot, {
2914
3055
  type: "node",
2915
3056
  id: nodeId,
2916
3057
  nodeId
@@ -1,4 +1,6 @@
1
- import { Co as reducePoints, Fn as UNATTRIBUTED_BUCKET_KEY, Fo as resolveBucketMs, Hu as errMsg, Ia as metricsProviderCapability, Lc as BaseAddon, Pl as createEvent, Wu as EventCategory, dn as ROOT_BUCKET_KEY, ki as foldSnapshotByFunction } from "../../dist-BCHMSqzc.mjs";
1
+ import { b as EventCategory, p as createEvent, t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
2
+ import { Z as errMsg } from "../../scoped-settings-DVWUIP7Z.mjs";
3
+ import { t as metricsProviderCapability } from "../../metrics-provider.cap-BNmcHDkQ.mjs";
2
4
  import * as fs$1 from "node:fs";
3
5
  import { constants, readFileSync } from "node:fs";
4
6
  import { access, readFile, readdir } from "node:fs/promises";
@@ -6,6 +8,145 @@ import { promisify } from "node:util";
6
8
  import * as os$1 from "node:os";
7
9
  import { platform } from "node:os";
8
10
  import { execFile } from "node:child_process";
11
+ //#region ../types/dist/esm/metrics/load-series-fold.mjs
12
+ /** Bucket key for rows no addon owns. Stable, so its series is continuous. */
13
+ var UNATTRIBUTED_BUCKET_KEY = "__unattributed__";
14
+ var ROOT_BUCKET_KEY = "__root__";
15
+ function bucketFor(row) {
16
+ if (row.addonId !== null) return {
17
+ key: row.addonId,
18
+ kind: "addon"
19
+ };
20
+ if (row.classification === "root") return {
21
+ key: ROOT_BUCKET_KEY,
22
+ kind: "root"
23
+ };
24
+ return {
25
+ key: UNATTRIBUTED_BUCKET_KEY,
26
+ kind: "unattributed"
27
+ };
28
+ }
29
+ /** Round to one decimal — the precision both producers already emit at. */
30
+ function deci(value) {
31
+ return Math.round(value * 10) / 10;
32
+ }
33
+ /**
34
+ * Fold one snapshot into one point per function.
35
+ *
36
+ * Produces a ONE-SAMPLE point: `min === max` on every field, `samples === 1`.
37
+ * That is what lets a live event and a reduced server bucket sit in the same
38
+ * series without the consumer knowing which is which.
39
+ */
40
+ function foldSnapshotByFunction(rows, atMs) {
41
+ const acc = /* @__PURE__ */ new Map();
42
+ for (const row of rows) {
43
+ const { key, kind } = bucketFor(row);
44
+ const cur = acc.get(key) ?? {
45
+ kind,
46
+ main: 0,
47
+ gc: 0,
48
+ lifetime: 0,
49
+ memory: 0,
50
+ count: 0,
51
+ splitKnown: true
52
+ };
53
+ const known = row.cpuMainPercent !== null && row.cpuGcPercent !== null;
54
+ acc.set(key, {
55
+ kind: cur.kind,
56
+ main: cur.main + (row.cpuMainPercent ?? 0),
57
+ gc: cur.gc + (row.cpuGcPercent ?? 0),
58
+ lifetime: cur.lifetime + row.cpuPercent,
59
+ memory: cur.memory + row.memoryRssBytes,
60
+ count: cur.count + 1,
61
+ splitKnown: cur.splitKnown && known
62
+ });
63
+ }
64
+ return [...acc.entries()].map(([key, a]) => {
65
+ const main = a.splitKnown ? deci(a.main) : null;
66
+ const gc = a.splitKnown ? deci(a.gc) : null;
67
+ const lifetime = deci(a.lifetime);
68
+ return {
69
+ key,
70
+ kind: a.kind,
71
+ point: {
72
+ atMs,
73
+ samples: 1,
74
+ cpuMainPercent: main,
75
+ cpuMainPercentMin: main,
76
+ cpuGcPercent: gc,
77
+ cpuGcPercentMin: gc,
78
+ cpuLifetimePercent: lifetime,
79
+ cpuLifetimePercentMin: lifetime,
80
+ memoryRssBytes: a.memory,
81
+ memoryRssBytesMin: a.memory,
82
+ processCount: a.count,
83
+ processCountMin: a.count
84
+ }
85
+ };
86
+ });
87
+ }
88
+ /** The narrower of two bounds, treating `null` (UNKNOWN) as absorbing. */
89
+ function minNullable(a, b) {
90
+ if (a === null || b === null) return null;
91
+ return a < b ? a : b;
92
+ }
93
+ function maxNullable(a, b) {
94
+ if (a === null || b === null) return null;
95
+ return a > b ? a : b;
96
+ }
97
+ /** Merge `next` into `held`, keeping the widest [min, max] of each field. */
98
+ function mergePoints(held, next, atMs) {
99
+ return {
100
+ atMs,
101
+ samples: held.samples + next.samples,
102
+ cpuMainPercent: maxNullable(held.cpuMainPercent, next.cpuMainPercent),
103
+ cpuMainPercentMin: minNullable(held.cpuMainPercentMin, next.cpuMainPercentMin),
104
+ cpuGcPercent: maxNullable(held.cpuGcPercent, next.cpuGcPercent),
105
+ cpuGcPercentMin: minNullable(held.cpuGcPercentMin, next.cpuGcPercentMin),
106
+ cpuLifetimePercent: Math.max(held.cpuLifetimePercent, next.cpuLifetimePercent),
107
+ cpuLifetimePercentMin: Math.min(held.cpuLifetimePercentMin, next.cpuLifetimePercentMin),
108
+ memoryRssBytes: Math.max(held.memoryRssBytes, next.memoryRssBytes),
109
+ memoryRssBytesMin: Math.min(held.memoryRssBytesMin, next.memoryRssBytesMin),
110
+ processCount: Math.max(held.processCount, next.processCount),
111
+ processCountMin: Math.min(held.processCountMin, next.processCountMin)
112
+ };
113
+ }
114
+ /**
115
+ * The bucket width that brings `spanMs` down to at most `maxPoints` points,
116
+ * snapped up to a whole multiple of the sampling cadence.
117
+ *
118
+ * Returns `cadenceMs` (no reduction) when the span already fits. A caller that
119
+ * asks for a `maxPoints` of 0 or less gets no reduction rather than an
120
+ * infinite bucket — a nonsensical request must not produce a plausible chart.
121
+ */
122
+ function resolveBucketMs(spanMs, cadenceMs, maxPoints) {
123
+ if (maxPoints <= 0 || cadenceMs <= 0 || spanMs <= 0) return Math.max(cadenceMs, 1);
124
+ const wanted = spanMs / maxPoints;
125
+ if (wanted <= cadenceMs) return cadenceMs;
126
+ return Math.ceil(wanted / cadenceMs) * cadenceMs;
127
+ }
128
+ /**
129
+ * Reduce one function's points into buckets of `bucketMs`, preserving the
130
+ * extremes.
131
+ *
132
+ * Points are expected oldest-first and are returned oldest-first. A bucket
133
+ * with no samples is ABSENT — not zero, not interpolated, not the previous
134
+ * value held over.
135
+ */
136
+ function reducePoints(points, bucketMs, origin) {
137
+ if (bucketMs <= 0 || points.length === 0) return points;
138
+ const buckets = /* @__PURE__ */ new Map();
139
+ for (const point of points) {
140
+ const start = origin + Math.floor((point.atMs - origin) / bucketMs) * bucketMs;
141
+ const held = buckets.get(start);
142
+ buckets.set(start, held === void 0 ? {
143
+ ...point,
144
+ atMs: start
145
+ } : mergePoints(held, point, start));
146
+ }
147
+ return [...buckets.values()].toSorted((a, b) => a.atMs - b.atMs);
148
+ }
149
+ //#endregion
9
150
  //#region src/builtins/native-metrics/cgroup-memory.ts
10
151
  /** `readFileSync`, with every failure flattened to `null`. */
11
152
  var nodeCgroupFileReader = { read(path) {
@@ -3,8 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BZfvhfS1.js");
7
- const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
6
+ const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
7
+ const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
8
+ const require_platform_probe_cap = require("../../platform-probe.cap-1WrMhWHx.js");
9
+ const require_coral_accelerators = require("../../coral-accelerators-7o8hqvcN.js");
8
10
  let node_fs = require("node:fs");
9
11
  node_fs = require_chunk.__toESM(node_fs);
10
12
  let node_path = require("node:path");
@@ -47,13 +49,13 @@ function withCoral(caps, coral) {
47
49
  ...caps.hardware,
48
50
  coral
49
51
  };
50
- const { scores, best } = require_dist.scoreRuntimes(hardware);
52
+ const { scores, best } = require_coral_accelerators.scoreRuntimes(hardware);
51
53
  return {
52
54
  ...caps,
53
55
  hardware,
54
56
  scores: [...scores],
55
57
  bestScore: best,
56
- devices: require_dist.enumerateInferenceDevices(hardware)
58
+ devices: require_coral_accelerators.enumerateInferenceDevices(hardware)
57
59
  };
58
60
  }
59
61
  //#endregion
@@ -347,7 +349,7 @@ async function getAvailableRAM_MB() {
347
349
  const mem = await (await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("../../lib-CZ3g2WTS.js").default))).mem();
348
350
  return Math.round(mem.available / 1024 / 1024);
349
351
  } catch (err) {
350
- console.debug(`systeminformation not available, using platform-specific RAM probe: ${require_dist.errMsg(err)}`);
352
+ console.debug(`systeminformation not available, using platform-specific RAM probe: ${require_scoped_settings.errMsg(err)}`);
351
353
  const platform = node_os.platform();
352
354
  try {
353
355
  if (platform === "darwin") {
@@ -366,7 +368,7 @@ async function getAvailableRAM_MB() {
366
368
  if (match) return Math.round(parseInt(match[1]) / 1024);
367
369
  }
368
370
  } catch (probeErr) {
369
- console.debug(`RAM probe failed, using total RAM fallback: ${require_dist.errMsg(probeErr)}`);
371
+ console.debug(`RAM probe failed, using total RAM fallback: ${require_scoped_settings.errMsg(probeErr)}`);
370
372
  }
371
373
  return Math.round(node_os.totalmem() / 1024 / 1024);
372
374
  }
@@ -425,7 +427,7 @@ var PlatformScorer = class {
425
427
  if (hardware.gpu) this.logger.info("GPU detected", { meta: { name: hardware.gpu.name } });
426
428
  if (hardware.npu) this.logger.info("NPU detected", { meta: { type: hardware.npu.type } });
427
429
  onPhase?.("hardware", { hardware });
428
- const { scores, best: bestScore } = require_dist.scoreRuntimes(hardware);
430
+ const { scores, best: bestScore } = require_coral_accelerators.scoreRuntimes(hardware);
429
431
  const pythonPath = await this.resolvePythonPath();
430
432
  if (pythonPath) this.logger.info("Python interpreter located", { meta: { pythonPath } });
431
433
  else this.logger.info("Python: not found");
@@ -454,7 +456,7 @@ var PlatformScorer = class {
454
456
  scores: [...scores],
455
457
  bestScore,
456
458
  pythonPath,
457
- devices: require_dist.enumerateInferenceDevices(hardware)
459
+ devices: require_coral_accelerators.enumerateInferenceDevices(hardware)
458
460
  };
459
461
  onPhase?.("scored", {
460
462
  scores,
@@ -616,7 +618,7 @@ var PlatformScorer = class {
616
618
  this.logger.info("accelerator compute probed", { meta: { devices: facts.map((row) => row.deviceKey) } });
617
619
  return facts;
618
620
  } catch (err) {
619
- this.logger.warn("accelerator compute probe failed", { meta: { error: require_dist.errMsg(err) } });
621
+ this.logger.warn("accelerator compute probe failed", { meta: { error: require_scoped_settings.errMsg(err) } });
620
622
  return null;
621
623
  }
622
624
  }
@@ -688,7 +690,7 @@ var PlatformScorer = class {
688
690
  * way an unusable Coral is: silence would read as "no NVIDIA".
689
691
  */
690
692
  describeNvidiaSlot(probe) {
691
- const nvidia = require_dist.describeNvidia(probe, null);
693
+ const nvidia = require_coral_accelerators.describeNvidia(probe, null);
692
694
  if (nvidia.usable) this.logger.info("NVIDIA GPU detected", { meta: { name: nvidia.name } });
693
695
  else this.logger.warn("NVIDIA GPU present but not usable", { meta: {
694
696
  name: nvidia.name,
@@ -713,7 +715,7 @@ var PlatformScorer = class {
713
715
  memoryMB: parseInt(mem ?? "0")
714
716
  };
715
717
  } catch (err) {
716
- this.logger.debug("NVIDIA GPU detection failed", { meta: { error: require_dist.errMsg(err) } });
718
+ this.logger.debug("NVIDIA GPU detection failed", { meta: { error: require_scoped_settings.errMsg(err) } });
717
719
  return null;
718
720
  }
719
721
  }
@@ -735,7 +737,7 @@ var PlatformScorer = class {
735
737
  onFallback: (reason) => this.logger.warn("Windows hardware probe degraded", { meta: { reason } })
736
738
  });
737
739
  } catch (err) {
738
- this.logger.warn("Windows hardware probe failed — scoring as a CPU node", { meta: { error: require_dist.errMsg(err) } });
740
+ this.logger.warn("Windows hardware probe failed — scoring as a CPU node", { meta: { error: require_scoped_settings.errMsg(err) } });
739
741
  return {
740
742
  gpu: null,
741
743
  nvidia: null,
@@ -761,7 +763,7 @@ var PlatformScorer = class {
761
763
  await execFileAsync$1(cmd, ["--version"], { timeout: 5e3 });
762
764
  return cmd;
763
765
  } catch (err) {
764
- this.logger.debug(`Python command "${cmd}" not found`, { meta: { error: require_dist.errMsg(err) } });
766
+ this.logger.debug(`Python command "${cmd}" not found`, { meta: { error: require_scoped_settings.errMsg(err) } });
765
767
  }
766
768
  return null;
767
769
  }
@@ -883,7 +885,7 @@ function readPublishedAcceleratorFacts(filePath) {
883
885
  return null;
884
886
  }
885
887
  try {
886
- return require_dist.parseAcceleratorFactsJson(jsonValue(text));
888
+ return require_platform_probe_cap.parseAcceleratorFactsJson(jsonValue(text));
887
889
  } catch {
888
890
  return null;
889
891
  }
@@ -912,7 +914,7 @@ async function runAcceleratorFactsProbe(input) {
912
914
  if (input.pythonPath === null || input.scriptPath === null) return null;
913
915
  const exec = input.exec ?? defaultExec;
914
916
  try {
915
- return require_dist.parseAcceleratorFactsJson(jsonValue(await exec(input.pythonPath, [input.scriptPath], input.timeoutMs ?? 8e3)));
917
+ return require_platform_probe_cap.parseAcceleratorFactsJson(jsonValue(await exec(input.pythonPath, [input.scriptPath], input.timeoutMs ?? 8e3)));
916
918
  } catch {
917
919
  return null;
918
920
  }
@@ -949,7 +951,7 @@ function narrowHwAccelPrefer(value) {
949
951
  }
950
952
  /** How often the accelerator part of the probe is re-run (D919). Cheap: `/sys` + `/dev` reads. */
951
953
  var ACCELERATOR_REPROBE_INTERVAL_MS = 6e4;
952
- var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
954
+ var PlatformProbeNativeAddon = class extends require_base_addon.BaseAddon {
953
955
  scorer = null;
954
956
  cachedCaps = null;
955
957
  /** The periodic accelerator re-probe; started once the full probe completed. */
@@ -988,8 +990,8 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
988
990
  if (!ctx) return;
989
991
  const nodeId = this.bareLocalNodeId();
990
992
  try {
991
- require_dist.emitReadiness(ctx.eventBus, {
992
- capName: require_dist.platformProbeCapability.name,
993
+ require_base_addon.emitReadiness(ctx.eventBus, {
994
+ capName: require_platform_probe_cap.platformProbeCapability.name,
993
995
  scope: {
994
996
  type: "node",
995
997
  nodeId
@@ -1003,7 +1005,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
1003
1005
  async onInitialize() {
1004
1006
  this.emitProbeReadiness("starting");
1005
1007
  const embeddedPython = await this.ctx.deps.ensurePython().catch((err) => {
1006
- this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error: require_dist.errMsg(err) } });
1008
+ this.ctx.logger.debug("ensurePython unavailable for platform probe", { meta: { error: require_scoped_settings.errMsg(err) } });
1007
1009
  return null;
1008
1010
  });
1009
1011
  const factsScript = findAcceleratorFactsScript(this.ctx.dataDir);
@@ -1019,7 +1021,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
1019
1021
  type: "core",
1020
1022
  id: "platform-probe-native"
1021
1023
  },
1022
- category: require_dist.EventCategory.PlatformProbePhase,
1024
+ category: require_base_addon.EventCategory.PlatformProbePhase,
1023
1025
  data: {
1024
1026
  type: "platform-probe.phase",
1025
1027
  phase,
@@ -1041,7 +1043,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
1041
1043
  this.startAcceleratorReprobe();
1042
1044
  return caps;
1043
1045
  }).catch((err) => {
1044
- const msg = require_dist.errMsg(err);
1046
+ const msg = require_scoped_settings.errMsg(err);
1045
1047
  this.ctx.logger.error("Platform probe failed", { meta: { error: msg } });
1046
1048
  emitPhase("error", { message: msg });
1047
1049
  throw err;
@@ -1050,7 +1052,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
1050
1052
  return this.cachedCaps ?? probePromise;
1051
1053
  };
1052
1054
  return [{
1053
- capability: require_dist.platformProbeCapability,
1055
+ capability: require_platform_probe_cap.platformProbeCapability,
1054
1056
  provider: {
1055
1057
  getCapabilities: async () => {
1056
1058
  return getCaps();
@@ -1116,7 +1118,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
1116
1118
  meta: {
1117
1119
  nodeId: this.bareLocalNodeId(),
1118
1120
  trigger,
1119
- error: require_dist.errMsg(err)
1121
+ error: require_scoped_settings.errMsg(err)
1120
1122
  }
1121
1123
  });
1122
1124
  return null;
@@ -1,6 +1,8 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $a as parseAcceleratorFactsJson, Bl as describeNvidia, Hl as emitReadiness, Hu as errMsg, Lc as BaseAddon, Tu as scoreRuntimes, Wl as enumerateInferenceDevices, Wu as EventCategory, oo as platformProbeCapability } from "../../dist-BCHMSqzc.mjs";
3
- import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
2
+ import { b as EventCategory, m as emitReadiness, t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
3
+ import { Z as errMsg } from "../../scoped-settings-DVWUIP7Z.mjs";
4
+ import { n as parseAcceleratorFactsJson, t as platformProbeCapability } from "../../platform-probe.cap-BFeqFLtQ.mjs";
5
+ import { a as enumerateInferenceDevices, i as describeNvidia, n as detectCoralAccelerator, o as scoreRuntimes, r as nodeCoralFs } from "../../coral-accelerators-BKcXP59c.mjs";
4
6
  import * as fs$1 from "node:fs";
5
7
  import * as path$1 from "node:path";
6
8
  import { promisify } from "node:util";
@@ -3,7 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BZfvhfS1.js");
6
+ const require_base_addon = require("../../base-addon-DD5dIfcZ.js");
7
+ const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
8
+ const require_record_entries_cap = require("../../record-entries.cap-ti1C046R.js");
7
9
  let zod = require("zod");
8
10
  let node_crypto = require("node:crypto");
9
11
  //#region src/builtins/record-entries/entries-service.ts
@@ -30,12 +32,12 @@ var EntriesService = class {
30
32
  }
31
33
  async entryKind(owner, kind) {
32
34
  const found = (await this.deps.listKinds(false)).find((k) => k.owner === owner && k.kind === kind && k.declaration.entry !== void 0);
33
- if (found === void 0) throw new require_dist.UnknownRecordKindError(`"${owner}" declared no entry kind "${kind}"`);
35
+ if (found === void 0) throw new require_scoped_settings.UnknownRecordKindError(`"${owner}" declared no entry kind "${kind}"`);
34
36
  return found;
35
37
  }
36
38
  definitionOf(info) {
37
39
  const entry = info.declaration.entry;
38
- if (entry === void 0) throw new require_dist.UnknownRecordKindError(`"${info.kind}" is not an entry kind`);
40
+ if (entry === void 0) throw new require_scoped_settings.UnknownRecordKindError(`"${info.kind}" is not an entry kind`);
39
41
  const body = zod.z.fromJSONSchema(entry.fields);
40
42
  const schema = zod.z.custom((value) => isRecord(value) && body.safeParse(value).success, { message: "the entry does not match the kind's schema" });
41
43
  return {
@@ -77,11 +79,11 @@ var EntriesService = class {
77
79
  name: typeof name === "string" ? name : row.id,
78
80
  rev: row.rev,
79
81
  updatedAt: row.updatedAt,
80
- data: require_dist.secretViewsOf(input.owner, input.kind, row.id, info.declaration, row.data)
82
+ data: require_base_addon.secretViewsOf(input.owner, input.kind, row.id, info.declaration, row.data)
81
83
  });
82
84
  }
83
85
  cursor = page.nextCursor ?? void 0;
84
- if (entries.length > 2e3) throw new require_dist.InvalidRecordError(`${input.kind}: more than ${ENTRIES_LIST_MAX} entries`);
86
+ if (entries.length > 2e3) throw new require_scoped_settings.InvalidRecordError(`${input.kind}: more than ${ENTRIES_LIST_MAX} entries`);
85
87
  } while (cursor !== void 0);
86
88
  return { entries };
87
89
  }
@@ -112,7 +114,7 @@ var EntriesService = class {
112
114
  * records door, which only a hub in-process system builtin may do
113
115
  * (`ctx.records.forOwner`, `ctx.secrets.forOwner`).
114
116
  */
115
- var RecordEntriesAddon = class extends require_dist.BaseAddon {
117
+ var RecordEntriesAddon = class extends require_base_addon.BaseAddon {
116
118
  id = "record-entries";
117
119
  constructor() {
118
120
  super({});
@@ -127,7 +129,7 @@ var RecordEntriesAddon = class extends require_dist.BaseAddon {
127
129
  recordsFor: (owner) => forOwner(owner)
128
130
  });
129
131
  return [{
130
- capability: require_dist.recordEntriesCapability,
132
+ capability: require_record_entries_cap.recordEntriesCapability,
131
133
  provider: {
132
134
  listEntryKinds: () => service.listEntryKinds(),
133
135
  listEntries: (input) => service.listEntries(input),