@adhdev/daemon-standalone 1.0.58-rc.18 → 1.0.58-rc.20

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": "1.0.58-rc.18",
3
+ "version": "1.0.58-rc.20",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "license": "AGPL-3.0-or-later",
38
38
  "dependencies": {
39
39
  "@adhdev/ghostty-vt-node": "*",
40
- "@adhdev/session-host-core": "1.0.58-rc.18",
40
+ "@adhdev/session-host-core": "1.0.58-rc.20",
41
41
  "@xterm/addon-serialize": "^0.14.0",
42
42
  "@xterm/xterm": "^6.0.0",
43
43
  "chalk": "^5.3.0",
@@ -5483,13 +5483,21 @@ function normalizeEnqueueTaskArgs(ctx, args, callerLabel) {
5483
5483
  }
5484
5484
  };
5485
5485
  }
5486
+ function selectEagerPushReceiver(ctx, targetNodeId, requiredTags) {
5487
+ const eligible = ctx.mesh.nodes.filter((node) => {
5488
+ if (isLocalControlPlaneNode(ctx, node) || !node.daemonId) return false;
5489
+ if (targetNodeId && node.id !== targetNodeId) return false;
5490
+ return (0, import_daemon_core6.nodeSatisfiesRequiredTags)(requiredTags, (0, import_daemon_core6.buildMeshNodeCapabilityTags)(node));
5491
+ });
5492
+ if (eligible.length === 0) return null;
5493
+ return eligible.find((node) => (0, import_daemon_core6.isMeshNodeHealthLaunchable)(node)) ?? eligible[0];
5494
+ }
5486
5495
  function eagerPushTaskToRemoteNodes(ctx, task, message, targetNodeId, requiredTags, coordinatorDaemonId) {
5487
5496
  const dispatchPromises = [];
5488
- for (const node of ctx.mesh.nodes) {
5489
- const isLocalNode = isLocalControlPlaneNode(ctx, node);
5490
- if (isLocalNode || !node.daemonId) continue;
5491
- if (targetNodeId && node.id !== targetNodeId) continue;
5492
- if (!(0, import_daemon_core6.nodeSatisfiesRequiredTags)(requiredTags, (0, import_daemon_core6.buildMeshNodeCapabilityTags)(node))) continue;
5497
+ const liveStatus = (0, import_daemon_core6.getQueue)(ctx.mesh.id).find((t) => t.id === task.id)?.status;
5498
+ if (liveStatus !== "pending") return dispatchPromises;
5499
+ const node = selectEagerPushReceiver(ctx, targetNodeId, requiredTags);
5500
+ if (node) {
5493
5501
  dispatchPromises.push(
5494
5502
  ipcDispatchToRemoteAgent(ctx, node, {
5495
5503
  message,