@adhdev/daemon-core 0.9.82-rc.232 → 0.9.82-rc.234
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 +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/mesh/mesh-events-coordinator.ts +10 -3
package/dist/index.mjs
CHANGED
|
@@ -6674,11 +6674,18 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
|
|
|
6674
6674
|
message: task.message,
|
|
6675
6675
|
status: "delivering"
|
|
6676
6676
|
});
|
|
6677
|
+
const localDaemonIdForDispatch = readNonEmptyString2(loadConfig().machineId) || void 0;
|
|
6677
6678
|
components.dispatchMeshCommand(node.daemonId, "agent_command", {
|
|
6678
6679
|
targetSessionId: sessionId,
|
|
6679
6680
|
cliType: providerType,
|
|
6680
6681
|
action: "send_chat",
|
|
6681
|
-
message: task.message
|
|
6682
|
+
message: task.message,
|
|
6683
|
+
meshContext: {
|
|
6684
|
+
meshId,
|
|
6685
|
+
nodeId,
|
|
6686
|
+
taskId: task.id,
|
|
6687
|
+
...localDaemonIdForDispatch ? { coordinatorDaemonId: localDaemonIdForDispatch } : {}
|
|
6688
|
+
}
|
|
6682
6689
|
}).then(() => {
|
|
6683
6690
|
updateSessionDeliveryStatus(delivery2.id, "delivered");
|
|
6684
6691
|
}).catch((e) => {
|
|
@@ -7536,7 +7543,7 @@ function injectMeshSystemMessage(components, args) {
|
|
|
7536
7543
|
if (workerCoordinatorDaemonId && localDaemonId && workerCoordinatorDaemonId !== localDaemonId) return false;
|
|
7537
7544
|
return true;
|
|
7538
7545
|
});
|
|
7539
|
-
const
|
|
7546
|
+
const isTerminalEvent = (/* @__PURE__ */ new Set(["refine:completed", "refine:failed", "agent:generating_completed", "agent:stopped"])).has(args.event);
|
|
7540
7547
|
if (coordinatorInstances.length === 0) {
|
|
7541
7548
|
if (queuePendingMeshCoordinatorEvent({
|
|
7542
7549
|
event: args.event,
|
|
@@ -7556,13 +7563,13 @@ function injectMeshSystemMessage(components, args) {
|
|
|
7556
7563
|
}
|
|
7557
7564
|
return { success: true, forwarded: 0 };
|
|
7558
7565
|
}
|
|
7559
|
-
const allCoordinatorsGenerating =
|
|
7566
|
+
const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((inst) => {
|
|
7560
7567
|
const s = inst.getState();
|
|
7561
7568
|
const status = readNonEmptyString2(s.status).toLowerCase();
|
|
7562
7569
|
const activeChatStatus = readNonEmptyString2(s.activeChat?.status).toLowerCase();
|
|
7563
7570
|
return status === "generating" || status === "streaming" || status === "long_generating" || activeChatStatus === "generating" || activeChatStatus === "streaming";
|
|
7564
7571
|
});
|
|
7565
|
-
if (!
|
|
7572
|
+
if (!isTerminalEvent || allCoordinatorsGenerating) {
|
|
7566
7573
|
if (queuePendingMeshCoordinatorEvent({
|
|
7567
7574
|
event: args.event,
|
|
7568
7575
|
meshId: args.meshId,
|