@adhdev/daemon-core 0.9.82-rc.247 → 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.mjs CHANGED
@@ -7563,7 +7563,14 @@ function injectMeshSystemMessage(components, args) {
7563
7563
  }
7564
7564
  return { success: true, forwarded: 0 };
7565
7565
  }
7566
- if (!isTerminalEvent) {
7566
+ const activeStatuses = /* @__PURE__ */ new Set(["generating", "streaming", "long_generating", "working", "starting", "waiting_approval"]);
7567
+ const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((coord) => {
7568
+ const s = coord.getState();
7569
+ const status = readNonEmptyString2(s.status).toLowerCase();
7570
+ const activeChatStatus = readNonEmptyString2(s.activeChat?.status).toLowerCase();
7571
+ return activeStatuses.has(status) || activeStatuses.has(activeChatStatus);
7572
+ });
7573
+ if (!isTerminalEvent || allCoordinatorsGenerating) {
7567
7574
  if (queuePendingMeshCoordinatorEvent({
7568
7575
  event: args.event,
7569
7576
  meshId: args.meshId,
@@ -7578,9 +7585,16 @@ function injectMeshSystemMessage(components, args) {
7578
7585
  queuedAt: Date.now(),
7579
7586
  ...workerCoordinatorDaemonId ? { targetCoordinatorDaemonId: workerCoordinatorDaemonId } : {}
7580
7587
  })) {
7581
- LOG.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
7588
+ if (allCoordinatorsGenerating) {
7589
+ 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`);
7590
+ } else {
7591
+ LOG.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
7592
+ }
7582
7593
  }
7583
7594
  }
7595
+ if (allCoordinatorsGenerating) {
7596
+ return { success: true, forwarded: 0, bufferedForGeneratingCoordinator: true };
7597
+ }
7584
7598
  for (const coord of coordinatorInstances) {
7585
7599
  const coordState = coord.getState();
7586
7600
  LOG.info("MeshEvents", `Forwarding mesh event to coordinator ${coordState.instanceId}`);