@camstack/system 1.2.456 → 1.2.458

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 (123) hide show
  1. package/dist/addon-runner.js +259 -37
  2. package/dist/addon-runner.mjs +289 -67
  3. package/dist/{agent-https-fm4AR8XL.mjs → agent-https-CQA3W-3e.mjs} +2 -2
  4. package/dist/{agent-https-yjxdfJDA.js → agent-https-DOELEug8.js} +2 -2
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +2 -2
  10. package/dist/builtins/alerts/alerts.addon.mjs +2 -2
  11. package/dist/builtins/autotrack/index.js +1 -1
  12. package/dist/builtins/autotrack/index.mjs +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/dist/builtins/camera-grid/index.js +1 -1
  18. package/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/dist/builtins/composer/composer.addon.js +2 -2
  20. package/dist/builtins/composer/composer.addon.mjs +2 -2
  21. package/dist/builtins/console-logging/console-destination.d.ts +1 -2
  22. package/dist/builtins/console-logging/index.js +1 -4
  23. package/dist/builtins/console-logging/index.mjs +1 -4
  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/capture/capture-engine.d.ts +6 -0
  27. package/dist/builtins/device-history/device-history.addon.d.ts +13 -0
  28. package/dist/builtins/device-history/device-history.addon.js +736 -315
  29. package/dist/builtins/device-history/device-history.addon.mjs +736 -315
  30. package/dist/builtins/device-history/ingest/producer-ingest.d.ts +11 -1
  31. package/dist/builtins/device-history/query/history-query.d.ts +35 -9
  32. package/dist/builtins/device-history/query/point-shape.d.ts +33 -0
  33. package/dist/builtins/device-history/retention/retention.d.ts +1 -1
  34. package/dist/builtins/device-history/rollup/rollup-engine.d.ts +2 -0
  35. package/dist/builtins/device-history/rollup/rollup-math.d.ts +6 -0
  36. package/dist/builtins/device-history/store/history-store.d.ts +7 -0
  37. package/dist/builtins/device-history/store/series-registry.d.ts +26 -1
  38. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  39. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  40. package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +1 -2
  41. package/dist/builtins/hub-forwarder/index.js +1 -4
  42. package/dist/builtins/hub-forwarder/index.mjs +1 -4
  43. package/dist/builtins/keychain/index.js +4 -4
  44. package/dist/builtins/keychain/index.mjs +4 -4
  45. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  46. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  47. package/dist/builtins/local-auth/local-auth.addon.js +3 -3
  48. package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
  49. package/dist/builtins/local-network/local-network.addon.js +2 -2
  50. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  51. package/dist/builtins/loki-logging/index.js +323 -7
  52. package/dist/builtins/loki-logging/index.mjs +323 -7
  53. package/dist/builtins/loki-logging/loki-destination.d.ts +20 -3
  54. package/dist/builtins/loki-logging/loki-read.d.ts +51 -0
  55. package/dist/builtins/native-metrics/native-metrics.addon.js +290 -112
  56. package/dist/builtins/native-metrics/native-metrics.addon.mjs +290 -112
  57. package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +106 -35
  58. package/dist/builtins/platform-probe/coral-accelerators.d.ts +26 -9
  59. package/dist/builtins/platform-probe/index.js +11 -68
  60. package/dist/builtins/platform-probe/index.mjs +11 -68
  61. package/dist/builtins/record-entries/index.js +1 -1
  62. package/dist/builtins/record-entries/index.mjs +1 -1
  63. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  64. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  65. package/dist/builtins/snapshot/index.js +1 -1
  66. package/dist/builtins/snapshot/index.mjs +1 -1
  67. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  68. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  69. package/dist/builtins/sqlite-storage/index.js +1 -1
  70. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  71. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  72. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  73. package/dist/builtins/storage-orchestrator/location-history-recorder.d.ts +76 -0
  74. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +9 -0
  75. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +144 -1
  76. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +144 -1
  77. package/dist/builtins/system-config/system-config.addon.js +3 -3
  78. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  79. package/dist/builtins/winston-logging/index.js +165 -3
  80. package/dist/builtins/winston-logging/index.mjs +165 -3
  81. package/dist/builtins/winston-logging/log-file-cursor.d.ts +12 -0
  82. package/dist/builtins/winston-logging/log-file-index-store.d.ts +11 -0
  83. package/dist/builtins/winston-logging/log-file-index.d.ts +77 -0
  84. package/dist/builtins/winston-logging/log-file-read-client.d.ts +44 -0
  85. package/dist/builtins/winston-logging/log-file-read-protocol.d.ts +41 -0
  86. package/dist/builtins/winston-logging/log-file-read-worker.d.ts +1 -0
  87. package/dist/builtins/winston-logging/log-file-reader.d.ts +51 -0
  88. package/dist/builtins/winston-logging/winston-destination.d.ts +20 -2
  89. package/dist/{composition-sources-Ds0Vr6eD.mjs → composition-sources-BVguN7VV.mjs} +1 -1
  90. package/dist/{composition-sources-gB4coDJR.js → composition-sources-DURQNDJ4.js} +1 -1
  91. package/dist/{constants-i5oD_gLB.mjs → constants-FGjnsE2x.mjs} +1 -1
  92. package/dist/{constants-CavyKfHZ.js → constants-Njka8Cv6.js} +1 -1
  93. package/dist/coral-accelerators-Bi_c3Rft.js +175 -0
  94. package/dist/coral-accelerators-DcnZvctM.mjs +162 -0
  95. package/dist/{device-ca-bpoEr0zG.js → device-ca-BrVK_5s3.js} +1 -1
  96. package/dist/{device-ca-qz1Pmeu1.mjs → device-ca-lEaAQ9Xi.mjs} +1 -1
  97. package/dist/{dist-BpqA2CT0.js → dist-BZQjLPiz.js} +526 -57
  98. package/dist/{dist-BSF_C8W2.mjs → dist-B_GRPhnY.mjs} +509 -58
  99. package/dist/file-host-worker.js +1 -1
  100. package/dist/file-host-worker.mjs +1 -1
  101. package/dist/{hub-mdns-ciao-CHaGDzyz.mjs → hub-mdns-ciao-Bg2HfTwP.mjs} +2 -2
  102. package/dist/{hub-mdns-ciao-CZlZRxxA.js → hub-mdns-ciao-nce3TXs_.js} +2 -2
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +140 -48
  105. package/dist/index.mjs +134 -49
  106. package/dist/kernel/config-schema.d.ts +5 -0
  107. package/dist/kernel/hwaccel/hwaccel-resolver.d.ts +7 -3
  108. package/dist/kernel/moleculer/accessory-prune-gate.d.ts +55 -0
  109. package/dist/log-file-read-protocol-B7M3X3bT.mjs +785 -0
  110. package/dist/log-file-read-protocol-D0WcLbIV.js +817 -0
  111. package/dist/log-file-read-worker.js +64 -0
  112. package/dist/log-file-read-worker.mjs +64 -0
  113. package/dist/log-read-filter-Bi066jwU.js +134 -0
  114. package/dist/log-read-filter-D7Ev3zm-.mjs +93 -0
  115. package/dist/logging/log-manager.d.ts +10 -6
  116. package/dist/logging/log-read-filter.d.ts +43 -0
  117. package/dist/{phase6-declare-gate-n-IZRklX.js → phase6-declare-gate-Dag1_WR2.js} +1 -1
  118. package/dist/{phase6-declare-gate-B4yfsf2n.mjs → phase6-declare-gate-Lb-mrVvz.mjs} +1 -1
  119. package/dist/{restore-archive-BGUM4FKf.mjs → restore-archive-C7kLDI_0.mjs} +1 -1
  120. package/dist/{restore-archive-B4QG7XmX.js → restore-archive-FyfZ8YMC.js} +1 -1
  121. package/dist/{wal-maintenance-CNEs_I94.js → wal-maintenance-DfSIOj24.js} +0 -0
  122. package/dist/{wal-maintenance-AerF4XE6.mjs → wal-maintenance-Duejh7Lx.mjs} +0 -0
  123. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-CNEs_I94.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-DfSIOj24.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-AerF4XE6.mjs";
