@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/session-host-core",
3
- "version": "0.9.72",
3
+ "version": "0.9.73",
4
4
  "description": "ADHDev local session host core \u2014 session registry, protocol, buffers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.72",
3
+ "version": "0.9.73",
4
4
  "description": "ADHDev daemon core \u2014 CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1019,7 +1019,25 @@ export class DaemonCommandRouter {
1019
1019
  if (!mesh) return { success: false, error: 'Mesh not found' };
1020
1020
  if (!Array.isArray(mesh.nodes) || mesh.nodes.length === 0) return { success: false, error: 'No nodes in mesh' };
1021
1021
 
1022
- const workspace = mesh.nodes[0].workspace;
1022
+ const requestedCoordinatorNodeId = typeof args?.coordinatorNodeId === 'string'
1023
+ ? args.coordinatorNodeId.trim()
1024
+ : '';
1025
+ const preferredCoordinatorNodeId = requestedCoordinatorNodeId
1026
+ || (typeof mesh.coordinator?.preferredNodeId === 'string' ? mesh.coordinator.preferredNodeId.trim() : '');
1027
+ const coordinatorNode = preferredCoordinatorNodeId
1028
+ ? mesh.nodes.find((node: any) => node?.id === preferredCoordinatorNodeId || node?.nodeId === preferredCoordinatorNodeId)
1029
+ : mesh.nodes[0];
1030
+ if (!coordinatorNode) {
1031
+ return {
1032
+ success: false,
1033
+ code: 'mesh_coordinator_node_not_found',
1034
+ error: `Coordinator node ${preferredCoordinatorNodeId} was not found in mesh`,
1035
+ meshId,
1036
+ cliType,
1037
+ };
1038
+ }
1039
+ const workspace = typeof coordinatorNode.workspace === 'string' ? coordinatorNode.workspace.trim() : '';
1040
+ if (!workspace) return { success: false, error: 'Coordinator node workspace required', meshId, cliType };
1023
1041
  const providerMeta = this.deps.providerLoader.resolve?.(cliType) || this.deps.providerLoader.getMeta(cliType);
1024
1042
  const coordinatorSetup = resolveMeshCoordinatorSetup({
1025
1043
  provider: providerMeta,