@camstack/system 1.2.458 → 1.2.460

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 (109) hide show
  1. package/dist/addon-runner.js +26 -11
  2. package/dist/addon-runner.mjs +26 -11
  3. package/dist/addon-utils.mjs +1 -1
  4. package/dist/{agent-https-DOELEug8.js → agent-https-Dnr_nIVx.js} +3 -723
  5. package/dist/{agent-https-CQA3W-3e.mjs → agent-https-Iw3RSQup.mjs} +4 -616
  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 +5 -7
  11. package/dist/builtins/alerts/alerts.addon.mjs +5 -7
  12. package/dist/builtins/alerts/record-kinds.d.ts +1 -1
  13. package/dist/builtins/autotrack/index.js +1 -1
  14. package/dist/builtins/autotrack/index.mjs +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +242 -4
  16. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +243 -5
  17. package/dist/builtins/calendars/calendars.addon.js +2 -10
  18. package/dist/builtins/calendars/calendars.addon.mjs +2 -3
  19. package/dist/builtins/calendars/record-kinds.d.ts +1 -1
  20. package/dist/builtins/camera-grid/index.js +1 -1
  21. package/dist/builtins/camera-grid/index.mjs +1 -1
  22. package/dist/builtins/composer/composer.addon.js +2 -2
  23. package/dist/builtins/composer/composer.addon.mjs +2 -2
  24. package/dist/builtins/console-logging/index.js +1 -1
  25. package/dist/builtins/console-logging/index.mjs +1 -1
  26. package/dist/builtins/core-blocks/core-blocks.addon.js +4 -6
  27. package/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -6
  28. package/dist/builtins/device-history/device-history.addon.js +1 -1
  29. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  30. package/dist/builtins/device-manager/device-manager.addon.js +2 -4
  31. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -4
  32. package/dist/builtins/hub-forwarder/index.js +1 -1
  33. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  34. package/dist/builtins/keychain/index.js +41 -43
  35. package/dist/builtins/keychain/index.mjs +41 -43
  36. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  37. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  38. package/dist/builtins/local-auth/local-auth.addon.js +24 -40
  39. package/dist/builtins/local-auth/local-auth.addon.mjs +27 -43
  40. package/dist/builtins/local-network/local-network.addon.js +2 -2
  41. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  42. package/dist/builtins/loki-logging/index.js +1 -1
  43. package/dist/builtins/loki-logging/index.mjs +1 -1
  44. package/dist/builtins/native-metrics/native-metrics.addon.js +39 -4
  45. package/dist/builtins/native-metrics/native-metrics.addon.mjs +48 -13
  46. package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +16 -2
  47. package/dist/builtins/platform-probe/coral-accelerators.d.ts +10 -1
  48. package/dist/builtins/platform-probe/index.js +7 -4
  49. package/dist/builtins/platform-probe/index.mjs +13 -10
  50. package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -1
  51. package/dist/builtins/record-entries/index.js +1 -1
  52. package/dist/builtins/record-entries/index.mjs +1 -1
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  54. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  55. package/dist/builtins/snapshot/index.js +1 -1
  56. package/dist/builtins/snapshot/index.mjs +1 -1
  57. package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +0 -15
  58. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  59. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  60. package/dist/builtins/sqlite-storage/index.js +1 -1
  61. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  62. package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +0 -44
  63. package/dist/builtins/sqlite-storage/records/records-catalog.d.ts +0 -2
  64. package/dist/builtins/sqlite-storage/records/records-engine-types.d.ts +0 -21
  65. package/dist/builtins/sqlite-storage/records/records-engine.d.ts +3 -20
  66. package/dist/builtins/sqlite-storage/records/records-plan.d.ts +9 -4
  67. package/dist/builtins/sqlite-storage/records/records-provider.d.ts +4 -18
  68. package/dist/builtins/sqlite-storage/records/records-sql.d.ts +1 -1
  69. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -17
  70. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +21 -196
  71. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +21 -196
  72. package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +6 -14
  73. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +2 -2
  74. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +7 -9
  75. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +7 -9
  76. package/dist/builtins/system-config/system-config.addon.js +667 -40
  77. package/dist/builtins/system-config/system-config.addon.mjs +737 -127
  78. package/dist/builtins/winston-logging/index.js +1 -1
  79. package/dist/builtins/winston-logging/index.mjs +1 -1
  80. package/dist/{composition-sources-BVguN7VV.mjs → composition-sources-DNRZWR1j.mjs} +1 -1
  81. package/dist/{composition-sources-DURQNDJ4.js → composition-sources-b0e_2I-D.js} +1 -1
  82. package/dist/{constants-Njka8Cv6.js → constants-6OeJiZgi.js} +1 -1
  83. package/dist/{constants-FGjnsE2x.mjs → constants-BnkOdj9Q.mjs} +1 -1
  84. package/dist/{coral-accelerators-DcnZvctM.mjs → coral-accelerators-Qhn5TOYZ.mjs} +18 -15
  85. package/dist/{coral-accelerators-Bi_c3Rft.js → coral-accelerators-oUXmmbc2.js} +13 -10
  86. package/dist/{custom-action-registry-stpC3Zy-.mjs → custom-action-registry-DStvrQKI.mjs} +37 -37
  87. package/dist/{device-ca-lEaAQ9Xi.mjs → device-ca-Bnkw8GyU.mjs} +1 -1
  88. package/dist/{device-ca-BrVK_5s3.js → device-ca-CPTDs--d.js} +1 -1
  89. package/dist/{dist-BZQjLPiz.js → dist-Bn-RNanh.js} +29 -130
  90. package/dist/{dist-B_GRPhnY.mjs → dist-Wy8cTxg6.mjs} +30 -113
  91. package/dist/file-host-worker.js +1 -1
  92. package/dist/file-host-worker.mjs +1 -1
  93. package/dist/{hub-mdns-ciao-Bg2HfTwP.mjs → hub-mdns-ciao-CJu0nhla.mjs} +2 -2
  94. package/dist/{hub-mdns-ciao-nce3TXs_.js → hub-mdns-ciao-CTBTlia4.js} +2 -2
  95. package/dist/index.d.ts +1 -0
  96. package/dist/index.js +56 -31
  97. package/dist/index.mjs +257 -233
  98. package/dist/kernel/deps/addon-deps-manager.d.ts +9 -0
  99. package/dist/{restore-archive-C7kLDI_0.mjs → restore-archive-CM23Pq9B.mjs} +177 -424
  100. package/dist/{restore-archive-FyfZ8YMC.js → restore-archive-DM1OBYq4.js} +89 -342
  101. package/dist/{wal-maintenance-Duejh7Lx.mjs → wal-maintenance-Bj_MmDkr.mjs} +0 -0
  102. package/dist/{wal-maintenance-DfSIOj24.js → wal-maintenance-CaJjuLHq.js} +0 -0
  103. package/package.json +1 -1
  104. package/dist/builtins/records/legacy-table-row-count.d.ts +0 -5
  105. package/dist/builtins/records/phase6-declare-gate.d.ts +0 -28
  106. package/dist/builtins/sqlite-storage/records/count-settings-array-legacy.d.ts +0 -5
  107. package/dist/builtins/sqlite-storage/records/count-settings-brokers-legacy.d.ts +0 -6
  108. package/dist/phase6-declare-gate-Dag1_WR2.js +0 -98
  109. package/dist/phase6-declare-gate-Lb-mrVvz.mjs +0 -93
