@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 CHANGED
@@ -6680,11 +6680,18 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
6680
6680
  message: task.message,
6681
6681
  status: "delivering"
6682
6682
  });
6683
+ const localDaemonIdForDispatch = readNonEmptyString2(loadConfig().machineId) || void 0;
6683
6684
  components.dispatchMeshCommand(node.daemonId, "agent_command", {
6684
6685
  targetSessionId: sessionId,
6685
6686
  cliType: providerType,
6686
6687
  action: "send_chat",
6687
- message: task.message
6688
+ message: task.message,
6689
+ meshContext: {
6690
+ meshId,
6691
+ nodeId,
6692
+ taskId: task.id,
6693
+ ...localDaemonIdForDispatch ? { coordinatorDaemonId: localDaemonIdForDispatch } : {}
6694
+ }
6688
6695
  }).then(() => {
6689
6696
  updateSessionDeliveryStatus(delivery2.id, "delivered");
6690
6697
  }).catch((e) => {
@@ -7542,7 +7549,7 @@ function injectMeshSystemMessage(components, args) {
7542
7549
  if (workerCoordinatorDaemonId && localDaemonId && workerCoordinatorDaemonId !== localDaemonId) return false;
7543
7550
  return true;
7544
7551
  });
7545
- const isRefineTerminalEvent = (/* @__PURE__ */ new Set(["refine:completed", "refine:failed"])).has(args.event);
7552
+ const isTerminalEvent = (/* @__PURE__ */ new Set(["refine:completed", "refine:failed", "agent:generating_completed", "agent:stopped"])).has(args.event);
7546
7553
  if (coordinatorInstances.length === 0) {
7547
7554
  if (queuePendingMeshCoordinatorEvent({
7548
7555
  event: args.event,
@@ -7562,13 +7569,13 @@ function injectMeshSystemMessage(components, args) {
7562
7569
  }
7563
7570
  return { success: true, forwarded: 0 };
7564
7571
  }
7565
- const allCoordinatorsGenerating = isRefineTerminalEvent && coordinatorInstances.every((inst) => {
7572
+ const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((inst) => {
7566
7573
  const s = inst.getState();
7567
7574
  const status = readNonEmptyString2(s.status).toLowerCase();
7568
7575
  const activeChatStatus = readNonEmptyString2(s.activeChat?.status).toLowerCase();
7569
7576
  return status === "generating" || status === "streaming" || status === "long_generating" || activeChatStatus === "generating" || activeChatStatus === "streaming";
7570
7577
  });
7571
- if (!isRefineTerminalEvent || allCoordinatorsGenerating) {
7578
+ if (!isTerminalEvent || allCoordinatorsGenerating) {
7572
7579
  if (queuePendingMeshCoordinatorEvent({
7573
7580
  event: args.event,
7574
7581
  meshId: args.meshId,