@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.js CHANGED
@@ -21581,7 +21581,20 @@ var DaemonCommandRouter = class {
21581
21581
  }
21582
21582
  if (!mesh) return { success: false, error: "Mesh not found" };
21583
21583
  if (!Array.isArray(mesh.nodes) || mesh.nodes.length === 0) return { success: false, error: "No nodes in mesh" };
21584
- const workspace = mesh.nodes[0].workspace;
21584
+ const requestedCoordinatorNodeId = typeof args?.coordinatorNodeId === "string" ? args.coordinatorNodeId.trim() : "";
21585
+ const preferredCoordinatorNodeId = requestedCoordinatorNodeId || (typeof mesh.coordinator?.preferredNodeId === "string" ? mesh.coordinator.preferredNodeId.trim() : "");
21586
+ const coordinatorNode = preferredCoordinatorNodeId ? mesh.nodes.find((node) => node?.id === preferredCoordinatorNodeId || node?.nodeId === preferredCoordinatorNodeId) : mesh.nodes[0];
21587
+ if (!coordinatorNode) {
21588
+ return {
21589
+ success: false,
21590
+ code: "mesh_coordinator_node_not_found",
21591
+ error: `Coordinator node ${preferredCoordinatorNodeId} was not found in mesh`,
21592
+ meshId,
21593
+ cliType
21594
+ };
21595
+ }
21596
+ const workspace = typeof coordinatorNode.workspace === "string" ? coordinatorNode.workspace.trim() : "";
21597
+ if (!workspace) return { success: false, error: "Coordinator node workspace required", meshId, cliType };
21585
21598
  const providerMeta = this.deps.providerLoader.resolve?.(cliType) || this.deps.providerLoader.getMeta(cliType);
21586
21599
  const coordinatorSetup = resolveMeshCoordinatorSetup({
21587
21600
  provider: providerMeta,