@@ -39,9 +39,9 @@ let node_vm = require("node:vm");
39
39
  node_vm = __toESM(node_vm);
40
40
  let node_fs_promises = require("node:fs/promises");
41
41
  let _trpc_client = require("@trpc/client");
42
+ let _camstack_types_node = require("@camstack/types/node");
42
43
  let node_http = require("node:http");
43
44
  let node_events = require("node:events");
44
- let _camstack_types_node = require("@camstack/types/node");
45
45
  let node_module = require("node:module");
46
46
  let node_url = require("node:url");
47
47
  //#region src/kernel/addon-refused-error.ts
@@ -7885,13 +7885,13 @@ var CORAL_PCI_VENDOR = "0x1ac1";
7885
7885
  var CORAL_PCI_DEVICE = "0x089a";
7886
7886
  /** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
7887
7887
  var APEX_ENTRY = /^apex_(\d+)$/;
7888
- /**
7889
- * Default install path of the libedgetpu delegate on the hub, provisioned
7890
- * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
7891
- * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
7892
- * sync with the Python pool's own default in `inference_pool.py`.
7893
- */
7894
- var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
7888
+ function currentDelegateHost() {
7889
+ return {
7890
+ platform: process.platform,
7891
+ dataDir: (0, _camstack_types_node.nodeDataRootFromEnv)(process.env),
7892
+ override: process.env[_camstack_types_node.EDGETPU_LIB_ENV]
7893
+ };
7894
+ }
7895
7895
  function countUsbCorals(fsx) {
7896
7896
  let count = 0;
7897
7897
  for (const device of fsx.listUsbDevices()) {
@@ -7946,7 +7946,7 @@ function classifyPci(fsx) {
7946
7946
  * Returns `null` only when no Coral was found at all; a present-but-unusable
7947
7947
  * Coral is reported with its typed reason, never as absent (D393/D315).
7948
7948
  */
7949
- function classifyCoralAccelerator(fsx) {
7949
+ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
7950
7950
  const usb = countUsbCorals(fsx);
7951
7951
  const pci = classifyPci(fsx);
7952
7952
  const units = [];
@@ -7977,8 +7977,10 @@ function classifyCoralAccelerator(fsx) {
7977
7977
  type: "coral-edgetpu",
7978
7978
  units
7979
7979
  };
7980
- const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
7981
- if (fsx.exists(libPath)) return {
7980
+ if ((0, _camstack_types_node.chooseEdgetpuDelegate)({
7981
+ ...delegateHost,
7982
+ exists: (p) => fsx.exists(p)
7983
+ }) !== null) return {
7982
7984
  type: "coral-edgetpu",
7983
7985
  units: [{
7984
7986
  bus: "usb",
@@ -8987,6 +8989,19 @@ var AddonDepsManager = class {
8987
8989
  const pythonPath = await this.ensurePython();
8988
8990
  if (!pythonPath) throw new Error("Cannot install Python requirements: Python is not available");
8989
8991
  await singleFlight(this.depsDir, "python-pip", () => (0, _camstack_types_node.installPythonRequirements)(pythonPath, requirementsFile, this.logger));
8992
+ await this.stageNativeDepsDeclaredBy(requirementsFile);
8993
+ }
8994
+ /**
8995
+ * The native library a requirements file says its packages need
8996
+ * (`# camstack-native-dep: edgetpu-delegate`), staged under this node's
8997
+ * deps dir. Runs on every call — not only the first pip install — so a
8998
+ * node whose pip marker predates the line still gets the library. A
8999
+ * platform without a build answers `unavailable` (logged, not thrown); a
9000
+ * failed or tampered download throws, and provisioning reports it.
9001
+ */
9002
+ async stageNativeDepsDeclaredBy(requirementsFile) {
9003
+ if (!(0, _camstack_types_node.declaresEdgetpuDelegate)(node_fs.readFileSync(requirementsFile, "utf8"))) return;
9004
+ await singleFlight(this.depsDir, "edgetpu-delegate", () => (0, _camstack_types_node.ensureEdgetpuDelegate)(this.nodeRoot, this.logger));
8990
9005
  }
8991
9006
  getDepsDir() {
8992
9007
  return this.depsDir;
@@ -16,9 +16,9 @@ import { monitorEventLoopDelay } from "node:perf_hooks";
16
16
  import * as vm from "node:vm";
17
17
  import { mkdir, rm, stat, unlink } from "node:fs/promises";
18
18
  import { TRPCClientError, createTRPCClient } from "@trpc/client";
19
+ import { EDGETPU_LIB_ENV, chooseEdgetpuDelegate, declaresEdgetpuDelegate, ensureBinary, ensureEdgetpuDelegate, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements, nodeDataRootFromEnv } from "@camstack/types/node";
19
20
  import { createServer as createServer$1, request } from "node:http";
20
21
  import { once } from "node:events";
21
- import { ensureBinary, ensureFfmpeg, ensurePython, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
22
22
  import { pathToFileURL } from "node:url";
23
23
  //#region src/kernel/addon-refused-error.ts
24
24
  /**
@@ -7861,13 +7861,13 @@ var CORAL_PCI_VENDOR = "0x1ac1";
7861
7861
  var CORAL_PCI_DEVICE = "0x089a";
7862
7862
  /** A unit the apex driver bound: `/sys/class/apex/apex_<N>` ↔ `/dev/apex_<N>`. */
7863
7863
  var APEX_ENTRY = /^apex_(\d+)$/;
7864
- /**
7865
- * Default install path of the libedgetpu delegate on the hub, provisioned
7866
- * out-of-band by `/data/deps/edgetpu-install.sh` (it is a system shared
7867
- * library, not a pip package). Overridable via `CAMSTACK_EDGETPU_LIB` — kept in
7868
- * sync with the Python pool's own default in `inference_pool.py`.
7869
- */
7870
- var DEFAULT_EDGETPU_LIB = "/data/deps/edgetpu/lib/libedgetpu.so.1";
7864
+ function currentDelegateHost() {
7865
+ return {
7866
+ platform: process.platform,
7867
+ dataDir: nodeDataRootFromEnv(process.env),
7868
+ override: process.env[EDGETPU_LIB_ENV]
7869
+ };
7870
+ }
7871
7871
  function countUsbCorals(fsx) {
7872
7872
  let count = 0;
7873
7873
  for (const device of fsx.listUsbDevices()) {
@@ -7922,7 +7922,7 @@ function classifyPci(fsx) {
7922
7922
  * Returns `null` only when no Coral was found at all; a present-but-unusable
7923
7923
  * Coral is reported with its typed reason, never as absent (D393/D315).
7924
7924
  */
7925
- function classifyCoralAccelerator(fsx) {
7925
+ function classifyCoralAccelerator(fsx, delegateHost = currentDelegateHost()) {
7926
7926
  const usb = countUsbCorals(fsx);
7927
7927
  const pci = classifyPci(fsx);
7928
7928
  const units = [];
@@ -7953,8 +7953,10 @@ function classifyCoralAccelerator(fsx) {
7953
7953
  type: "coral-edgetpu",
7954
7954
  units
7955
7955
  };
7956
- const libPath = process.env["CAMSTACK_EDGETPU_LIB"] ?? DEFAULT_EDGETPU_LIB;
7957
- if (fsx.exists(libPath)) return {
7956
+ if (chooseEdgetpuDelegate({
7957
+ ...delegateHost,
7958
+ exists: (p) => fsx.exists(p)
7959
+ }) !== null) return {
7958
7960
  type: "coral-edgetpu",
7959
7961
  units: [{
7960
7962
  bus: "usb",
@@ -8963,6 +8965,19 @@ var AddonDepsManager = class {
8963
8965
  const pythonPath = await this.ensurePython();
8964
8966
  if (!pythonPath) throw new Error("Cannot install Python requirements: Python is not available");
8965
8967
  await singleFlight(this.depsDir, "python-pip", () => installPythonRequirements(pythonPath, requirementsFile, this.logger));
8968
+ await this.stageNativeDepsDeclaredBy(requirementsFile);
8969
+ }
8970
+ /**
8971
+ * The native library a requirements file says its packages need
8972
+ * (`# camstack-native-dep: edgetpu-delegate`), staged under this node's
8973
+ * deps dir. Runs on every call — not only the first pip install — so a
8974
+ * node whose pip marker predates the line still gets the library. A
8975
+ * platform without a build answers `unavailable` (logged, not thrown); a
8976
+ * failed or tampered download throws, and provisioning reports it.
8977
+ */
8978
+ async stageNativeDepsDeclaredBy(requirementsFile) {
8979
+ if (!declaresEdgetpuDelegate(fs$1.readFileSync(requirementsFile, "utf8"))) return;
8980
+ await singleFlight(this.depsDir, "edgetpu-delegate", () => ensureEdgetpuDelegate(this.nodeRoot, this.logger));
8966
8981
  }
8967
8982
  getDepsDir() {
8968
8983
  return this.depsDir;
@@ -1,3 +1,3 @@
1
- import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-stpC3Zy-.mjs";
1
+ import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-DStvrQKI.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
3
3
  export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };