@adhdev/daemon-standalone 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
@@ -37326,7 +37326,14 @@ Next step: ${nextStep}`;
37326
37326
  }
37327
37327
  return { success: true, forwarded: 0 };
37328
37328
  }
37329
- if (!isTerminalEvent) {
37329
+ const activeStatuses = /* @__PURE__ */ new Set(["generating", "streaming", "long_generating", "working", "starting", "waiting_approval"]);
37330
+ const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((coord) => {
37331
+ const s = coord.getState();
37332
+ const status = readNonEmptyString2(s.status).toLowerCase();
37333
+ const activeChatStatus = readNonEmptyString2(s.activeChat?.status).toLowerCase();
37334
+ return activeStatuses.has(status) || activeStatuses.has(activeChatStatus);
37335
+ });
37336
+ if (!isTerminalEvent || allCoordinatorsGenerating) {
37330
37337
  if (queuePendingMeshCoordinatorEvent({
37331
37338
  event: args.event,
37332
37339
  meshId: args.meshId,
@@ -37341,9 +37348,16 @@ Next step: ${nextStep}`;
37341
37348
  queuedAt: Date.now(),
37342
37349
  ...workerCoordinatorDaemonId ? { targetCoordinatorDaemonId: workerCoordinatorDaemonId } : {}
37343
37350
  })) {
37344
- LOG2.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
37351
+ if (allCoordinatorsGenerating) {
37352
+ LOG2.info("MeshEvents", `Queued ${args.event} for generating CLI coordinator (mesh ${args.meshId}) \u2014 will be delivered via auto-flush when coordinator returns to idle`);
37353
+ } else {
37354
+ LOG2.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
37355
+ }
37345
37356
  }
37346
37357
  }
37358
+ if (allCoordinatorsGenerating) {
37359
+ return { success: true, forwarded: 0, bufferedForGeneratingCoordinator: true };
37360
+ }
37347
37361
  for (const coord of coordinatorInstances) {
37348
37362
  const coordState = coord.getState();
37349
37363
  LOG2.info("MeshEvents", `Forwarding mesh event to coordinator ${coordState.instanceId}`);