@adhdev/daemon-standalone 0.9.77-rc.30 → 0.9.77-rc.31

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 CHANGED
@@ -32202,6 +32202,7 @@ Follow these recovery rules:
32202
32202
  message,
32203
32203
  status: "pending",
32204
32204
  targetNodeId: opts?.targetNodeId,
32205
+ targetSessionId: opts?.targetSessionId,
32205
32206
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
32206
32207
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
32207
32208
  };
@@ -32219,9 +32220,12 @@ Follow these recovery rules:
32219
32220
  }
32220
32221
  function claimNextTask(meshId, nodeId, sessionId) {
32221
32222
  const queue = readQueue(meshId);
32222
- let targetIdx = queue.findIndex((q2) => q2.status === "pending" && q2.targetNodeId === nodeId);
32223
+ let targetIdx = queue.findIndex((q2) => q2.status === "pending" && q2.targetSessionId === sessionId);
32223
32224
  if (targetIdx === -1) {
32224
- targetIdx = queue.findIndex((q2) => q2.status === "pending" && !q2.targetNodeId);
32225
+ targetIdx = queue.findIndex((q2) => q2.status === "pending" && q2.targetNodeId === nodeId && !q2.targetSessionId);
32226
+ }
32227
+ if (targetIdx === -1) {
32228
+ targetIdx = queue.findIndex((q2) => q2.status === "pending" && !q2.targetNodeId && !q2.targetSessionId);
32225
32229
  }
32226
32230
  if (targetIdx === -1) return null;
32227
32231
  const entry = queue[targetIdx];