1
+ import { C as RecordsEngine, D as callVector, E as callRecords, O as controlTargetOf, T as callData, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, h as serializeError, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, w as callControl, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-Duejh7Lx.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Ca as userError } from "./dist-BSF_C8W2.mjs";
2
+ import { Ea as userError } from "./dist-B_GRPhnY.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-DK__ETIe.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-fm4AR8XL.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-CQA3W-3e.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-BpqA2CT0.js");
2
+ const require_dist = require("./dist-BZQjLPiz.js");
3
3
  const require_x509_es = require("./x509.es-C4cOo48M.js");
4
- const require_agent_https = require("./agent-https-yjxdfJDA.js");
4
+ const require_agent_https = require("./agent-https-DOELEug8.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");
package/dist/index.d.ts CHANGED
@@ -102,6 +102,7 @@ export { isCredentialKeyName, redactLogEntry, redactLogMeta, redactLogText } fro
102
102
  export { clearPlatformKeychainKey, getPlatformKeychainKey, type PlatformKeychainKey, setPlatformKeychainKey } from "./builtins/keychain/platform-key-source.js";
103
103
  export type { LogEntry, LogFilter, LogLevel } from "./logging/log-ring-buffer.js";
104
104
  export { LogRingBuffer } from "./logging/log-ring-buffer.js";
