@adhdev/daemon-standalone 1.0.27 → 1.0.28-rc.2

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
@@ -33262,10 +33262,10 @@ var require_dist3 = __commonJS({
33262
33262
  }
33263
33263
  function getDaemonBuildInfo() {
33264
33264
  if (cached2) return cached2;
33265
- const commit = readInjected(true ? "aead21cd8e600927aabd00b2d9ae00d2ed5ac3c4" : void 0) ?? "unknown";
33266
- const commitShort = readInjected(true ? "aead21c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33267
- const version2 = readInjected(true ? "1.0.27" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33268
- const builtAt = readInjected(true ? "2026-07-24T17:22:29.662Z" : void 0);
33265
+ const commit = readInjected(true ? "ff6245c8979ff5d300c1fa1e123cc241a3207f92" : void 0) ?? "unknown";
33266
+ const commitShort = readInjected(true ? "ff6245c8" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33267
+ const version2 = readInjected(true ? "1.0.28-rc.2" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33268
+ const builtAt = readInjected(true ? "2026-07-25T04:10:50.044Z" : void 0);
33269
33269
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
33270
33270
  return cached2;
33271
33271
  }
@@ -57282,6 +57282,50 @@ ${cleanBody}`;
57282
57282
  LOG2.info("MeshReconcile", `Auto-pruned ${result.prunedCount} orphaned direct dispatch record(s) for mesh ${mesh.id}`);
57283
57283
  }
57284
57284
  }
57285
+ async function pollAssignedTaskInTurnProgress(components, mesh, row) {
57286
+ const sessionId = readNonEmptyString(row.assignedSessionId);
57287
+ const nodeId = readNonEmptyString(row.assignedNodeId);
57288
+ if (!sessionId || !nodeId) return false;
57289
+ const dispatchedAtMs = Date.parse(readNonEmptyString(row.dispatchTimestamp));
57290
+ if (!Number.isFinite(dispatchedAtMs)) return false;
57291
+ const node = (mesh.nodes ?? []).find((n) => n.id === nodeId);
57292
+ const nodeDaemonId = readNonEmptyString(node?.daemonId);
57293
+ const localDaemonId = readNonEmptyString(components.statusInstanceId);
57294
+ const isLocalNode = !nodeDaemonId || daemonIdsEquivalent(nodeDaemonId, localDaemonId) || !!components.instanceManager.getInstance(sessionId);
57295
+ const providerType = readNonEmptyString(row.assignedProviderType);
57296
+ const readArgs = {
57297
+ sessionId,
57298
+ targetSessionId: sessionId,
57299
+ tailLimit: 10,
57300
+ ...node?.workspace ? { workspace: node.workspace } : {},
57301
+ ...providerType ? { agentType: providerType, providerType } : {}
57302
+ };
57303
+ let payload = null;
57304
+ try {
57305
+ if (isLocalNode) {
57306
+ const result = await components.commandHandler?.handle("read_chat", readArgs);
57307
+ if (result && result.success === false) return false;
57308
+ payload = unwrapReadChatPayload(result);
57309
+ } else if (components.dispatchMeshCommand) {
57310
+ const result = await components.dispatchMeshCommand(nodeDaemonId, "read_chat", readArgs);
57311
+ payload = unwrapReadChatPayload(result);
57312
+ if (payload && payload.success === false) return false;
57313
+ } else {
57314
+ return false;
57315
+ }
57316
+ } catch {
57317
+ return false;
57318
+ }
57319
+ if (!payload) return false;
57320
+ const messages = Array.isArray(payload.messages) ? payload.messages : [];
57321
+ return messages.some((msg) => {
57322
+ if (!msg) return false;
57323
+ if (msg.role === "user" || msg.role === "system") return false;
57324
+ const ts2 = readChatMessageTimestampMs(msg);
57325
+ if (typeof ts2 !== "number" || !Number.isFinite(ts2)) return false;
57326
+ return ts2 >= dispatchedAtMs;
57327
+ });
57328
+ }
57285
57329
  async function pollAssignedTaskTerminalEvidence(components, mesh, row) {
57286
57330
  const sessionId = readNonEmptyString(row.assignedSessionId);
57287
57331
  const nodeId = readNonEmptyString(row.assignedNodeId);
@@ -57807,6 +57851,18 @@ ${cleanBody}`;
57807
57851
  if (verdict === "GENERATING") {
57808
57852
  deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
57809
57853
  } else {
57854
+ const nativeSourceRedriveCandidate = row.assignedSessionId ? resolveLocalSessionNativeSource(components, row.assignedSessionId) === true : false;
57855
+ if (nativeSourceRedriveCandidate && await pollAssignedTaskInTurnProgress(components, { id: meshId, nodes: mesh.nodes }, row)) {
57856
+ deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
57857
+ traceMeshEventDrop("short_redrive_deferred_native_source_progress", {
57858
+ taskId: row.id,
57859
+ sessionId: row.assignedSessionId,
57860
+ nodeId: row.assignedNodeId,
57861
+ meshId,
57862
+ event: "agent:generating_started"
57863
+ }, `native_source_in_turn_progress (verdict ${verdict})`);
57864
+ continue;
57865
+ }
57810
57866
  if (verdict === "IDLE_CONFIRMED") {
57811
57867
  deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
57812
57868
  } else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, row.assignedSessionId)) {