@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 +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +19 -1
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -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
|
|
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,
|