@adhdev/daemon-standalone 0.9.77-rc.15 → 0.9.77-rc.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.77-rc.15",
3
+ "version": "0.9.77-rc.16",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -57410,6 +57410,10 @@ function resolveCoordinatorNode(ctx) {
57410
57410
  const preferred = ctx.mesh.nodes.find((n) => n.id === preferredNodeId && typeof n.daemonId === "string" && n.daemonId.trim());
57411
57411
  if (preferred) return preferred;
57412
57412
  }
57413
+ if (ctx.localMachineId) {
57414
+ const byMachine = ctx.mesh.nodes.find((n) => n.machineId === ctx.localMachineId);
57415
+ if (byMachine) return byMachine;
57416
+ }
57413
57417
  if (ctx.localDaemonId) {
57414
57418
  return ctx.mesh.nodes.find((n) => n.daemonId === ctx.localDaemonId);
57415
57419
  }
@@ -57499,7 +57503,8 @@ function getNodeLaunchReadiness(node) {
57499
57503
  };
57500
57504
  }
57501
57505
  async function commandForNode(ctx, node, command, args = {}) {
57502
- if (ctx.transport instanceof IpcTransport && node.daemonId && node.daemonId !== ctx.localDaemonId) {
57506
+ const isLocalNode = ctx.localMachineId && node.machineId === ctx.localMachineId || ctx.localDaemonId && node.daemonId === ctx.localDaemonId;
57507
+ if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
57503
57508
  return ctx.transport.meshCommand(node.daemonId, command, args);
57504
57509
  }
57505
57510
  if (isLocalTransport(ctx.transport)) {
@@ -59948,6 +59953,15 @@ async function startMcpServer(opts) {
59948
59953
  process.exit(1);
59949
59954
  }
59950
59955
  let localDaemonId;
59956
+ let localMachineId;
59957
+ if (transport instanceof LocalTransport || transport instanceof IpcTransport) {
59958
+ try {
59959
+ const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
59960
+ const cfg = loadConfig2();
59961
+ if (cfg.registeredMachineId) localMachineId = cfg.registeredMachineId;
59962
+ } catch {
59963
+ }
59964
+ }
59951
59965
  if (transport instanceof IpcTransport) {
59952
59966
  try {
59953
59967
  const statusResult = await transport.getStatus();
@@ -59956,7 +59970,7 @@ async function startMcpServer(opts) {
59956
59970
  } catch {
59957
59971
  }
59958
59972
  }
59959
- const meshCtx = { mesh, transport, ...localDaemonId ? { localDaemonId } : {} };
59973
+ const meshCtx = { mesh, transport, ...localDaemonId ? { localDaemonId } : {}, ...localMachineId ? { localMachineId } : {} };
59960
59974
  const coordinatorPrompt = await buildMeshModeCoordinatorPrompt(mesh);
59961
59975
  const server2 = new import_server.Server(
59962
59976
  { name: "adhdev-mcp-server", version: "0.9.76" },