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