@camstack/system 1.2.469 → 1.2.470

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 (89) hide show
  1. package/dist/addon-runner.js +56 -25
  2. package/dist/addon-runner.mjs +56 -25
  3. package/dist/addon-utils.mjs +1 -1
  4. package/dist/{agent-https-5OgOR-eF.js → agent-https-D_oo3PNv.js} +1 -1
  5. package/dist/{agent-https-b-zX78oB.mjs → agent-https-DmNQyAl7.mjs} +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  16. package/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/dist/builtins/camera-grid/index.js +1 -1
  19. package/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/dist/builtins/composer/composer.addon.js +2 -2
  21. package/dist/builtins/composer/composer.addon.mjs +2 -2
  22. package/dist/builtins/console-logging/index.js +1 -1
  23. package/dist/builtins/console-logging/index.mjs +1 -1
  24. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  25. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  26. package/dist/builtins/device-history/device-history.addon.js +1 -1
  27. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  28. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  29. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  30. package/dist/builtins/hub-forwarder/index.js +1 -1
  31. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  32. package/dist/builtins/keychain/index.js +3 -3
  33. package/dist/builtins/keychain/index.mjs +3 -3
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  36. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  37. package/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  38. package/dist/builtins/local-network/local-network.addon.js +2 -2
  39. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  40. package/dist/builtins/loki-logging/index.js +1 -1
  41. package/dist/builtins/loki-logging/index.mjs +1 -1
  42. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  44. package/dist/builtins/platform-probe/accelerator-reprobe.d.ts +23 -0
  45. package/dist/builtins/platform-probe/coral-accelerators.d.ts +37 -8
  46. package/dist/builtins/platform-probe/index.d.ts +17 -1
  47. package/dist/builtins/platform-probe/index.js +192 -11
  48. package/dist/builtins/platform-probe/index.mjs +198 -18
  49. package/dist/builtins/platform-probe/platform-scorer.d.ts +14 -0
  50. package/dist/builtins/record-entries/index.js +1 -1
  51. package/dist/builtins/record-entries/index.mjs +1 -1
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/dist/builtins/snapshot/index.js +1 -1
  55. package/dist/builtins/snapshot/index.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  57. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  58. package/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  62. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  63. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  64. package/dist/builtins/system-config/system-config.addon.js +3 -3
  65. package/dist/builtins/system-config/system-config.addon.mjs +115 -115
  66. package/dist/builtins/winston-logging/index.js +1 -1
  67. package/dist/builtins/winston-logging/index.mjs +1 -1
  68. package/dist/{composition-sources-DTdzzyf0.mjs → composition-sources-B0tqvf0t.mjs} +1 -1
  69. package/dist/{composition-sources-BGXTiUZm.js → composition-sources-CRJffEiB.js} +1 -1
  70. package/dist/{constants-md_POijo.mjs → constants--A505iuO.mjs} +1 -1
  71. package/dist/{constants-2mPqJjkR.js → constants-WF1AqoKF.js} +1 -1
  72. package/dist/{coral-accelerators-oUXmmbc2.js → coral-accelerators-Cri32b7q.js} +61 -24
  73. package/dist/{coral-accelerators-Qhn5TOYZ.mjs → coral-accelerators-Dl-GnMHn.mjs} +61 -30
  74. package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
  75. package/dist/{device-ca-CFdyrqeJ.mjs → device-ca-DYmToMp8.mjs} +1 -1
  76. package/dist/{device-ca-CC58lmNV.js → device-ca-R4MZZtc0.js} +1 -1
  77. package/dist/{dist-DuBtzSCh.js → dist-DRL3rEfN.js} +77 -2
  78. package/dist/{dist-CtVVtyTX.mjs → dist-X1r44BdF.mjs} +77 -2
  79. package/dist/file-host-worker.js +1 -1
  80. package/dist/file-host-worker.mjs +1 -1
  81. package/dist/{hub-mdns-ciao-CmuWLPci.mjs → hub-mdns-ciao-CZV5Hion.mjs} +2 -2
  82. package/dist/{hub-mdns-ciao-BLsX_2cL.js → hub-mdns-ciao-DUoTS6jN.js} +2 -2
  83. package/dist/index.js +8 -8
  84. package/dist/index.mjs +225 -225
  85. package/dist/{restore-archive-CxPAuaNs.js → restore-archive-Df6PsOHP.js} +1 -1
  86. package/dist/{restore-archive-D2w3z_ob.mjs → restore-archive-X0ciGMmO.mjs} +94 -94
  87. package/dist/{wal-maintenance-DeluFl_1.mjs → wal-maintenance-D6J_MmZ8.mjs} +0 -0
  88. package/dist/{wal-maintenance-EK28XXnc.js → wal-maintenance-DYvzJiuK.js} +0 -0
  89. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-DuBtzSCh.js");
