@camstack/system 1.2.456 → 1.2.457
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.
- package/dist/addon-runner.js +96 -10
- package/dist/addon-runner.mjs +96 -10
- package/dist/{agent-https-fm4AR8XL.mjs → agent-https-CK9Z4sSR.mjs} +2 -2
- package/dist/{agent-https-yjxdfJDA.js → agent-https-CoyOZ3pC.js} +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +2 -2
- package/dist/builtins/alerts/alerts.addon.mjs +2 -2
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/console-destination.d.ts +1 -2
- package/dist/builtins/console-logging/index.js +1 -4
- package/dist/builtins/console-logging/index.mjs +1 -4
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/capture/capture-engine.d.ts +6 -0
- package/dist/builtins/device-history/device-history.addon.js +441 -83
- package/dist/builtins/device-history/device-history.addon.mjs +441 -83
- package/dist/builtins/device-history/query/history-query.d.ts +35 -9
- package/dist/builtins/device-history/query/point-shape.d.ts +33 -0
- package/dist/builtins/device-history/retention/retention.d.ts +1 -1
- package/dist/builtins/device-history/rollup/rollup-engine.d.ts +2 -0
- package/dist/builtins/device-history/rollup/rollup-math.d.ts +6 -0
- package/dist/builtins/device-history/store/history-store.d.ts +7 -0
- package/dist/builtins/device-history/store/series-registry.d.ts +26 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +1 -2
- package/dist/builtins/hub-forwarder/index.js +1 -4
- package/dist/builtins/hub-forwarder/index.mjs +1 -4
- package/dist/builtins/keychain/index.js +4 -4
- package/dist/builtins/keychain/index.mjs +4 -4
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +3 -3
- package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +323 -7
- package/dist/builtins/loki-logging/index.mjs +323 -7
- package/dist/builtins/loki-logging/loki-destination.d.ts +20 -3
- package/dist/builtins/loki-logging/loki-read.d.ts +51 -0
- package/dist/builtins/native-metrics/native-metrics.addon.js +290 -112
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +290 -112
- package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +106 -35
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/location-history-recorder.d.ts +76 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +9 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +144 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +144 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/dist/builtins/winston-logging/index.js +165 -3
- package/dist/builtins/winston-logging/index.mjs +165 -3
- package/dist/builtins/winston-logging/log-file-cursor.d.ts +12 -0
- package/dist/builtins/winston-logging/log-file-index-store.d.ts +11 -0
- package/dist/builtins/winston-logging/log-file-index.d.ts +77 -0
- package/dist/builtins/winston-logging/log-file-read-client.d.ts +44 -0
- package/dist/builtins/winston-logging/log-file-read-protocol.d.ts +41 -0
- package/dist/builtins/winston-logging/log-file-read-worker.d.ts +1 -0
- package/dist/builtins/winston-logging/log-file-reader.d.ts +51 -0
- package/dist/builtins/winston-logging/winston-destination.d.ts +20 -2
- package/dist/{composition-sources-Ds0Vr6eD.mjs → composition-sources-B_jeZDRJ.mjs} +1 -1
- package/dist/{composition-sources-gB4coDJR.js → composition-sources-qKyvMAvc.js} +1 -1
- package/dist/{constants-CavyKfHZ.js → constants-B_X9cWEK.js} +1 -1
- package/dist/{constants-i5oD_gLB.mjs → constants-cxKcZRMi.mjs} +1 -1
- package/dist/{device-ca-qz1Pmeu1.mjs → device-ca-BB6nHAL5.mjs} +1 -1
- package/dist/{device-ca-bpoEr0zG.js → device-ca-CVK3YcR_.js} +1 -1
- package/dist/{dist-BpqA2CT0.js → dist-C89nqNnn.js} +471 -47
- package/dist/{dist-BSF_C8W2.mjs → dist-Dhux90yB.mjs} +454 -48
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-CHaGDzyz.mjs → hub-mdns-ciao-B8olZqqd.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CZlZRxxA.js → hub-mdns-ciao-DB1Y9agt.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +135 -20
- package/dist/index.mjs +129 -21
- package/dist/kernel/config-schema.d.ts +5 -0
- package/dist/kernel/moleculer/accessory-prune-gate.d.ts +55 -0
- package/dist/log-file-read-protocol-B7M3X3bT.mjs +785 -0
- package/dist/log-file-read-protocol-D0WcLbIV.js +817 -0
- package/dist/log-file-read-worker.js +64 -0
- package/dist/log-file-read-worker.mjs +64 -0
- package/dist/log-read-filter-Bi066jwU.js +134 -0
- package/dist/log-read-filter-D7Ev3zm-.mjs +93 -0
- package/dist/logging/log-manager.d.ts +10 -6
- package/dist/logging/log-read-filter.d.ts +43 -0
- package/dist/{phase6-declare-gate-n-IZRklX.js → phase6-declare-gate-BO-_jLh_.js} +1 -1
- package/dist/{phase6-declare-gate-B4yfsf2n.mjs → phase6-declare-gate-x9ZCbQJP.mjs} +1 -1
- package/dist/{restore-archive-B4QG7XmX.js → restore-archive-4DOUR5Gu.js} +1 -1
- package/dist/{restore-archive-BGUM4FKf.mjs → restore-archive-DyOaPeAr.mjs} +1 -1
- package/dist/{wal-maintenance-AerF4XE6.mjs → wal-maintenance-BMiX6UIa.mjs} +0 -0
- package/dist/{wal-maintenance-CNEs_I94.js → wal-maintenance-DVN-DiVP.js} +0 -0
- package/package.json +1 -1
package/dist/file-host-worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
2
|
+
const require_wal_maintenance = require("./wal-maintenance-DVN-DiVP.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-
|
|
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-BMiX6UIa.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 {
|
|
2
|
+
import { Ea as userError } from "./dist-Dhux90yB.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-
|
|
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-CK9Z4sSR.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-
|
|
2
|
+
const require_dist = require("./dist-C89nqNnn.js");
|
|
3
3
|
const require_x509_es = require("./x509.es-C4cOo48M.js");
|
|
4
|
-
const require_agent_https = require("./agent-https-
|
|
4
|
+
const require_agent_https = require("./agent-https-CoyOZ3pC.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-
|
|
3
|
+
const require_dist = require("./dist-C89nqNnn.js");
|
|
4
4
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
5
|
-
const require_device_ca = require("./device-ca-
|
|
5
|
+
const require_device_ca = require("./device-ca-CVK3YcR_.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,26 @@ 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-
|
|
31
|
+
const require_wal_maintenance = require("./wal-maintenance-DVN-DiVP.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-
|
|
36
|
-
const require_agent_https = require("./agent-https-
|
|
36
|
+
const require_constants = require("./constants-B_X9cWEK.js");
|
|
37
|
+
const require_agent_https = require("./agent-https-CoyOZ3pC.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-
|
|
42
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-DB1Y9agt.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-
|
|
45
|
+
const require_restore_archive = require("./restore-archive-4DOUR5Gu.js");
|
|
45
46
|
let zod = require("zod");
|
|
46
47
|
let node_crypto = require("node:crypto");
|
|
47
48
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -4439,6 +4440,16 @@ var ScopedLogger = class ScopedLogger {
|
|
|
4439
4440
|
};
|
|
4440
4441
|
}
|
|
4441
4442
|
};
|
|
4443
|
+
//#endregion
|
|
4444
|
+
//#region src/logging/log-manager.ts
|
|
4445
|
+
/**
|
|
4446
|
+
* A short id for one process lifetime: the first half of every entry `id`.
|
|
4447
|
+
* Base-36 epoch ms plus a random suffix, so two boots of the same process in
|
|
4448
|
+
* the same millisecond still mint different ids.
|
|
4449
|
+
*/
|
|
4450
|
+
function newBootId() {
|
|
4451
|
+
return `${Date.now().toString(36)}${Math.floor(Math.random() * 36 ** 4).toString(36).padStart(4, "0")}`;
|
|
4452
|
+
}
|
|
4442
4453
|
var LogManager = class {
|
|
4443
4454
|
ringBuffer;
|
|
4444
4455
|
/**
|
|
@@ -4475,6 +4486,14 @@ var LogManager = class {
|
|
|
4475
4486
|
*/
|
|
4476
4487
|
gate = getLoggingGate();
|
|
4477
4488
|
/**
|
|
4489
|
+
* Entry identity (D898): `<bootId>.<seq>`, stamped once, here, on every line
|
|
4490
|
+
* this process accepts — so the in-memory tail, the live subscription and
|
|
4491
|
+
* the rotated file carry the SAME id and a page read from disk dedupes
|
|
4492
|
+
* exactly against the lines pushed live.
|
|
4493
|
+
*/
|
|
4494
|
+
bootId = newBootId();
|
|
4495
|
+
seq = 0;
|
|
4496
|
+
/**
|
|
4478
4497
|
* `perAddonCapacity` bounds EACH addon's bucket, not the total — a chatty addon
|
|
4479
4498
|
* evicts only its own lines, so quiet addons keep their sparse history.
|
|
4480
4499
|
*
|
|
@@ -4507,7 +4526,10 @@ var LogManager = class {
|
|
|
4507
4526
|
}
|
|
4508
4527
|
createLogger(scope) {
|
|
4509
4528
|
return new ScopedLogger(scope, (entry) => {
|
|
4510
|
-
const enriched =
|
|
4529
|
+
const enriched = {
|
|
4530
|
+
...redactLogEntry(this.enrichDeviceName(entry)),
|
|
4531
|
+
id: `${this.bootId}.${String(++this.seq)}`
|
|
4532
|
+
};
|
|
4511
4533
|
if (this.isDestinationEnabled?.("log-buffer") !== false) this.ringBuffer.push(enriched);
|
|
4512
4534
|
if (this.gate.allowsDestination(enriched)) for (const entry of this.destinations) {
|
|
4513
4535
|
if (entry.addonId !== void 0 && this.isDestinationEnabled?.(entry.addonId) === false) continue;
|
|
@@ -16049,6 +16071,67 @@ function createChildrenBatchLoader(opts) {
|
|
|
16049
16071
|
} };
|
|
16050
16072
|
}
|
|
16051
16073
|
//#endregion
|
|
16074
|
+
//#region src/kernel/moleculer/accessory-prune-gate.ts
|
|
16075
|
+
function isSpecList(answer) {
|
|
16076
|
+
return Array.isArray(answer);
|
|
16077
|
+
}
|
|
16078
|
+
function classifyAccessoryRead(answer, ctx) {
|
|
16079
|
+
if (isSpecList(answer)) {
|
|
16080
|
+
if (!ctx.online) return {
|
|
16081
|
+
kind: "unknown",
|
|
16082
|
+
reason: "parent offline",
|
|
16083
|
+
children: answer
|
|
16084
|
+
};
|
|
16085
|
+
if (ctx.probedAt === 0) return {
|
|
16086
|
+
kind: "unknown",
|
|
16087
|
+
reason: "probe not yet completed",
|
|
16088
|
+
children: answer
|
|
16089
|
+
};
|
|
16090
|
+
return {
|
|
16091
|
+
kind: "successful",
|
|
16092
|
+
children: answer
|
|
16093
|
+
};
|
|
16094
|
+
}
|
|
16095
|
+
if (answer.kind === "unknown") return {
|
|
16096
|
+
kind: "unknown",
|
|
16097
|
+
reason: answer.reason,
|
|
16098
|
+
children: answer.known ?? []
|
|
16099
|
+
};
|
|
16100
|
+
return {
|
|
16101
|
+
kind: "successful",
|
|
16102
|
+
children: answer.children
|
|
16103
|
+
};
|
|
16104
|
+
}
|
|
16105
|
+
/** One per parent registration; in-memory on purpose (a restart starts over — the safe direction). */
|
|
16106
|
+
var AccessoryShrinkGate = class {
|
|
16107
|
+
/** childId → the probe (`lastProbedAt`) of the first successful read that lacked it. */
|
|
16108
|
+
#firstMissing = /* @__PURE__ */ new Map();
|
|
16109
|
+
/**
|
|
16110
|
+
* `missing` = the managed children a SUCCESSFUL read no longer lists. Never
|
|
16111
|
+
* call this for an unknown read.
|
|
16112
|
+
*/
|
|
16113
|
+
decide(missing, probedAt) {
|
|
16114
|
+
const missingSet = new Set(missing);
|
|
16115
|
+
for (const id of [...this.#firstMissing.keys()]) if (!missingSet.has(id)) this.#firstMissing.delete(id);
|
|
16116
|
+
const prune = [];
|
|
16117
|
+
const deferred = [];
|
|
16118
|
+
for (const id of missing) {
|
|
16119
|
+
const first = this.#firstMissing.get(id);
|
|
16120
|
+
if (first !== void 0 && probedAt > first) {
|
|
16121
|
+
prune.push(id);
|
|
16122
|
+
this.#firstMissing.delete(id);
|
|
16123
|
+
continue;
|
|
16124
|
+
}
|
|
16125
|
+
if (first === void 0) this.#firstMissing.set(id, probedAt);
|
|
16126
|
+
deferred.push(id);
|
|
16127
|
+
}
|
|
16128
|
+
return {
|
|
16129
|
+
prune,
|
|
16130
|
+
deferred
|
|
16131
|
+
};
|
|
16132
|
+
}
|
|
16133
|
+
};
|
|
16134
|
+
//#endregion
|
|
16052
16135
|
//#region src/kernel/moleculer/runtime-state-load.ts
|
|
16053
16136
|
/** A device build refused because its runtime state could not be loaded. */
|
|
16054
16137
|
var RuntimeStateLoadError = class extends Error {
|
|
@@ -16771,6 +16854,7 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
16771
16854
|
throw err;
|
|
16772
16855
|
}
|
|
16773
16856
|
const lifecycleHost = device;
|
|
16857
|
+
const shrinkGate = new AccessoryShrinkGate();
|
|
16774
16858
|
const runReconcile = async () => {
|
|
16775
16859
|
try {
|
|
16776
16860
|
await callDeviceManager(api, "registerDevice", {
|
|
@@ -16794,7 +16878,12 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
16794
16878
|
});
|
|
16795
16879
|
}
|
|
16796
16880
|
if (typeof lifecycleHost.getAccessoryChildren !== "function") return;
|
|
16797
|
-
const
|
|
16881
|
+
const probedAt = device.runtimeState?.getCapState("feature-probe")?.lastProbedAt ?? 0;
|
|
16882
|
+
const read = classifyAccessoryRead(lifecycleHost.getAccessoryChildren(), {
|
|
16883
|
+
online: device.online,
|
|
16884
|
+
probedAt
|
|
16885
|
+
});
|
|
16886
|
+
const specs = read.children;
|
|
16798
16887
|
const expected = new Set(specs.map((s) => `${device.stableId}-${s.stableIdSuffix}`));
|
|
16799
16888
|
await runBounded(specs, ACCESSORY_SPAWN_CONCURRENCY, async (spec) => {
|
|
16800
16889
|
try {
|
|
@@ -16812,24 +16901,42 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
16812
16901
|
});
|
|
16813
16902
|
}
|
|
16814
16903
|
});
|
|
16815
|
-
if (
|
|
16816
|
-
opts.logger.
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16904
|
+
if (read.kind === "unknown") {
|
|
16905
|
+
opts.logger.info("Accessory orphan reconciliation skipped — child list unknown", {
|
|
16906
|
+
tags: {
|
|
16907
|
+
deviceId: device.id,
|
|
16908
|
+
parentStableId: device.stableId
|
|
16909
|
+
},
|
|
16910
|
+
meta: {
|
|
16911
|
+
reason: read.reason,
|
|
16912
|
+
probedAt
|
|
16913
|
+
}
|
|
16914
|
+
});
|
|
16820
16915
|
return;
|
|
16821
16916
|
}
|
|
16822
16917
|
try {
|
|
16823
|
-
const
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16918
|
+
const missing = (await childrenLoader.load(device.id)).filter((child) => child.linkDeviceId === device.id && !expected.has(child.stableId));
|
|
16919
|
+
const decision = shrinkGate.decide(missing.map((child) => child.id), probedAt);
|
|
16920
|
+
if (decision.deferred.length > 0) opts.logger.info("Accessory children missing from a complete read — kept until a later probe agrees", {
|
|
16921
|
+
tags: {
|
|
16922
|
+
deviceId: device.id,
|
|
16923
|
+
parentStableId: device.stableId
|
|
16924
|
+
},
|
|
16925
|
+
meta: {
|
|
16926
|
+
childDeviceIds: [...decision.deferred],
|
|
16927
|
+
probedAt
|
|
16928
|
+
}
|
|
16929
|
+
});
|
|
16930
|
+
const confirmed = new Set(decision.prune);
|
|
16931
|
+
for (const child of missing) {
|
|
16932
|
+
if (!confirmed.has(child.id)) continue;
|
|
16827
16933
|
const live = registry.getById(child.id);
|
|
16828
16934
|
try {
|
|
16829
16935
|
if (live) await deviceApi.remove(child.id);
|
|
16830
16936
|
else await callDeviceManager(api, "removeDevice", { deviceId: child.id });
|
|
16831
16937
|
opts.logger.info("Removed orphan accessory child no longer in parent specs", {
|
|
16832
16938
|
tags: {
|
|
16939
|
+
deviceId: child.id,
|
|
16833
16940
|
parentDeviceId: device.id,
|
|
16834
16941
|
parentStableId: device.stableId
|
|
16835
16942
|
},
|
|
@@ -16842,6 +16949,7 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
16842
16949
|
} catch (err) {
|
|
16843
16950
|
opts.logger.warn("Failed to remove orphan accessory child", {
|
|
16844
16951
|
tags: {
|
|
16952
|
+
deviceId: child.id,
|
|
16845
16953
|
parentDeviceId: device.id,
|
|
16846
16954
|
parentStableId: device.stableId,
|
|
16847
16955
|
childDeviceId: child.id
|
|
@@ -21301,7 +21409,7 @@ var LEVEL_ORDER = {
|
|
|
21301
21409
|
warn: 2,
|
|
21302
21410
|
error: 3
|
|
21303
21411
|
};
|
|
21304
|
-
function levelRank(level) {
|
|
21412
|
+
function levelRank$1(level) {
|
|
21305
21413
|
return LEVEL_ORDER[level] ?? 0;
|
|
21306
21414
|
}
|
|
21307
21415
|
function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, tags = {}) {
|
|
@@ -21313,7 +21421,7 @@ function createUdsLoggerWithState(client, addonId, nodeId, levelState, scope, ta
|
|
|
21313
21421
|
...tags
|
|
21314
21422
|
};
|
|
21315
21423
|
function log(level, message, extras) {
|
|
21316
|
-
if (levelRank(level) < levelRank(levelState.current)) return;
|
|
21424
|
+
if (levelRank$1(level) < levelRank$1(levelState.current)) return;
|
|
21317
21425
|
const mergedTags = extras?.tags ? {
|
|
21318
21426
|
...baseTags,
|
|
21319
21427
|
...extras.tags
|
|
@@ -27827,6 +27935,7 @@ exports.attachUserManagementInternal = require_builtins_local_auth_local_auth_ad
|
|
|
27827
27935
|
exports.attributeStall = require_custom_action_registry.attributeStall;
|
|
27828
27936
|
exports.backupOrchestratorRecordKinds = require_restore_archive.backupOrchestratorRecordKinds;
|
|
27829
27937
|
exports.backupRecordStoresOf = require_restore_archive.backupRecordStoresOf;
|
|
27938
|
+
exports.bareAddonOf = require_log_read_filter.bareAddonOf;
|
|
27830
27939
|
exports.bindPendingLanHttp = require_hub_mdns_ciao.bindPendingLanHttp;
|
|
27831
27940
|
exports.bootstrapSchema = bootstrapSchema;
|
|
27832
27941
|
exports.brokerCallForCap = brokerCallForCap;
|
|
@@ -27875,6 +27984,7 @@ exports.clusterNodeHistoryRecordKind = clusterNodeHistoryRecordKind;
|
|
|
27875
27984
|
exports.collectAgentNames = require_agent_https.collectAgentNames;
|
|
27876
27985
|
exports.collectCertIdentity = require_agent_https.collectCertIdentity;
|
|
27877
27986
|
exports.collectModelFiles = require_custom_action_registry.collectModelFiles;
|
|
27987
|
+
exports.compileLogFilter = require_log_read_filter.compileLogFilter;
|
|
27878
27988
|
exports.computePairingCommitment = require_builtins_system_config_system_config_addon.computePairingCommitment;
|
|
27879
27989
|
exports.computePairingSas = require_builtins_system_config_system_config_addon.computePairingSas;
|
|
27880
27990
|
exports.connectBrokerTransport = connectBrokerTransport;
|
|
@@ -27984,6 +28094,7 @@ exports.evaluateExistingCert = require_agent_https.evaluateExistingCert;
|
|
|
27984
28094
|
exports.expandCapMethods = require_dist.expandCapMethods;
|
|
27985
28095
|
exports.exportMeshPrivateKeyPem = require_agent_https.exportMeshPrivateKeyPem;
|
|
27986
28096
|
exports.fetchJson = require_custom_action_registry.fetchJson;
|
|
28097
|
+
exports.filterIsEmpty = require_log_read_filter.filterIsEmpty;
|
|
27987
28098
|
exports.findAddonRefusal = findAddonRefusal;
|
|
27988
28099
|
Object.defineProperty(exports, "findInPath", {
|
|
27989
28100
|
enumerable: true,
|
|
@@ -28094,6 +28205,9 @@ exports.issueMeshLeafForNode = require_agent_https.issueMeshLeafForNode;
|
|
|
28094
28205
|
exports.issueMeshLeafFromCsr = require_agent_https.issueMeshLeafFromCsr;
|
|
28095
28206
|
exports.keyFingerprintShort = require_builtins_system_config_system_config_addon.keyFingerprintShort;
|
|
28096
28207
|
exports.leafFingerprintOf = require_hub_mdns_ciao.leafFingerprintOf;
|
|
28208
|
+
exports.levelRank = require_log_read_filter.levelRank;
|
|
28209
|
+
exports.lineContainsText = require_log_read_filter.lineContainsText;
|
|
28210
|
+
exports.lineMatches = require_log_read_filter.lineMatches;
|
|
28097
28211
|
exports.loadAgentHttps = require_agent_https.loadAgentHttps;
|
|
28098
28212
|
exports.loadDeviceCa = require_device_ca.loadDeviceCa;
|
|
28099
28213
|
exports.loadMeshCa = require_agent_https.loadMeshCa;
|
|
@@ -28111,6 +28225,7 @@ exports.normalizeIp = require_builtins_system_config_system_config_addon.normali
|
|
|
28111
28225
|
exports.onProcessNodeRegistered = require_builtins_system_config_system_config_addon.onProcessNodeRegistered;
|
|
28112
28226
|
exports.onSessionsRevoked = require_builtins_local_auth_local_auth_addon.onSessionsRevoked;
|
|
28113
28227
|
exports.openMeshTlsWhenRevocationsLoaded = require_builtins_system_config_system_config_addon.openMeshTlsWhenRevocationsLoaded;
|
|
28228
|
+
exports.originNodeOf = require_log_read_filter.originNodeOf;
|
|
28114
28229
|
exports.overlayGetStatus = overlayGetStatus;
|
|
28115
28230
|
exports.parseAgentDashboardOrigins = require_builtins_system_config_system_config_addon.parseAgentDashboardOrigins;
|
|
28116
28231
|
exports.parseCapAction = parseCapAction;
|