@adhdev/daemon-core 0.9.82-rc.246 → 0.9.82-rc.248

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
@@ -7569,7 +7569,14 @@ function injectMeshSystemMessage(components, args) {
7569
7569
  }
7570
7570
  return { success: true, forwarded: 0 };
7571
7571
  }
7572
- if (!isTerminalEvent) {
7572
+ const activeStatuses = /* @__PURE__ */ new Set(["generating", "streaming", "long_generating", "working", "starting", "waiting_approval"]);
7573
+ const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((coord) => {
7574
+ const s = coord.getState();
7575
+ const status = readNonEmptyString2(s.status).toLowerCase();
7576
+ const activeChatStatus = readNonEmptyString2(s.activeChat?.status).toLowerCase();
7577
+ return activeStatuses.has(status) || activeStatuses.has(activeChatStatus);
7578
+ });
7579
+ if (!isTerminalEvent || allCoordinatorsGenerating) {
7573
7580
  if (queuePendingMeshCoordinatorEvent({
7574
7581
  event: args.event,
7575
7582
  meshId: args.meshId,
@@ -7584,9 +7591,16 @@ function injectMeshSystemMessage(components, args) {
7584
7591
  queuedAt: Date.now(),
7585
7592
  ...workerCoordinatorDaemonId ? { targetCoordinatorDaemonId: workerCoordinatorDaemonId } : {}
7586
7593
  })) {
7587
- LOG.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
7594
+ if (allCoordinatorsGenerating) {
7595
+ LOG.info("MeshEvents", `Queued ${args.event} for generating CLI coordinator (mesh ${args.meshId}) \u2014 will be delivered via auto-flush when coordinator returns to idle`);
7596
+ } else {
7597
+ LOG.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
7598
+ }
7588
7599
  }
7589
7600
  }
7601
+ if (allCoordinatorsGenerating) {
7602
+ return { success: true, forwarded: 0, bufferedForGeneratingCoordinator: true };
7603
+ }
7590
7604
  for (const coord of coordinatorInstances) {
7591
7605
  const coordState = coord.getState();
7592
7606
  LOG.info("MeshEvents", `Forwarding mesh event to coordinator ${coordState.instanceId}`);