3
+ const require_dist = require("../../dist-DRL3rEfN.js");
4
4
  //#region src/builtins/liveness-monitor/liveness-checks.ts
5
5
  var NO_DEVICES = "liveness:no-devices";
6
6
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -1,4 +1,4 @@
1
- import { $r as errMsg, Da as EventCategory, Ui as createEvent, ei as BaseAddon, it as RecordingStatusSchema, nt as RECORDING_SOURCE_CAMSTACK_ADDON } from "../../dist-CtVVtyTX.mjs";
1
+ import { $r as errMsg, Da as EventCategory, Ui as createEvent, ei as BaseAddon, it as RecordingStatusSchema, nt as RECORDING_SOURCE_CAMSTACK_ADDON } from "../../dist-X1r44BdF.mjs";
2
2
  //#region src/builtins/liveness-monitor/liveness-checks.ts
3
3
  var NO_DEVICES = "liveness:no-devices";
4
4
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -3,10 +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-DuBtzSCh.js");
6
+ const require_dist = require("../../dist-DRL3rEfN.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_ms$1 = require("../../ms-LB3giGoU.js");
9
- const require_device_ca = require("../../device-ca-CC58lmNV.js");
9
+ const require_device_ca = require("../../device-ca-R4MZZtc0.js");
10
10
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
11
11
  let zod = require("zod");
12
12
  let node_crypto = require("node:crypto");
@@ -1,15 +1,15 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $ as PreferenceDeviceIdSchema, At as buildDeviceSignatureMessage, E as DEVICE_ENROLLMENT_TTL_MS, Ki as defineRecordKinds, O as DEVICE_NONCE_TTL_MS, Q as PREFERENCES_MAX_VALUE_BYTES, Qt as deviceCredentialsCapability, Ta as userError, ei as BaseAddon, et as PreferenceNamespaceSchema, gt as UserRecordSchema, h as CREDENTIAL_TOKEN_AUDIENCE, hn as formatDeviceRevoker, jr as userManagementCapability, kt as buildDeviceEnrollmentLink, lt as SsoBridgeClaimsSchema, mt as TokenScopeSchema, oa as makeSecretMarker, ra as isSecretMarker, st as ScopedTokenSchema, tt as PreferenceValueSchema, wn as isCredentialTokenPayload, wt as authProviderCapability, y as CredentialTokenClaimsSchema } from "../../dist-CtVVtyTX.mjs";
2
+ import { $ as PreferenceDeviceIdSchema, At as buildDeviceSignatureMessage, E as DEVICE_ENROLLMENT_TTL_MS, Ki as defineRecordKinds, O as DEVICE_NONCE_TTL_MS, Q as PREFERENCES_MAX_VALUE_BYTES, Qt as deviceCredentialsCapability, Ta as userError, ei as BaseAddon, et as PreferenceNamespaceSchema, gt as UserRecordSchema, h as CREDENTIAL_TOKEN_AUDIENCE, hn as formatDeviceRevoker, jr as userManagementCapability, kt as buildDeviceEnrollmentLink, lt as SsoBridgeClaimsSchema, mt as TokenScopeSchema, oa as makeSecretMarker, ra as isSecretMarker, st as ScopedTokenSchema, tt as PreferenceValueSchema, wn as isCredentialTokenPayload, wt as authProviderCapability, y as CredentialTokenClaimsSchema } from "../../dist-X1r44BdF.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
5
- import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-CFdyrqeJ.mjs";
5
+ import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-DYmToMp8.mjs";
6
6
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
7
7
  import { z } from "zod";
8
8
  import * as crypto$1 from "node:crypto";
9
9
  import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
10
10
  import nodeCrypto from "crypto";
11
11
  import * as path$1 from "node:path";
12
- import * as fs$1 from "node:fs";
12
+ import * as fs from "node:fs";
13
13
  //#region ../../node_modules/bcryptjs/index.js
