@adhdev/daemon-core 0.9.82-rc.286 → 0.9.82-rc.287
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/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/mesh/mesh-reconcile-loop.ts +67 -15
package/dist/index.mjs
CHANGED
|
@@ -270,10 +270,10 @@ function readInjected(value) {
|
|
|
270
270
|
}
|
|
271
271
|
function getDaemonBuildInfo() {
|
|
272
272
|
if (cached) return cached;
|
|
273
|
-
const commit = readInjected(true ? "
|
|
274
|
-
const commitShort = readInjected(true ? "
|
|
275
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
276
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
273
|
+
const commit = readInjected(true ? "542b47e003c32fc24f6325d1fd48a6b3ed745edd" : void 0) ?? "unknown";
|
|
274
|
+
const commitShort = readInjected(true ? "542b47e0" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
275
|
+
const version = readInjected(true ? "0.9.82-rc.287" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
276
|
+
const builtAt = readInjected(true ? "2026-06-16T02:16:32.113Z" : void 0);
|
|
277
277
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
278
278
|
return cached;
|
|
279
279
|
}
|
|
@@ -8648,6 +8648,20 @@ function daemonHostsMesh(mesh, daemonIds) {
|
|
|
8648
8648
|
if (!hostDaemonId) return true;
|
|
8649
8649
|
return daemonIds.includes(hostDaemonId);
|
|
8650
8650
|
}
|
|
8651
|
+
function resolveCoordinatorSelfIds(mesh, drainDaemonIds) {
|
|
8652
|
+
const ids = new Set(drainDaemonIds);
|
|
8653
|
+
for (const node of mesh.nodes) {
|
|
8654
|
+
const nodeDaemonId = readNonEmptyString2(node.daemonId);
|
|
8655
|
+
const nodeMachineId = readNonEmptyString2(node.machineId);
|
|
8656
|
+
const isSelf = nodeDaemonId && drainDaemonIds.includes(nodeDaemonId) || nodeMachineId && drainDaemonIds.includes(nodeMachineId);
|
|
8657
|
+
if (!isSelf) continue;
|
|
8658
|
+
if (nodeDaemonId) ids.add(nodeDaemonId);
|
|
8659
|
+
if (nodeMachineId) ids.add(nodeMachineId);
|
|
8660
|
+
}
|
|
8661
|
+
const hostDaemonId = readNonEmptyString2(mesh.meshHost?.hostDaemonId);
|
|
8662
|
+
if (hostDaemonId && ids.has(hostDaemonId)) ids.add(hostDaemonId);
|
|
8663
|
+
return [...ids];
|
|
8664
|
+
}
|
|
8651
8665
|
function findLiveCoordinators(components) {
|
|
8652
8666
|
const out = [];
|
|
8653
8667
|
for (const inst of components.instanceManager.getByCategory("cli")) {
|
|
@@ -8681,9 +8695,10 @@ async function runMeshReconcileTick(components) {
|
|
|
8681
8695
|
})();
|
|
8682
8696
|
if (dispatchMeshCommand) {
|
|
8683
8697
|
for (const mesh of listMeshes()) {
|
|
8684
|
-
|
|
8698
|
+
const selfIds = resolveCoordinatorSelfIds(mesh, drainDaemonIds);
|
|
8699
|
+
if (!daemonHostsMesh(mesh, selfIds)) continue;
|
|
8685
8700
|
try {
|
|
8686
|
-
await pullRemoteNodeQueues(components, mesh, localDaemonId,
|
|
8701
|
+
await pullRemoteNodeQueues(components, mesh, localDaemonId, selfIds);
|
|
8687
8702
|
} catch (e) {
|
|
8688
8703
|
LOG.warn("MeshReconcile", `Remote node pull failed for mesh ${mesh.id}: ${e?.message || e}`);
|
|
8689
8704
|
}
|
|
@@ -8731,15 +8746,16 @@ async function runMeshReconcileTick(components) {
|
|
|
8731
8746
|
}
|
|
8732
8747
|
}
|
|
8733
8748
|
}
|
|
8734
|
-
async function pullRemoteNodeQueues(components, mesh, localDaemonId,
|
|
8749
|
+
async function pullRemoteNodeQueues(components, mesh, localDaemonId, candidateDaemonIds) {
|
|
8735
8750
|
const dispatchMeshCommand = components.dispatchMeshCommand;
|
|
8736
8751
|
if (!dispatchMeshCommand) return;
|
|
8737
8752
|
const meshId = mesh.id;
|
|
8738
|
-
const pulls =
|
|
8753
|
+
const pulls = candidateDaemonIds.length > 0 ? candidateDaemonIds.map((id) => ({ meshId, coordinatorDaemonId: id })) : [{ meshId }];
|
|
8739
8754
|
for (const node of mesh.nodes) {
|
|
8740
8755
|
const nodeDaemonId = readNonEmptyString2(node.daemonId);
|
|
8741
8756
|
if (!nodeDaemonId) continue;
|
|
8742
8757
|
if (localDaemonId && nodeDaemonId === localDaemonId) continue;
|
|
8758
|
+
if (candidateDaemonIds.includes(nodeDaemonId)) continue;
|
|
8743
8759
|
for (const pendingEventArgs of pulls) {
|
|
8744
8760
|
let events;
|
|
8745
8761
|
try {
|