@adhdev/daemon-core 0.9.82-rc.141 → 0.9.82-rc.142

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
@@ -4149,8 +4149,19 @@ function setupMeshEventForwarding(components) {
4149
4149
  const workspace = readNonEmptyString2(state.workspace);
4150
4150
  if (!workspace) return;
4151
4151
  const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
4152
- if (readNonEmptyString2(settings.meshCoordinatorFor)) return;
4153
- const meshIdFromRuntime = readNonEmptyString2(settings.meshNodeFor);
4152
+ const coordinatorMeshId = readNonEmptyString2(settings.meshCoordinatorFor);
4153
+ let meshIdFromDirectDispatch = "";
4154
+ if (coordinatorMeshId) {
4155
+ try {
4156
+ const activeDispatches = getActiveDirectDispatches(coordinatorMeshId);
4157
+ if (activeDispatches.some((d) => d.sessionId === instanceId)) {
4158
+ meshIdFromDirectDispatch = coordinatorMeshId;
4159
+ }
4160
+ } catch {
4161
+ }
4162
+ if (!meshIdFromDirectDispatch) return;
4163
+ }
4164
+ const meshIdFromRuntime = readNonEmptyString2(settings.meshNodeFor) || meshIdFromDirectDispatch;
4154
4165
  const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
4155
4166
  if (!isMeshDelegate) return;
4156
4167
  const mesh = meshIdFromRuntime ? getMeshWithCache(components, meshIdFromRuntime) : getCachedMeshByWorkspace(workspace);