@adhdev/daemon-standalone 0.9.82-rc.343 → 0.9.82-rc.345

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.82-rc.343",
3
+ "version": "0.9.82-rc.345",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -9,7 +9,7 @@
9
9
  "adhdev-mcp": "./vendor/mcp-server/index.js"
10
10
  },
11
11
  "scripts": {
12
- "preinstall": "node -e \"const major=Number.parseInt(process.versions.node.split('.')[0],10); if (process.platform === 'win32' && major >= 24) { console.error('\\n✗ ADHDev standalone does not currently support Node.js 24+ on Windows.\\n Install Node.js 22.x on Windows, then retry.\\n'); process.exit(1); }\"",
12
+ "preinstall": "node -e \"const major=Number.parseInt(process.versions.node.split('.')[0],10); if (process.platform === 'win32' && major >= 24 && !process.env.ADHDEV_BOOTSTRAP && !process.env.CI) { console.error('\\n✗ ADHDev standalone does not currently support Node.js 24+ on Windows.\\n Install Node.js 22.x on Windows, then retry.\\n'); process.exit(1); }\"",
13
13
  "build": "tsup",
14
14
  "bundle:web": "node -e \"const{cpSync,mkdirSync}=require('fs');mkdirSync('public',{recursive:true});cpSync('../web-standalone/dist','public',{recursive:true});console.log('bundled web-standalone → public/')\"",
15
15
  "bundle:vendor": "node ./scripts/vendor-runtime-deps.mjs",
@@ -3384,7 +3384,7 @@ async function meshEnqueueTask(ctx, args) {
3384
3384
  const preferWorktree = args.preferWorktree === true || args.prefer_worktree === true;
3385
3385
  const targetNodeId = explicitTarget || (preferWorktree ? resolvePreferredWorktreeNodeId(ctx) : void 0);
3386
3386
  try {
3387
- const task = (0, import_daemon_core.enqueueTask)(ctx.mesh.id, args.message, { taskMode, requiredTags, dependsOn, missionId, targetNodeId });
3387
+ const task = (0, import_daemon_core.enqueueTask)(ctx.mesh.id, args.message, { taskMode, requiredTags, dependsOn, missionId, targetNodeId, ...ctx.coordinatorSessionId ? { sourceCoordinatorSessionId: ctx.coordinatorSessionId } : {} });
3388
3388
  if (!(ctx.transport instanceof IpcTransport)) {
3389
3389
  const queueTrigger = await triggerMeshQueueAndReport(ctx);
3390
3390
  return JSON.stringify({
@@ -3741,7 +3741,11 @@ async function meshSendTask(ctx, args) {
3741
3741
  meshId: ctx.mesh.id,
3742
3742
  nodeId: args.node_id,
3743
3743
  taskId,
3744
- ...coordinatorDaemonId ? { coordinatorDaemonId } : {}
3744
+ ...coordinatorDaemonId ? { coordinatorDaemonId } : {},
3745
+ // (3) Stamp the originating coordinator session so the worker's completion
3746
+ // routes back to THIS coordinator session (multi-coordinator). Survives the
3747
+ // P2P dispatch to the remote worker, which echoes it on its completion event.
3748
+ ...ctx.coordinatorSessionId ? { coordinatorSessionId: ctx.coordinatorSessionId } : {}
3745
3749
  }
3746
3750
  });
3747
3751
  if (result2.success) {
@@ -3915,7 +3919,9 @@ async function meshSendTask(ctx, args) {
3915
3919
  meshId: ctx.mesh.id,
3916
3920
  nodeId: args.node_id,
3917
3921
  taskId,
3918
- ...coordinatorDaemonId ? { coordinatorDaemonId } : {}
3922
+ ...coordinatorDaemonId ? { coordinatorDaemonId } : {},
3923
+ // (3) Originating coordinator session anchor — see the remote-dispatch path above.
3924
+ ...ctx.coordinatorSessionId ? { coordinatorSessionId: ctx.coordinatorSessionId } : {}
3919
3925
  }
3920
3926
  });
3921
3927
  const dispatchPayload = unwrapCommandPayload(dispatchResult);
@@ -4137,6 +4143,10 @@ async function meshLaunchSession(ctx, args) {
4137
4143
  // Lands in settingsOverride and beats the global per-provider autoApprove.
4138
4144
  autoApprove: delegatedWorkerAutoApprove,
4139
4145
  ...coordinatorDaemonId ? { meshCoordinatorDaemonId: coordinatorDaemonId } : {},
4146
+ // (3) Stamp the originating coordinator SESSION at launch too, so a worker
4147
+ // launched via mesh_launch_session routes its completions back to the exact
4148
+ // coordinator session (multi-coordinator). Absent → daemon-level fallback.
4149
+ ...ctx.coordinatorSessionId ? { meshCoordinatorSessionId: ctx.coordinatorSessionId } : {},
4140
4150
  ...coordinatorNode?.id ? { meshCoordinatorNodeId: coordinatorNode.id } : {},
4141
4151
  launchedByCoordinator: true
4142
4152
  }
@@ -5604,7 +5614,8 @@ async function startMcpServer(opts) {
5604
5614
  } catch {
5605
5615
  }
5606
5616
  }
5607
- const meshCtx = { mesh, transport, ...localDaemonId ? { localDaemonId } : {}, ...localMachineId ? { localMachineId } : {}, ...coordinatorHostname ? { coordinatorHostname } : {} };
5617
+ const coordinatorSessionId = typeof process.env.ADHDEV_COORDINATOR_SESSION_ID === "string" && process.env.ADHDEV_COORDINATOR_SESSION_ID.trim() ? process.env.ADHDEV_COORDINATOR_SESSION_ID.trim() : void 0;
5618
+ const meshCtx = { mesh, transport, ...localDaemonId ? { localDaemonId } : {}, ...localMachineId ? { localMachineId } : {}, ...coordinatorHostname ? { coordinatorHostname } : {}, ...coordinatorSessionId ? { coordinatorSessionId } : {} };
5608
5619
  const coordinatorPrompt = await buildMeshModeCoordinatorPrompt(mesh);
5609
5620
  const server2 = new import_server.Server(
5610
5621
  { name: "adhdev-mcp-server", version: "0.9.82" },