@adhdev/daemon-core 0.9.72 → 0.9.73

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
@@ -21394,7 +21394,20 @@ var DaemonCommandRouter = class {
21394
21394
  }
21395
21395
  if (!mesh) return { success: false, error: "Mesh not found" };
21396
21396
  if (!Array.isArray(mesh.nodes) || mesh.nodes.length === 0) return { success: false, error: "No nodes in mesh" };
21397
- const workspace = mesh.nodes[0].workspace;
21397
+ const requestedCoordinatorNodeId = typeof args?.coordinatorNodeId === "string" ? args.coordinatorNodeId.trim() : "";
21398
+ const preferredCoordinatorNodeId = requestedCoordinatorNodeId || (typeof mesh.coordinator?.preferredNodeId === "string" ? mesh.coordinator.preferredNodeId.trim() : "");
21399
+ const coordinatorNode = preferredCoordinatorNodeId ? mesh.nodes.find((node) => node?.id === preferredCoordinatorNodeId || node?.nodeId === preferredCoordinatorNodeId) : mesh.nodes[0];
21400
+ if (!coordinatorNode) {
21401
+ return {
21402
+ success: false,
21403
+ code: "mesh_coordinator_node_not_found",
21404
+ error: `Coordinator node ${preferredCoordinatorNodeId} was not found in mesh`,
21405
+ meshId,
21406
+ cliType
21407
+ };
21408
+ }
21409
+ const workspace = typeof coordinatorNode.workspace === "string" ? coordinatorNode.workspace.trim() : "";
21410
+ if (!workspace) return { success: false, error: "Coordinator node workspace required", meshId, cliType };
21398
21411
  const providerMeta = this.deps.providerLoader.resolve?.(cliType) || this.deps.providerLoader.getMeta(cliType);
21399
21412
  const coordinatorSetup = resolveMeshCoordinatorSetup({
21400
21413
  provider: providerMeta,