105
+ export { bareAddonOf, compileLogFilter, type CompiledLogFilter, filterIsEmpty, levelRank, lineContainsText, lineMatches, originNodeOf, type ReadableLine } from "./logging/log-read-filter.js";
105
106
  export type { LevelBearing } from "./logging/logging-gate.js";
106
107
  export { DEFAULT_LOG_LEVEL, LoggingGate } from "./logging/logging-gate.js";
107
108
  export { __resetLoggingGateForTests, getLoggingGate } from "./logging/logging-gate.singleton.js";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-BpqA2CT0.js");
3
+ const require_dist = require("./dist-BZQjLPiz.js");
4
4
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
5
- const require_device_ca = require("./device-ca-bpoEr0zG.js");
5
+ const require_device_ca = require("./device-ca-BrVK_5s3.js");
6
6
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
7
7
  require("./builtins/alerts/index.js");
8
8
  const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
@@ -23,25 +23,27 @@ const require_builtins_liveness_monitor_liveness_monitor_addon = require("./buil
23
23
  require("./builtins/liveness-monitor/index.js");
24
24
  const require_builtins_local_auth_local_auth_addon = require("./builtins/local-auth/local-auth.addon.js");
25
25
  require("./builtins/local-auth/index.js");
26
+ const require_log_read_filter = require("./log-read-filter-Bi066jwU.js");
26
27
  const require_builtins_loki_logging_index = require("./builtins/loki-logging/index.js");
27
28
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
28
29
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
29
30
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
30
- const require_wal_maintenance = require("./wal-maintenance-CNEs_I94.js");
31
+ const require_wal_maintenance = require("./wal-maintenance-DfSIOj24.js");
31
32
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
32
33
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
33
34
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
34
35
  require("./builtins/storage-orchestrator/index.js");
35
- const require_constants = require("./constants-CavyKfHZ.js");
36
- const require_agent_https = require("./agent-https-yjxdfJDA.js");
36
+ const require_constants = require("./constants-Njka8Cv6.js");
37
+ const require_agent_https = require("./agent-https-DOELEug8.js");
37
38
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
38
39
  require("./builtins/system-config/index.js");
39
40
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
40
41
  const require_custom_action_registry = require("./custom-action-registry-COyb49zm.js");
41
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-CZlZRxxA.js");
42
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-nce3TXs_.js");
42
43
  const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
43
44
  const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
44
- const require_restore_archive = require("./restore-archive-B4QG7XmX.js");
45
+ const require_restore_archive = require("./restore-archive-FyfZ8YMC.js");
46
+ const require_coral_accelerators = require("./coral-accelerators-Bi_c3Rft.js");
45
47
  let zod = require("zod");
46
48
  let node_crypto = require("node:crypto");
47
49
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -4439,6 +4441,16 @@ var ScopedLogger = class ScopedLogger {
4439
4441
  };
4440
4442
  }
