@adhdev/daemon-standalone 1.0.18-rc.13 → 1.0.18-rc.14

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
@@ -30265,10 +30265,10 @@ var require_dist3 = __commonJS({
30265
30265
  }
30266
30266
  function getDaemonBuildInfo() {
30267
30267
  if (cached2) return cached2;
30268
- const commit = readInjected(true ? "2a9ab536171fcf675788ac5b41596e740046bbfa" : void 0) ?? "unknown";
30269
- const commitShort = readInjected(true ? "2a9ab536" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30270
- const version2 = readInjected(true ? "1.0.18-rc.13" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30271
- const builtAt = readInjected(true ? "2026-07-22T14:02:17.678Z" : void 0);
30268
+ const commit = readInjected(true ? "a44f4a2814c4db171a9ebb0f6fcfb0798203aebb" : void 0) ?? "unknown";
30269
+ const commitShort = readInjected(true ? "a44f4a28" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30270
+ const version2 = readInjected(true ? "1.0.18-rc.14" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30271
+ const builtAt = readInjected(true ? "2026-07-22T17:38:24.589Z" : void 0);
30272
30272
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30273
30273
  return cached2;
30274
30274
  }
@@ -52218,34 +52218,37 @@ ${cleanBody}`;
52218
52218
  if (!dispatchMeshCommand) return;
52219
52219
  const meshId = mesh.id;
52220
52220
  const pulls = candidateDaemonIds.length > 0 ? candidateDaemonIds.map((id) => ({ meshId, coordinatorDaemonId: id })) : [{ meshId }];
52221
- await Promise.allSettled(mesh.nodes.map(async (node) => {
52222
- const nodeDaemonId = readNonEmptyString(node.daemonId);
52223
- if (!nodeDaemonId) return;
52224
- if (daemonIdsEquivalent(nodeDaemonId, localDaemonId)) return;
52225
- if (daemonIdListIncludes(candidateDaemonIds, nodeDaemonId)) return;
52226
- const getPeerStatus = components.getMeshPeerConnectionStatus;
52227
- if (getPeerStatus) {
52228
- const peerSnapshot = getPeerStatus(nodeDaemonId);
52229
- if (!peerSnapshot || String(peerSnapshot.state) !== "connected") return;
52230
- }
52231
- for (const pendingEventArgs of pulls) {
52232
- let events;
52221
+ await Promise.allSettled(mesh.nodes.map((node) => pullPendingEventsFromNode(components, meshId, node, localDaemonId, candidateDaemonIds, pulls)));
52222
+ }
52223
+ async function pullPendingEventsFromNode(components, meshId, node, localDaemonId, candidateDaemonIds, pulls) {
52224
+ const dispatchMeshCommand = components.dispatchMeshCommand;
52225
+ if (!dispatchMeshCommand) return;
52226
+ const nodeDaemonId = readNonEmptyString(node.daemonId);
52227
+ if (!nodeDaemonId) return;
52228
+ if (daemonIdsEquivalent(nodeDaemonId, localDaemonId)) return;
52229
+ if (daemonIdListIncludes(candidateDaemonIds, nodeDaemonId)) return;
52230
+ const getPeerStatus = components.getMeshPeerConnectionStatus;
52231
+ if (getPeerStatus) {
52232
+ const peerSnapshot = getPeerStatus(nodeDaemonId);
52233
+ if (!peerSnapshot || String(peerSnapshot.state) !== "connected") return;
52234
+ }
52235
+ for (const pendingEventArgs of pulls) {
52236
+ let events;
52237
+ try {
52238
+ events = await dispatchMeshCommand(nodeDaemonId, "get_pending_mesh_events", pendingEventArgs);
52239
+ } catch {
52240
+ break;
52241
+ }
52242
+ const list = extractPendingEvents(events).filter((e) => readNonEmptyString(e?.meshId) === meshId);
52243
+ for (const event of list) {
52244
+ const payload = buildForwardPayloadFromPending(event);
52245
+ if (!payload.event || !payload.meshId) continue;
52233
52246
  try {
52234
- events = await dispatchMeshCommand(nodeDaemonId, "get_pending_mesh_events", pendingEventArgs);
52247
+ handleMeshForwardEvent(components, payload);
52235
52248
  } catch {
52236
- break;
52237
- }
52238
- const list = extractPendingEvents(events).filter((e) => readNonEmptyString(e?.meshId) === meshId);
52239
- for (const event of list) {
52240
- const payload = buildForwardPayloadFromPending(event);
52241
- if (!payload.event || !payload.meshId) continue;
52242
- try {
52243
- handleMeshForwardEvent(components, payload);
52244
- } catch {
52245
- }
52246
52249
  }
52247
52250
  }
52248
- }));
52251
+ }
52249
52252
  }
52250
52253
  function unwrapReadChatPayload(raw) {
52251
52254
  let cursor = raw;
@@ -53145,7 +53148,7 @@ ${cleanBody}`;
53145
53148
  return false;
53146
53149
  }
53147
53150
  }
53148
- async function recoverStrandedAssignedDispatches(components, mesh, store) {
53151
+ async function recoverStrandedAssignedDispatches(components, mesh, store, localDaemonId, selfIds = []) {
53149
53152
  const meshId = mesh.id;
53150
53153
  const assigned = getQueue(meshId, { status: ["assigned"] });
53151
53154
  if (!assigned.length) return;
@@ -53169,6 +53172,24 @@ ${cleanBody}`;
53169
53172
  updateTaskStatus(meshId, row.id, status);
53170
53173
  continue;
53171
53174
  }
53175
+ const assignedNode = row.assignedNodeId ? mesh.nodes?.find((n) => meshNodeIdMatches(n, row.assignedNodeId)) : void 0;
53176
+ if (assignedNode?.daemonId) {
53177
+ try {
53178
+ await pullPendingEventsFromNode(
53179
+ components,
53180
+ meshId,
53181
+ assignedNode,
53182
+ localDaemonId,
53183
+ selfIds,
53184
+ selfIds.length > 0 ? selfIds.map((id) => ({ meshId, coordinatorDaemonId: id })) : [{ meshId }]
53185
+ );
53186
+ } catch {
53187
+ }
53188
+ if (store.taskDeliveryConsumed(meshId, row.id)) {
53189
+ deliveredUnconsumedUnknownStreak.delete(`${meshId}::${row.id}`);
53190
+ continue;
53191
+ }
53192
+ }
53172
53193
  const shortStreakKey = `${meshId}::${row.id}`;
53173
53194
  const verdict = row.assignedSessionId ? resolveSessionBusyVerdict(components, row.assignedSessionId) : "IDLE_CONFIRMED";
53174
53195
  if (verdict === "GENERATING") {
@@ -53427,7 +53448,7 @@ ${cleanBody}`;
53427
53448
  const selfIds = resolveCoordinatorSelfIds(mesh, drainDaemonIds);
53428
53449
  if (!daemonHostsMesh(mesh, selfIds)) continue;
53429
53450
  try {
53430
- await recoverStrandedAssignedDispatches(components, mesh, store);
53451
+ await recoverStrandedAssignedDispatches(components, mesh, store, localDaemonId, selfIds);
53431
53452
  } catch (e) {
53432
53453
  LOG2.warn("MeshReconcile", `Assigned-stranded watchdog failed for mesh ${mesh.id}: ${e?.message || e}`);
53433
53454
  }