@adhdev/daemon-core 0.9.82-rc.287 → 0.9.82-rc.288
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 +30 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/mesh/mesh-events-coordinator.ts +83 -8
- package/src/mesh/mesh-routing.ts +5 -2
package/dist/index.js
CHANGED
|
@@ -275,10 +275,10 @@ function readInjected(value) {
|
|
|
275
275
|
}
|
|
276
276
|
function getDaemonBuildInfo() {
|
|
277
277
|
if (cached) return cached;
|
|
278
|
-
const commit = readInjected(true ? "
|
|
279
|
-
const commitShort = readInjected(true ? "
|
|
280
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
281
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
278
|
+
const commit = readInjected(true ? "b17916645417b641feddfdaa6e5b249aea09f12a" : void 0) ?? "unknown";
|
|
279
|
+
const commitShort = readInjected(true ? "b1791664" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
280
|
+
const version = readInjected(true ? "0.9.82-rc.288" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
281
|
+
const builtAt = readInjected(true ? "2026-06-16T03:12:06.987Z" : void 0);
|
|
282
282
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
283
283
|
return cached;
|
|
284
284
|
}
|
|
@@ -7263,10 +7263,11 @@ function resolveWorkerDelegateRouting(components, instanceId, deps) {
|
|
|
7263
7263
|
const sessionId = readNonEmptyString2(instanceId);
|
|
7264
7264
|
let workspace = "";
|
|
7265
7265
|
let coordinatorDaemonId = "";
|
|
7266
|
+
let runtimeNodeId = "";
|
|
7266
7267
|
const reject = (rejectionReason) => ({
|
|
7267
7268
|
isDelegate: false,
|
|
7268
7269
|
meshId: "",
|
|
7269
|
-
nodeId:
|
|
7270
|
+
nodeId: runtimeNodeId,
|
|
7270
7271
|
nodeLabel: "",
|
|
7271
7272
|
coordinatorDaemonId,
|
|
7272
7273
|
workspace,
|
|
@@ -7280,6 +7281,7 @@ function resolveWorkerDelegateRouting(components, instanceId, deps) {
|
|
|
7280
7281
|
if (!workspace) return reject("no_workspace");
|
|
7281
7282
|
const settings = readSettings(state);
|
|
7282
7283
|
coordinatorDaemonId = readNonEmptyString2(settings.meshCoordinatorDaemonId);
|
|
7284
|
+
runtimeNodeId = readNonEmptyString2(settings.meshNodeId);
|
|
7283
7285
|
const coordinatorMeshId = readNonEmptyString2(settings.meshCoordinatorFor);
|
|
7284
7286
|
let meshIdFromDirectDispatch = "";
|
|
7285
7287
|
if (coordinatorMeshId) {
|
|
@@ -7300,7 +7302,6 @@ function resolveWorkerDelegateRouting(components, instanceId, deps) {
|
|
|
7300
7302
|
const meshId = meshIdFromRuntime || readNonEmptyString2(mesh?.id);
|
|
7301
7303
|
if (!meshId) return reject("mesh_unresolved");
|
|
7302
7304
|
const targetNode = mesh?.nodes?.find((n) => n.workspace === workspace);
|
|
7303
|
-
const runtimeNodeId = readNonEmptyString2(settings.meshNodeId);
|
|
7304
7305
|
const nodeId = readNonEmptyString2(targetNode?.id) || runtimeNodeId;
|
|
7305
7306
|
const nodeLabel = targetNode ? `Node '${targetNode.id}'` : runtimeNodeId ? `Node '${runtimeNodeId}'` : `Agent at ${workspace}`;
|
|
7306
7307
|
return {
|
|
@@ -8466,10 +8467,10 @@ function handleMeshForwardEvent(components, payload) {
|
|
|
8466
8467
|
if (!isMeshCoordinatorEvent(eventName)) {
|
|
8467
8468
|
return { success: false, error: "unsupported mesh event" };
|
|
8468
8469
|
}
|
|
8469
|
-
const meshId = readNonEmptyString2(payload.meshId);
|
|
8470
|
-
if (!meshId) return { success: false, error: "meshId required" };
|
|
8471
8470
|
const nodeId = readNonEmptyString2(payload.nodeId);
|
|
8472
8471
|
const workspace = readNonEmptyString2(payload.workspace);
|
|
8472
|
+
const meshId = readNonEmptyString2(payload.meshId) || (workspace ? readNonEmptyString2(getCachedMeshByWorkspace(workspace)?.id) : "");
|
|
8473
|
+
if (!meshId) return { success: false, error: "meshId required" };
|
|
8473
8474
|
const nodeLabel = nodeId ? `Node '${nodeId}'` : workspace ? `Agent at ${workspace}` : "Remote agent";
|
|
8474
8475
|
const relayModalMessage = readNonEmptyString2(payload.modalMessage);
|
|
8475
8476
|
const relayModalButtons = Array.isArray(payload.modalButtons) ? payload.modalButtons.filter((b) => typeof b === "string" && b.trim().length > 0) : null;
|
|
@@ -8508,6 +8509,24 @@ function handleMeshForwardEvent(components, payload) {
|
|
|
8508
8509
|
}
|
|
8509
8510
|
});
|
|
8510
8511
|
}
|
|
8512
|
+
function forwardUnresolvedDelegateEvent(components, routing, event) {
|
|
8513
|
+
const coordinatorDaemonId = readNonEmptyString2(routing.coordinatorDaemonId);
|
|
8514
|
+
if (!coordinatorDaemonId) return false;
|
|
8515
|
+
if (!components.dispatchMeshCommand) return false;
|
|
8516
|
+
const eventName = readNonEmptyString2(event.event);
|
|
8517
|
+
if (!eventName) return false;
|
|
8518
|
+
const payload = {
|
|
8519
|
+
...event,
|
|
8520
|
+
event: eventName,
|
|
8521
|
+
nodeId: readNonEmptyString2(routing.nodeId) || readNonEmptyString2(event.meshNodeId) || void 0,
|
|
8522
|
+
workspace: readNonEmptyString2(routing.workspace) || readNonEmptyString2(event.workspace) || void 0
|
|
8523
|
+
};
|
|
8524
|
+
Promise.resolve(components.dispatchMeshCommand(coordinatorDaemonId, "mesh_forward_event", payload)).catch((e) => {
|
|
8525
|
+
LOG.warn("MeshEvents", `Fallback forward of ${eventName} to coordinator ${coordinatorDaemonId} failed: ${e?.message || e}`);
|
|
8526
|
+
});
|
|
8527
|
+
LOG.info("MeshEvents", `Fallback-forwarded ${eventName} for unresolved-mesh worker at ${routing.workspace || "(no workspace)"} to coordinator daemon ${coordinatorDaemonId}`);
|
|
8528
|
+
return true;
|
|
8529
|
+
}
|
|
8511
8530
|
function setupMeshEventForwarding(components) {
|
|
8512
8531
|
components.instanceManager.onEvent((event) => {
|
|
8513
8532
|
if (event.event === "agent:ready" || event.event === "agent:generating_completed") {
|
|
@@ -8557,6 +8576,9 @@ function setupMeshEventForwarding(components) {
|
|
|
8557
8576
|
getMeshByWorkspace: (workspace) => getCachedMeshByWorkspace(workspace)
|
|
8558
8577
|
});
|
|
8559
8578
|
if (!routing.isDelegate) {
|
|
8579
|
+
if (isUnroutableDelegateRejection(routing) && forwardUnresolvedDelegateEvent(components, routing, event)) {
|
|
8580
|
+
return;
|
|
8581
|
+
}
|
|
8560
8582
|
recordUnroutableDelegateEvent(routing, event.event);
|
|
8561
8583
|
return;
|
|
8562
8584
|
}
|