4441
4443
  };
4444
+ //#endregion
4445
+ //#region src/logging/log-manager.ts
4446
+ /**
4447
+ * A short id for one process lifetime: the first half of every entry `id`.
4448
+ * Base-36 epoch ms plus a random suffix, so two boots of the same process in
4449
+ * the same millisecond still mint different ids.
4450
+ */
4451
+ function newBootId() {
4452
+ return `${Date.now().toString(36)}${Math.floor(Math.random() * 36 ** 4).toString(36).padStart(4, "0")}`;
4453
+ }
4442
4454
  var LogManager = class {
4443
4455
  ringBuffer;
4444
4456
  /**
@@ -4475,6 +4487,14 @@ var LogManager = class {
4475
4487
  */
4476
4488
  gate = getLoggingGate();
4477
4489
  /**
4490
+ * Entry identity (D898): `<bootId>.<seq>`, stamped once, here, on every line
4491
+ * this process accepts — so the in-memory tail, the live subscription and
4492
+ * the rotated file carry the SAME id and a page read from disk dedupes
4493
+ * exactly against the lines pushed live.
4494
+ */
4495
+ bootId = newBootId();
4496
+ seq = 0;
4497
+ /**
4478
4498
  * `perAddonCapacity` bounds EACH addon's bucket, not the total — a chatty addon
4479
4499
  * evicts only its own lines, so quiet addons keep their sparse history.
4480
4500
  *
@@ -4507,7 +4527,10 @@ var LogManager = class {
4507
4527
  }
4508
4528
  createLogger(scope) {
4509
4529
  return new ScopedLogger(scope, (entry) => {
4510
- const enriched = redactLogEntry(this.enrichDeviceName(entry));
4530
+ const enriched = {
4531
+ ...redactLogEntry(this.enrichDeviceName(entry)),
4532
+ id: `${this.bootId}.${String(++this.seq)}`
4533
+ };
4511
4534
  if (this.isDestinationEnabled?.("log-buffer") !== false) this.ringBuffer.push(enriched);
4512
4535
  if (this.gate.allowsDestination(enriched)) for (const entry of this.destinations) {
4513
4536
  if (entry.addonId !== void 0 && this.isDestinationEnabled?.(entry.addonId) === false) continue;
@@ -16049,6 +16072,67 @@ function createChildrenBatchLoader(opts) {
16049
16072
  } };
16050
16073
  }
16051
16074
  //#endregion
16075
+ //#region src/kernel/moleculer/accessory-prune-gate.ts
16076
+ function isSpecList(answer) {
16077
+ return Array.isArray(answer);
16078
+ }
16079
+ function classifyAccessoryRead(answer, ctx) {
16080
+ if (isSpecList(answer)) {
16081
+ if (!ctx.online) return {
16082
+ kind: "unknown",
16083
+ reason: "parent offline",
16084
+ children: answer
16085
+ };
16086
+ if (ctx.probedAt === 0) return {
16087
+ kind: "unknown",
16088
+ reason: "probe not yet completed",
16089
+ children: answer
16090
+ };
16091
+ return {
16092
+ kind: "successful",
16093
+ children: answer
16094
+ };
16095
+ }
16096
+ if (answer.kind === "unknown") return {
16097
+ kind: "unknown",
16098
+ reason: answer.reason,
16099
+ children: answer.known ?? []
16100
+ };
16101
+ return {
16102
+ kind: "successful",
16103
+ children: answer.children
16104
+ };
16105
+ }
16106
+ /** One per parent registration; in-memory on purpose (a restart starts over — the safe direction). */
16107
+ var AccessoryShrinkGate = class {
16108
+ /** childId → the probe (`lastProbedAt`) of the first successful read that lacked it. */
16109
+ #firstMissing = /* @__PURE__ */ new Map();
16110
+ /**
16111
+ * `missing` = the managed children a SUCCESSFUL read no longer lists. Never
16112
+ * call this for an unknown read.
16113
+ */
16114
+ decide(missing, probedAt) {
16115
+ const missingSet = new Set(missing);
16116
+ for (const id of [...this.#firstMissing.keys()]) if (!missingSet.has(id)) this.#firstMissing.delete(id);
16117
+ const prune = [];
16118
+ const deferred = [];
16119
+ for (const id of missing) {
16120
+ const first = this.#firstMissing.get(id);
16121
+ if (first !== void 0 && probedAt > first) {
16122
+ prune.push(id);
16123
+ this.#firstMissing.delete(id);
16124
+ continue;
16125
+ }
16126
+ if (first === void 0) this.#firstMissing.set(id, probedAt);
16127
+ deferred.push(id);
16128
+ }
16129
+ return {
16130
+ prune,
16131
+ deferred
16132
+ };
16133
+ }
16134
+ };
16135
+ //#endregion
16052
16136
  //#region src/kernel/moleculer/runtime-state-load.ts
16053
16137
  /** A device build refused because its runtime state could not be loaded. */
16054
16138
  var RuntimeStateLoadError = class extends Error {
@@ -16771,6 +16855,7 @@ function createBrokerDeviceManagerApi(opts) {
16771
16855
  throw err;
16772
16856
  }
16773
16857
  const lifecycleHost = device;
16858
+ const shrinkGate = new AccessoryShrinkGate();
16774
16859
  const runReconcile = async () => {
16775
16860
  try {
16776
16861
  await callDeviceManager(api, "registerDevice", {
@@ -16794,7 +16879,12 @@ function createBrokerDeviceManagerApi(opts) {
16794
16879
  });
16795
16880
  }
16796
16881
  if (typeof lifecycleHost.getAccessoryChildren !== "function") return;
16797
- const specs = lifecycleHost.getAccessoryChildren();
16882
+ const probedAt = device.runtimeState?.getCapState("feature-probe")?.lastProbedAt ?? 0;
16883
+ const read = classifyAccessoryRead(lifecycleHost.getAccessoryChildren(), {
16884
+ online: device.online,
16885
+ probedAt
16886
+ });
16887
+ const specs = read.children;
16798
16888
  const expected = new Set(specs.map((s) => `${device.stableId}-${s.stableIdSuffix}`));
16799
16889
  await runBounded(specs, ACCESSORY_SPAWN_CONCURRENCY, async (spec) => {
16800
16890
  try {
@@ -16812,24 +16902,42 @@ function createBrokerDeviceManagerApi(opts) {
16812
16902
  });
16813
16903
  }
16814
16904
  });
16815
- if ((device.runtimeState?.getCapState("feature-probe")?.lastProbedAt ?? 0) === 0 && specs.length === 0) {
16816
- opts.logger.debug("Accessory orphan reconciliation skipped — probe not yet completed", { tags: {
16817
- parentDeviceId: device.id,
16818
- parentStableId: device.stableId
16819
- } });
16905
+ if (read.kind === "unknown") {
16906
+ opts.logger.info("Accessory orphan reconciliation skipped — child list unknown", {
16907
+ tags: {
16908
+ deviceId: device.id,
16909
+ parentStableId: device.stableId
16910
+ },
16911
+ meta: {
16912
+ reason: read.reason,
16913
+ probedAt
16914
+ }
16915
+ });
16820
16916
  return;
16821
16917
  }
16822
16918
  try {
16823
- const currentChildren = await childrenLoader.load(device.id);
16824
- for (const child of currentChildren) {
16825
- if (child.linkDeviceId !== device.id) continue;
16826
- if (expected.has(child.stableId)) continue;
16919
+ const missing = (await childrenLoader.load(device.id)).filter((child) => child.linkDeviceId === device.id && !expected.has(child.stableId));
16920
+ const decision = shrinkGate.decide(missing.map((child) => child.id), probedAt);
16921
+ if (decision.deferred.length > 0) opts.logger.info("Accessory children missing from a complete read — kept until a later probe agrees", {
16922
+ tags: {
16923
+ deviceId: device.id,
16924
+ parentStableId: device.stableId
16925
+ },
16926
+ meta: {
16927
+ childDeviceIds: [...decision.deferred],
16928
+ probedAt
16929
+ }
16930
+ });
16931
+ const confirmed = new Set(decision.prune);
16932
+ for (const child of missing) {
16933
+ if (!confirmed.has(child.id)) continue;
16827
16934
  const live = registry.getById(child.id);
16828
16935
  try {
16829
16936
  if (live) await deviceApi.remove(child.id);
16830
16937
  else await callDeviceManager(api, "removeDevice", { deviceId: child.id });
16831
16938
  opts.logger.info("Removed orphan accessory child no longer in parent specs", {
16832
16939
  tags: {
16940
+ deviceId: child.id,
16833
16941
  parentDeviceId: device.id,
16834
16942
  parentStableId: device.stableId
16835
16943
  },
@@ -16842,6 +16950,7 @@ function createBrokerDeviceManagerApi(opts) {
16842
16950
  } catch (err) {
16843
16951
  opts.logger.warn("Failed to remove orphan accessory child", {
16844
16952
  tags: {
16953
+ deviceId: child.id,
16845
16954
  parentDeviceId: device.id,
16846
16955
  parentStableId: device.stableId,
16847
16956
  childDeviceId: child.id
@@ -21301,7 +21410,7 @@ var LEVEL_ORDER = {
21301
21410
  warn: 2,
21302
21411
  error: 3
21303
21412
  };
21304
- function levelRank(level) {
21413
+ function levelRank$1(level) {
21305
21414
  return LEVEL_ORDER[level] ?? 0;
21306
21415
  }
21307
21416
  function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, tags = {}) {
@@ -21313,7 +21422,7 @@ function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, ta
21313
21422
  ...tags
21314
21423
  };
21315
21424
  function log(level, message, extras) {
21316
- if (levelRank(level) < levelRank(levelState.current)) return;
21425
+ if (levelRank$1(level) < levelRank$1(levelState.current)) return;
21317
21426
  const mergedTags = extras?.tags ? {
21318
21427
  ...baseTags,
21319
21428
  ...extras.tags
@@ -22205,30 +22314,6 @@ function safeExistsSync(path) {
22205
22314
  return false;
22206
22315
  }
22207
22316
  }
22208
- /**
22209
- * Detect a Coral USB Edge TPU: a matching USB device (`1a6e:089a` pre-init or
22210
- * `18d1:9302` post-init) OR the installed libedgetpu delegate (the hub
22211
- * provisions it out-of-band; its presence is a reliable "Coral is wired"
22212
- * signal even where the container's `/sys` USB view is limited).
22213
- */
22214
- function detectCoralUsb() {
22215
- const CORAL_IDS = [{
22216
- vendor: "1a6e",
22217
- product: "089a"
22218
- }, {
22219
- vendor: "18d1",
22220
- product: "9302"
22221
- }];
22222
- try {
22223
- for (const device of node_fs.readdirSync("/sys/bus/usb/devices")) try {
22224
- const base = `/sys/bus/usb/devices/${device}`;
22225
- const vendor = node_fs.readFileSync(`${base}/idVendor`, "utf8").trim().toLowerCase();
22226
- const product = node_fs.readFileSync(`${base}/idProduct`, "utf8").trim().toLowerCase();
22227
- if (CORAL_IDS.some((id) => id.vendor === vendor && id.product === product)) return true;
22228
- } catch {}
22229
- } catch {}
22230
- return safeExistsSync(process.env["CAMSTACK_EDGETPU_LIB"] ?? "/data/deps/edgetpu/lib/libedgetpu.so.1");
22231
- }
22232
22317
  /** Probe Linux GPU vendors by parsing /proc/bus/pci/devices or /sys/class/drm. */
22233
22318
  function probeLinuxGpus() {
22234
22319
  const signals = {
@@ -22237,7 +22322,7 @@ function probeLinuxGpus() {
22237
22322
  hasIntelGpu: false,
22238
22323
  hasRenderNode: false,
22239
22324
  hasIntelNpu: safeExistsSync("/dev/accel/accel0"),
22240
- hasCoral: detectCoralUsb()
22325
+ coral: require_coral_accelerators.classifyCoralAccelerator(require_coral_accelerators.nodeCoralFs)
22241
22326
  };
22242
22327
  signals.hasRenderNode = safeExistsSync("/dev/dri/renderD128");
22243
22328
  if (safeExistsSync("/dev/nvidia0") || safeExistsSync("/proc/driver/nvidia/version")) signals.hasNvidiaGpu = true;
@@ -22271,7 +22356,7 @@ function probePlatform() {
22271
22356
  hasIntelGpu: false,
22272
22357
  hasRenderNode: false,
22273
22358
  hasIntelNpu: false,
22274
- hasCoral: safeExistsSync(process.env["CAMSTACK_EDGETPU_LIB"] ?? "/data/deps/edgetpu/lib/libedgetpu.so.1")
22359
+ coral: require_coral_accelerators.classifyCoralAccelerator(require_coral_accelerators.nodeCoralFs)
22275
22360
  };
22276
22361
  }
22277
22362
  function pickBackendsForPlatform(signals) {
@@ -22362,7 +22447,7 @@ function mapSignalsToInferenceHardware(signals) {
22362
22447
  return {
22363
22448
  gpu: signals.hasNvidiaGpu ? { type: "nvidia" } : signals.hasAmdGpu ? { type: "amd" } : signals.hasIntelGpu ? { type: "intel" } : signals.hasRenderNode ? { type: "intel" } : null,
22364
22449
  npu: signals.platform === "darwin" && signals.arch === "arm64" ? { type: "apple-ane" } : signals.hasIntelNpu ? { type: "intel-npu" } : null,
22365
- coral: signals.hasCoral ? { type: "coral-edgetpu" } : null
22450
+ coral: signals.coral
22366
22451
  };
22367
22452
  }
22368
22453
  /**
@@ -24709,7 +24794,7 @@ function localHardwareInfo() {
24709
24794
  name: gpuType
24710
24795
  } : null,
24711
24796
  npu: npuType !== null ? { type: npuType } : null,
24712
- coral: inference.coral != null ? { type: "coral-edgetpu" } : null
24797
+ coral: inference.coral ?? null
24713
24798
  };
24714
24799
  }
24715
24800
  /** Runtime ids offered on this host (`onnx`, `openvino`, `coreml`, `edgetpu`). */
@@ -27827,6 +27912,7 @@ exports.attachUserManagementInternal = require_builtins_local_auth_local_auth_ad
27827
27912
  exports.attributeStall = require_custom_action_registry.attributeStall;
27828
27913
  exports.backupOrchestratorRecordKinds = require_restore_archive.backupOrchestratorRecordKinds;
27829
27914
  exports.backupRecordStoresOf = require_restore_archive.backupRecordStoresOf;
27915
+ exports.bareAddonOf = require_log_read_filter.bareAddonOf;
27830
27916
  exports.bindPendingLanHttp = require_hub_mdns_ciao.bindPendingLanHttp;
27831
27917
  exports.bootstrapSchema = bootstrapSchema;
27832
27918
  exports.brokerCallForCap = brokerCallForCap;
@@ -27875,6 +27961,7 @@ exports.clusterNodeHistoryRecordKind = clusterNodeHistoryRecordKind;
27875
27961
  exports.collectAgentNames = require_agent_https.collectAgentNames;
27876
27962
  exports.collectCertIdentity = require_agent_https.collectCertIdentity;
27877
27963
  exports.collectModelFiles = require_custom_action_registry.collectModelFiles;
27964
+ exports.compileLogFilter = require_log_read_filter.compileLogFilter;
27878
27965
  exports.computePairingCommitment = require_builtins_system_config_system_config_addon.computePairingCommitment;
27879
27966
  exports.computePairingSas = require_builtins_system_config_system_config_addon.computePairingSas;
27880
27967
  exports.connectBrokerTransport = connectBrokerTransport;
@@ -27984,6 +28071,7 @@ exports.evaluateExistingCert = require_agent_https.evaluateExistingCert;
27984
28071
  exports.expandCapMethods = require_dist.expandCapMethods;
27985
28072
  exports.exportMeshPrivateKeyPem = require_agent_https.exportMeshPrivateKeyPem;
27986
28073
  exports.fetchJson = require_custom_action_registry.fetchJson;
28074
+ exports.filterIsEmpty = require_log_read_filter.filterIsEmpty;
27987
28075
  exports.findAddonRefusal = findAddonRefusal;
27988
28076
  Object.defineProperty(exports, "findInPath", {
27989
28077
  enumerable: true,
@@ -28094,6 +28182,9 @@ exports.issueMeshLeafForNode = require_agent_https.issueMeshLeafForNode;
28094
28182
  exports.issueMeshLeafFromCsr = require_agent_https.issueMeshLeafFromCsr;
28095
28183
  exports.keyFingerprintShort = require_builtins_system_config_system_config_addon.keyFingerprintShort;
28096
28184
  exports.leafFingerprintOf = require_hub_mdns_ciao.leafFingerprintOf;
28185
+ exports.levelRank = require_log_read_filter.levelRank;
28186
+ exports.lineContainsText = require_log_read_filter.lineContainsText;
28187
+ exports.lineMatches = require_log_read_filter.lineMatches;
28097
28188
  exports.loadAgentHttps = require_agent_https.loadAgentHttps;
28098
28189
  exports.loadDeviceCa = require_device_ca.loadDeviceCa;
28099
28190
  exports.loadMeshCa = require_agent_https.loadMeshCa;
@@ -28111,6 +28202,7 @@ exports.normalizeIp = require_builtins_system_config_system_config_addon.normali
28111
28202
  exports.onProcessNodeRegistered = require_builtins_system_config_system_config_addon.onProcessNodeRegistered;
28112
28203
  exports.onSessionsRevoked = require_builtins_local_auth_local_auth_addon.onSessionsRevoked;
28113
28204
  exports.openMeshTlsWhenRevocationsLoaded = require_builtins_system_config_system_config_addon.openMeshTlsWhenRevocationsLoaded;
28205
+ exports.originNodeOf = require_log_read_filter.originNodeOf;
28114
28206
  exports.overlayGetStatus = overlayGetStatus;
28115
28207
  exports.parseAgentDashboardOrigins = require_builtins_system_config_system_config_addon.parseAgentDashboardOrigins;
28116
28208
  exports.parseCapAction = parseCapAction;