14
14
  /**
15
15
  * The random implementation to use as a fallback.
@@ -12064,8 +12064,8 @@ var LocalAuthAddon = class extends BaseAddon {
12064
12064
  users: this.userManager,
12065
12065
  dataDir: this.ctx.nodeDataDir,
12066
12066
  fs: {
12067
- exists: (filePath) => fs$1.existsSync(filePath),
12068
- remove: (filePath) => fs$1.rmSync(filePath, { force: true })
12067
+ exists: (filePath) => fs.existsSync(filePath),
12068
+ remove: (filePath) => fs.rmSync(filePath, { force: true })
12069
12069
  },
12070
12070
  logger: this.ctx.logger
12071
12071
  });
@@ -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-DuBtzSCh.js");
4
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-BLsX_2cL.js");
3
+ const require_dist = require("../../dist-DRL3rEfN.js");
4
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-DUoTS6jN.js");
5
5
  let zod = require("zod");
6
6
  let node_net = require("node:net");
7
7
  let node_os = require("node:os");
@@ -1,5 +1,5 @@
1
- import { $r as errMsg, Da as EventCategory, Fn as localNetworkCapability, Ft as checkRoleAddress, H as HUB_MDNS_TXT_KEYS, Nr as validateCustomAddress, Tn as isDefaultAppConnectionEndpoint, V as HUB_MDNS_SERVICE_TYPE, Z as NetworkTunnelStartedDataSchema, Zn as pickAppLinkHub, c as CAMSTACK_APP_LINK_ORIGIN, ei as BaseAddon, or as resolveAppConnections, pr as resolveNotificationTapAddress, ur as resolveHubAddressRoles, xn as isAppLinkBase, yr as shortHostname } from "../../dist-CtVVtyTX.mjs";
2
- import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CmuWLPci.mjs";
1
+ import { $r as errMsg, Da as EventCategory, Fn as localNetworkCapability, Ft as checkRoleAddress, H as HUB_MDNS_TXT_KEYS, Nr as validateCustomAddress, Tn as isDefaultAppConnectionEndpoint, V as HUB_MDNS_SERVICE_TYPE, Z as NetworkTunnelStartedDataSchema, Zn as pickAppLinkHub, c as CAMSTACK_APP_LINK_ORIGIN, ei as BaseAddon, or as resolveAppConnections, pr as resolveNotificationTapAddress, ur as resolveHubAddressRoles, xn as isAppLinkBase, yr as shortHostname } from "../../dist-X1r44BdF.mjs";
2
+ import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CZV5Hion.mjs";
3
3
  import { z } from "zod";
4
4
  import { isIP } from "node:net";
5
5
  import * as os$1 from "node:os";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DuBtzSCh.js");
6
+ const require_dist = require("../../dist-DRL3rEfN.js");
7
7
  const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -1,4 +1,4 @@
1
- import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-CtVVtyTX.mjs";
1
+ import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
2
2
  import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -3,7 +3,7 @@ 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-DuBtzSCh.js");
6
+ const require_dist = require("../../dist-DRL3rEfN.js");
7
7
  let node_fs_promises = require("node:fs/promises");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
@@ -1,9 +1,9 @@
1
- import { $r as errMsg, Da as EventCategory, Ui as createEvent, Un as metricsProviderCapability, ei as BaseAddon, ht as UNATTRIBUTED_BUCKET_KEY, ir as reducePoints, mn as foldSnapshotByFunction, rt as ROOT_BUCKET_KEY, sr as resolveBucketMs } from "../../dist-CtVVtyTX.mjs";
1
+ import { $r as errMsg, Da as EventCategory, Ui as createEvent, Un as metricsProviderCapability, ei as BaseAddon, ht as UNATTRIBUTED_BUCKET_KEY, ir as reducePoints, mn as foldSnapshotByFunction, rt as ROOT_BUCKET_KEY, sr as resolveBucketMs } from "../../dist-X1r44BdF.mjs";
2
2
  import { access, readFile, readdir } from "node:fs/promises";
3
3
  import { promisify } from "node:util";
4
4
  import * as os$1 from "node:os";
5
5
  import { platform } from "node:os";
6
- import * as fs$1 from "node:fs";
6
+ import * as fs from "node:fs";
7
7
  import { constants, readFileSync } from "node:fs";
8
8
  import { execFile, execFileSync } from "node:child_process";
9
9
  //#region src/builtins/native-metrics/cgroup-memory.ts
@@ -1642,7 +1642,7 @@ var NativeMetricsProvider = class {
1642
1642
  let swapUsedBytes = 0;
1643
1643
  let swapTotalBytes = 0;
1644
1644
  if (IS_LINUX) try {
1645
- const meminfo = fs$1.readFileSync("/proc/meminfo", "utf-8");
1645
+ const meminfo = fs.readFileSync("/proc/meminfo", "utf-8");
1646
1646
  const swapTotal = parseInt(meminfo.match(/SwapTotal:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
1647
1647
  const swapFree = parseInt(meminfo.match(/SwapFree:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
1648
1648
  swapTotalBytes = swapTotal;
@@ -1720,7 +1720,7 @@ function sampleMacMemory(provider) {
1720
1720
  }
1721
1721
  function getDiskSpaceInternal(dirPath) {
1722
1722
  return new Promise((resolve, reject) => {
1723
- fs$1.statfs(dirPath, (err, stats) => {
1723
+ fs.statfs(dirPath, (err, stats) => {
1724
1724
  if (err) return reject(err);
1725
1725
  const totalBytes = stats.blocks * stats.bsize;
1726
1726
  const availableBytes = stats.bavail * stats.bsize;
@@ -1738,7 +1738,7 @@ function getDiskSpaceInternal(dirPath) {
1738
1738
  async function takeDiskIoSnapshot() {
1739
1739
  const now = Date.now();
1740
1740
  if (IS_LINUX) try {
1741
- const data = fs$1.readFileSync("/proc/diskstats", "utf-8");
1741
+ const data = fs.readFileSync("/proc/diskstats", "utf-8");
1742
1742
  let readOps = 0, readBytes = 0, writeOps = 0, writeBytes = 0;
1743
1743
  for (const line of data.split("\n")) {
1744
1744
  const parts = line.trim().split(/\s+/);
@@ -1769,7 +1769,7 @@ async function takeDiskIoSnapshot() {
1769
1769
  async function takeNetworkIoSnapshot() {
1770
1770
  const now = Date.now();
1771
1771
  if (IS_LINUX) try {
1772
- const data = fs$1.readFileSync("/proc/net/dev", "utf-8");
1772
+ const data = fs.readFileSync("/proc/net/dev", "utf-8");
1773
1773
  let rxBytes = 0, txBytes = 0, rxPackets = 0, txPackets = 0, rxErrors = 0, txErrors = 0;
1774
1774
  for (const line of data.split("\n")) {
1775
1775
  const match = line.match(/^\s*(\w+):\s+(.+)$/);
@@ -1830,7 +1830,7 @@ async function takeNetworkIoSnapshot() {
1830
1830
  }
1831
1831
  async function getCpuTemperatureInternal() {
1832
1832
  if (IS_LINUX) for (const p of ["/sys/class/thermal/thermal_zone0/temp", "/sys/class/hwmon/hwmon0/temp1_input"]) try {
1833
- const raw = fs$1.readFileSync(p, "utf-8").trim();
1833
+ const raw = fs.readFileSync(p, "utf-8").trim();
1834
1834
  const millideg = parseInt(raw, 10);
1835
1835
  if (!isNaN(millideg)) return Math.round(millideg / 100) / 10;
1836
1836
  } catch {
@@ -1881,10 +1881,10 @@ function getProcessResources() {
1881
1881
  let threadCount = 0;
1882
1882
  if (IS_LINUX) {
1883
1883
  try {
1884
- openFds = fs$1.readdirSync(`/proc/${process.pid}/fd`).length;
1884
+ openFds = fs.readdirSync(`/proc/${process.pid}/fd`).length;
1885
1885
  } catch {}
1886
1886
  try {
1887
- const match = fs$1.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
1887
+ const match = fs.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
1888
1888
  if (match) threadCount = parseInt(match[1], 10);
1889
1889
  } catch {}
1890
1890
  }
@@ -1899,7 +1899,7 @@ function getProcessResources() {
1899
1899
  function getPressure(resource) {
1900
1900
  if (!IS_LINUX) return null;
1901
1901
  try {
1902
- const data = fs$1.readFileSync(`/proc/pressure/${resource}`, "utf-8");
1902
+ const data = fs.readFileSync(`/proc/pressure/${resource}`, "utf-8");
1903
1903
  const parseLine = (prefix) => {
1904
1904
  const match = data.match(new RegExp(`${prefix} avg10=(\\d+\\.\\d+) avg60=(\\d+\\.\\d+) avg300=(\\d+\\.\\d+)`));
1905
1905
  if (!match) return null;
@@ -0,0 +1,23 @@
1
+ import type { CoralInfo, InferenceDeviceDescriptor, PlatformCapabilities } from "@camstack/types";
2
+ import type { CoralDetection } from "./coral-accelerators.js";
3
+ /** Device keys that appeared and disappeared between two probes, sorted. */
4
+ export interface InferenceDeviceSetChange {
5
+ readonly appeared: readonly string[];
6
+ readonly disappeared: readonly string[];
7
+ }
8
+ /** The result of one accelerator re-probe. */
9
+ export interface AcceleratorReprobe {
10
+ readonly caps: PlatformCapabilities;
11
+ readonly change: InferenceDeviceSetChange;
12
+ readonly detection: CoralDetection;
13
+ }
14
+ /** A stable signature of a Coral answer — what decides "did it change". */
15
+ export declare function coralSignature(coral: CoralInfo | null | undefined): string;
16
+ /** Which device keys a new probe added and removed. */
17
+ export declare function diffInferenceDevices(previous: readonly InferenceDeviceDescriptor[], next: readonly InferenceDeviceDescriptor[]): InferenceDeviceSetChange;
18
+ /**
19
+ * The capabilities with a new Coral answer: hardware, scores and the device
20
+ * enumeration are all derived again from it, so the edgetpu runtime and its
21
+ * devices follow the hardware rather than the boot-time snapshot.
22
+ */
23
+ export declare function withCoral(caps: PlatformCapabilities, coral: CoralInfo | null): PlatformCapabilities;
@@ -6,8 +6,12 @@ import { type EdgetpuDelegateLookup } from "@camstack/types/node";
6
6
  * stays a pure, unit-testable function over injected reads.
7
7
  */
8
8
  export interface CoralFs {
9
- /** USB device directory names under `/sys/bus/usb/devices` (e.g. `2-4`). */
10
- listUsbDevices(): readonly string[];
9
+ /**
10
+ * USB device directory names under `/sys/bus/usb/devices` (e.g. `2-4`), or
11
+ * `null` when the bus cannot be read at all (no `/sys`, a restricted view).
12
+ * `null` and an empty listing both mean "the bus is not observable".
13
+ */
14
+ listUsbDevices(): readonly string[] | null;
11
15
  /** Read a `<sysfsNode>/<attr>` value (idVendor / idProduct), trimmed. */
12
16
  readUsbAttr(device: string, attr: string): string;
13
17
  /** PCI function names under `/sys/bus/pci/devices` (e.g. `0000:03:00.0`). */
@@ -29,20 +33,45 @@ export interface CoralFs {
29
33
  * `/data/deps/edgetpu/lib/libedgetpu.so.1`.
30
34
  */
31
35
  export type EdgetpuDelegateHost = Omit<EdgetpuDelegateLookup, "exists">;
36
+ /** Whether this process could see the USB bus at all. */
37
+ export type CoralUsbBusView = "observed" | "unobservable";
32
38
  /**
33
- * Detect Coral Edge TPUs on USB and PCIe/M.2.
39
+ * Which evidence decided the Coral answer — logged by the probe so a node
40
+ * that reports (or stops reporting) a Coral says WHY:
41
+ * - `usb-ids` — a Coral USB id is on the bus;
42
+ * - `pci` — a PCIe/M.2 Coral (usable or not) is on the PCI bus;
43
+ * - `delegate-fallback` — the USB bus is not observable and the libedgetpu
44
+ * delegate is installed, so one USB unit is ASSUMED;
45
+ * - `none` — no Coral.
46
+ */
47
+ export type CoralDecision = "usb-ids" | "pci" | "delegate-fallback" | "none";
48
+ export interface CoralDetection {
49
+ readonly info: CoralInfo | null;
50
+ readonly usbBus: CoralUsbBusView;
51
+ readonly decidedBy: CoralDecision;
52
+ }
53
+ /**
54
+ * Detect Coral Edge TPUs on USB and PCIe/M.2 — the answer only. See
55
+ * {@link detectCoralAccelerator} for the evidence that decided it.
56
+ */
57
+ export declare function classifyCoralAccelerator(fsx: CoralFs, delegateHost?: EdgetpuDelegateHost): CoralInfo | null;
58
+ /**
59
+ * Detect Coral Edge TPUs on USB and PCIe/M.2, with the evidence that decided.
34
60
  *
35
61
  * - USB: every matching USB device counts (multiple Corals run concurrently).
36
62
  * - PCIe: the apex driver's units, each usable only if its device node opens;
37
63
  * a Coral PCI function the driver did not bind is `driver-missing`.
38
- * - Fallback: when NO Coral signal of either bus is visible but the libedgetpu
39
- * delegate is installed (a container whose `/sys` USB view is limited), one
40
- * USB Coral is assumed — never when a PCI Coral was seen, since the delegate
41
- * then says nothing about USB.
64
+ * - Fallback: when the USB bus is NOT OBSERVABLE (`/sys/bus/usb/devices`
65
+ * missing, unreadable or empty — a macOS desktop, a restricted container)
66
+ * and no PCI Coral was seen, an installed libedgetpu delegate means one USB
67
+ * Coral is assumed. A bus that IS readable and lists no Coral id is the
68
+ * answer: no USB Coral. The delegate stays installed after a stick is
69
+ * unplugged or moved to another node, so it is evidence only where nothing
70
+ * better exists (D919).
42
71
  *
43
72
  * Returns `null` only when no Coral was found at all; a present-but-unusable
44
73
  * Coral is reported with its typed reason, never as absent (D393/D315).
45
74
  */
46
- export declare function classifyCoralAccelerator(fsx: CoralFs, delegateHost?: EdgetpuDelegateHost): CoralInfo | null;
75
+ export declare function detectCoralAccelerator(fsx: CoralFs, delegateHost?: EdgetpuDelegateHost): CoralDetection;
47
76
  /** The real filesystem view: `/sys` for enumeration, `/dev` for access. */
48
77
  export declare const nodeCoralFs: CoralFs;
@@ -5,13 +5,19 @@
5
5
  * exposes the result via the `platform-probe` capability (singleton per
6
6
  * node).
7
7
  */
8
- import type { ProviderRegistration } from "@camstack/types";
8
+ import type { ProviderRegistration, AcceleratorRescan } from "@camstack/types";
9
9
  import { BaseAddon } from "@camstack/types";
10
10
  export { PlatformScorer } from "./platform-scorer.js";
11
11
  export { InferenceConfigResolver } from "./inference-config-resolver.js";
12
+ /** How often the accelerator part of the probe is re-run (D919). Cheap: `/sys` + `/dev` reads. */
13
+ export declare const ACCELERATOR_REPROBE_INTERVAL_MS = 6e4;
14
+ /** What started an accelerator re-probe — logged with every change. */
15
+ export type AcceleratorReprobeTrigger = "periodic" | "operator";
12
16
  export declare class PlatformProbeNativeAddon extends BaseAddon {
13
17
  private scorer;
14
18
  private cachedCaps;
19
+ /** The periodic accelerator re-probe; started once the full probe completed. */
20
+ private reprobeTimer;
15
21
  /**
16
22
  * Per-boot generation stamp for the manual readiness emissions below.
17
23
  * Constant for the lifetime of this addon instance (== one process boot);
@@ -36,6 +42,16 @@ export declare class PlatformProbeNativeAddon extends BaseAddon {
36
42
  /** Emit a `system.ready-state` transition for the platform-probe cap. */
37
43
  private emitProbeReadiness;
38
44
  protected onInitialize(): Promise<ProviderRegistration[]>;
45
+ /** Start the periodic accelerator re-probe (idempotent). */
46
+ private startAcceleratorReprobe;
47
+ /**
48
+ * Re-run the accelerator part of the probe and serve its answer from now on.
49
+ * Every device that appeared or disappeared is logged, naming the node and
50
+ * what triggered the re-probe; the orchestrator sees the new list on its next
51
+ * `getCapabilities` read and re-elects through its device-set-change path.
52
+ * `null` when the scorer is gone or has not completed its first probe.
53
+ */
54
+ reprobeAccelerators(trigger: AcceleratorReprobeTrigger): AcceleratorRescan | null;
39
55
  protected onShutdown(): Promise<void>;
40
56
  }
41
57
  export default PlatformProbeNativeAddon;
@@ -3,14 +3,58 @@ 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-DuBtzSCh.js");
7
- const require_coral_accelerators = require("../../coral-accelerators-oUXmmbc2.js");
6
+ const require_dist = require("../../dist-DRL3rEfN.js");
7
+ const require_coral_accelerators = require("../../coral-accelerators-Cri32b7q.js");
8
8
  let node_util = require("node:util");
9
9
  let node_os = require("node:os");
10
10
  node_os = require_chunk.__toESM(node_os);
11
11
  let node_fs = require("node:fs");
12
12
  node_fs = require_chunk.__toESM(node_fs);
13
13
  let node_child_process = require("node:child_process");
14
+ //#region src/builtins/platform-probe/accelerator-reprobe.ts
15
+ /**
16
+ * The accelerator part of the platform probe, re-run on its own (D919).
17
+ *
18
+ * The full probe runs once per process. A Coral is the one accelerator that is
19
+ * plugged in, pulled out and moved between nodes while the process runs, so
20
+ * its part (USB ids, PCIe apex units — reads of `/sys` and `/dev`, no model
21
+ * load) is re-run periodically and on demand, and the node's inference device
22
+ * list is rebuilt from the new answer. Pure: the scorer owns the cache.
23
+ */
24
+ /** A stable signature of a Coral answer — what decides "did it change". */
25
+ function coralSignature(coral) {
26
+ if (coral == null) return "none";
27
+ return `units=${(coral.units ?? []).map((u) => `${u.bus}:${u.count}`).join(",")};unavailable=${(coral.unavailable ?? []).map((u) => `${u.bus}:${u.count}:${u.reason}`).join(",")}`;
28
+ }
29
+ /** Which device keys a new probe added and removed. */
30
+ function diffInferenceDevices(previous, next) {
31
+ const before = new Set(previous.map((d) => d.key));
32
+ const after = new Set(next.map((d) => d.key));
33
+ return {
34
+ appeared: [...after].filter((k) => !before.has(k)).toSorted(),
35
+ disappeared: [...before].filter((k) => !after.has(k)).toSorted()
36
+ };
37
+ }
38
+ /**
39
+ * The capabilities with a new Coral answer: hardware, scores and the device
40
+ * enumeration are all derived again from it, so the edgetpu runtime and its
41
+ * devices follow the hardware rather than the boot-time snapshot.
42
+ */
43
+ function withCoral(caps, coral) {
44
+ const hardware = {
45
+ ...caps.hardware,
46
+ coral
47
+ };
48
+ const { scores, best } = require_dist.scoreRuntimes(hardware);
49
+ return {
50
+ ...caps,
51
+ hardware,
52
+ scores: [...scores],
53
+ bestScore: best,
54
+ devices: require_dist.enumerateInferenceDevices(hardware)
55
+ };
56
+ }
57
+ //#endregion
14
58
  //#region src/builtins/platform-probe/amd-npu.ts
15
59
  var amd_npu_exports = /* @__PURE__ */ require_chunk.__exportAll({
16
60
  classifyAmdNpu: () => classifyAmdNpu,
@@ -417,15 +461,7 @@ var PlatformScorer = class {
417
461
  } });
418
462
  let gpu = null;
419
463
  let npu = null;
420
- const coral = require_coral_accelerators.classifyCoralAccelerator(this.coralFs);
421
- if (coral) {
422
- if ((coral.units ?? []).length > 0) this.logger.info("Coral Edge TPU detected", { meta: { units: coral.units } });
423
- for (const unavailable of coral.unavailable ?? []) this.logger.warn("Coral Edge TPU present but unusable", { meta: {
424
- bus: unavailable.bus,
425
- count: unavailable.count,
426
- reason: unavailable.reason
427
- } });
428
- }
464
+ const coral = this.probeCoral().info;
429
465
  if (platform === "darwin" && arch === "arm64") {
430
466
  gpu = {
431
467
  type: "apple",
@@ -545,6 +581,64 @@ var PlatformScorer = class {
545
581
  coral
546
582
  };
547
583
  }
584
+ /**
585
+ * The Coral part of the probe, with the evidence that decided it logged —
586
+ * a node that reports a Coral, or stops reporting one, says WHY (D919).
587
+ */
588
+ probeCoral() {
589
+ const detection = require_coral_accelerators.detectCoralAccelerator(this.coralFs);
590
+ const coral = detection.info;
591
+ this.logger.info("Coral Edge TPU probe", { meta: {
592
+ usbBus: detection.usbBus,
593
+ decidedBy: detection.decidedBy,
594
+ units: coral?.units ?? []
595
+ } });
596
+ if (coral) {
597
+ if ((coral.units ?? []).length > 0) this.logger.info("Coral Edge TPU detected", { meta: {
598
+ units: coral.units,
599
+ decidedBy: detection.decidedBy
600
+ } });
601
+ for (const unavailable of coral.unavailable ?? []) this.logger.warn("Coral Edge TPU present but unusable", { meta: {
602
+ bus: unavailable.bus,
603
+ count: unavailable.count,
604
+ reason: unavailable.reason
605
+ } });
606
+ }
607
+ return detection;
608
+ }
609
+ /**
610
+ * Re-run ONLY the accelerator part (Coral USB ids + PCIe apex units: `/sys`
611
+ * and `/dev` reads, no model load) against the cached probe, and rebuild the
612
+ * device list from it when it changed. `null` before the first full probe
613
+ * completed — there is nothing to compare against yet. Logs the evidence
614
+ * only when the answer changed, so a 60 s cadence stays quiet.
615
+ */
616
+ reprobeAccelerators() {
617
+ const cached = this.cached;
618
+ if (cached === null) return null;
619
+ const detection = require_coral_accelerators.detectCoralAccelerator(this.coralFs);
620
+ if (coralSignature(detection.info) === coralSignature(cached.hardware.coral)) return {
621
+ caps: cached,
622
+ change: {
623
+ appeared: [],
624
+ disappeared: []
625
+ },
626
+ detection
627
+ };
628
+ this.logger.info("Coral Edge TPU probe changed", { meta: {
629
+ usbBus: detection.usbBus,
630
+ decidedBy: detection.decidedBy,
631
+ before: coralSignature(cached.hardware.coral),
632
+ after: coralSignature(detection.info)
633
+ } });
634
+ const next = withCoral(cached, detection.info);
635
+ this.cached = next;
636
+ return {
637
+ caps: next,
638
+ change: diffInferenceDevices(cached.devices, next.devices),
639
+ detection
640
+ };
641
+ }
548
642
  /** NVIDIA's own tool: exact model and VRAM. Null when absent or failing. */
549
643
  async probeNvidiaSmi() {
550
644
  try {
@@ -733,9 +827,13 @@ function narrowHwAccelPrefer(value) {
733
827
  if (typeof value === "string" && isHwAccelBackend(value)) return value;
734
828
  return null;
735
829
  }
830
+ /** How often the accelerator part of the probe is re-run (D919). Cheap: `/sys` + `/dev` reads. */
831
+ var ACCELERATOR_REPROBE_INTERVAL_MS = 6e4;
736
832
  var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
737
833
  scorer = null;
738
834
  cachedCaps = null;
835
+ /** The periodic accelerator re-probe; started once the full probe completed. */
836
+ reprobeTimer = null;
739
837
  /**
740
838
  * Per-boot generation stamp for the manual readiness emissions below.
741
839
  * Constant for the lifetime of this addon instance (== one process boot);
@@ -816,6 +914,7 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
816
914
  bestScore: caps.bestScore.score
817
915
  } });
818
916
  this.emitProbeReadiness("ready");
917
+ this.startAcceleratorReprobe();
819
918
  return caps;
820
919
  }).catch((err) => {
821
920
  const msg = require_dist.errMsg(err);
@@ -850,17 +949,99 @@ var PlatformProbeNativeAddon = class extends require_dist.BaseAddon {
850
949
  preferred: res.preferred,
851
950
  rationale: res.rationale
852
951
  };
952
+ },
953
+ rescanAccelerators: async () => {
954
+ await getCaps();
955
+ const rescan = this.reprobeAccelerators("operator");
956
+ if (rescan === null) throw new Error("platform-probe: the probe is shutting down");
957
+ return rescan;
853
958
  }
854
959
  }
855
960
  }];
856
961
  }
962
+ /** Start the periodic accelerator re-probe (idempotent). */
963
+ startAcceleratorReprobe() {
964
+ if (this.reprobeTimer !== null) return;
965
+ this.reprobeTimer = setInterval(() => {
966
+ this.reprobeAccelerators("periodic");
967
+ }, ACCELERATOR_REPROBE_INTERVAL_MS);
968
+ this.reprobeTimer.unref?.();
969
+ }
970
+ /**
971
+ * Re-run the accelerator part of the probe and serve its answer from now on.
972
+ * Every device that appeared or disappeared is logged, naming the node and
973
+ * what triggered the re-probe; the orchestrator sees the new list on its next
974
+ * `getCapabilities` read and re-elects through its device-set-change path.
975
+ * `null` when the scorer is gone or has not completed its first probe.
976
+ */
977
+ reprobeAccelerators(trigger) {
978
+ const scorer = this.scorer;
979
+ if (scorer === null) return null;
980
+ let result;
981
+ try {
982
+ result = scorer.reprobeAccelerators();
983
+ } catch (err) {
984
+ this.ctx.logger.warn("accelerator re-probe failed — last device list kept", {
985
+ tags: { nodeId: this.bareLocalNodeId() },
986
+ meta: {
987
+ nodeId: this.bareLocalNodeId(),
988
+ trigger,
989
+ error: require_dist.errMsg(err)
990
+ }
991
+ });
992
+ return null;
993
+ }
994
+ if (result === null) return null;
995
+ this.cachedCaps = result.caps;
996
+ const nodeId = this.bareLocalNodeId();
997
+ for (const deviceKey of result.change.appeared) this.ctx.logger.info("inference device appeared", {
998
+ tags: { nodeId },
999
+ meta: {
1000
+ nodeId,
1001
+ deviceKey,
1002
+ trigger,
1003
+ decidedBy: result.detection.decidedBy
1004
+ }
1005
+ });
1006
+ for (const deviceKey of result.change.disappeared) this.ctx.logger.info("inference device disappeared", {
1007
+ tags: { nodeId },
1008
+ meta: {
1009
+ nodeId,
1010
+ deviceKey,
1011
+ trigger,
1012
+ decidedBy: result.detection.decidedBy
1013
+ }
1014
+ });
1015
+ if (trigger === "operator") this.ctx.logger.info("inference devices rescanned", {
1016
+ tags: { nodeId },
1017
+ meta: {
1018
+ nodeId,
1019
+ usbBus: result.detection.usbBus,
1020
+ decidedBy: result.detection.decidedBy,
1021
+ appeared: result.change.appeared,
1022
+ disappeared: result.change.disappeared
1023
+ }
1024
+ });
1025
+ return {
1026
+ devices: result.caps.devices,
1027
+ appeared: result.change.appeared,
1028
+ disappeared: result.change.disappeared,
1029
+ usbBus: result.detection.usbBus,
1030
+ decidedBy: result.detection.decidedBy
1031
+ };
1032
+ }
857
1033
  async onShutdown() {
1034
+ if (this.reprobeTimer !== null) {
1035
+ clearInterval(this.reprobeTimer);
1036
+ this.reprobeTimer = null;
1037
+ }
858
1038
  this.emitProbeReadiness("down");
859
1039
  this.scorer = null;
860
1040
  this.cachedCaps = null;
861
1041
  }
862
1042
  };
863
1043
  //#endregion
1044
+ exports.ACCELERATOR_REPROBE_INTERVAL_MS = ACCELERATOR_REPROBE_INTERVAL_MS;
864
1045
  exports.InferenceConfigResolver = InferenceConfigResolver;
865
1046
  exports.PlatformProbeNativeAddon = PlatformProbeNativeAddon;
866
1047
  exports.default = PlatformProbeNativeAddon;