@adhdev/daemon-standalone 1.0.39-rc.5 → 1.0.39-rc.7
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 +77 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/vendor/mcp-server/index.js +77 -7
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -36528,10 +36528,10 @@ var require_dist3 = __commonJS({
|
|
|
36528
36528
|
}
|
|
36529
36529
|
function getDaemonBuildInfo() {
|
|
36530
36530
|
if (cached2) return cached2;
|
|
36531
|
-
const commit = readInjected(true ? "
|
|
36532
|
-
const commitShort = readInjected(true ? "
|
|
36533
|
-
const version2 = readInjected(true ? "1.0.39-rc.
|
|
36534
|
-
const builtAt = readInjected(true ? "2026-08-
|
|
36531
|
+
const commit = readInjected(true ? "2e7dae960e88d61879ec103eaa86df36e1671d8e" : void 0) ?? "unknown";
|
|
36532
|
+
const commitShort = readInjected(true ? "2e7dae96" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
36533
|
+
const version2 = readInjected(true ? "1.0.39-rc.7" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
36534
|
+
const builtAt = readInjected(true ? "2026-08-08T01:41:54.555Z" : void 0);
|
|
36535
36535
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
36536
36536
|
return cached2;
|
|
36537
36537
|
}
|
|
@@ -51162,7 +51162,8 @@ Valid status values: \`completed\` | \`failed\` | \`blocked\` | \`partial\`.`;
|
|
|
51162
51162
|
"task_approval_needed",
|
|
51163
51163
|
"task_question_pending",
|
|
51164
51164
|
"p2p_dispatch_failed",
|
|
51165
|
-
"dispatch_duplicate_rebound"
|
|
51165
|
+
"dispatch_duplicate_rebound",
|
|
51166
|
+
"queue_hold_hard_deadline"
|
|
51166
51167
|
]);
|
|
51167
51168
|
LEDGER_DIR_NAME = "mesh-ledger";
|
|
51168
51169
|
MAX_FILE_SIZE_BYTES = 10 * 1024 * 1024;
|
|
@@ -67343,6 +67344,40 @@ ${cleanBody}`;
|
|
|
67343
67344
|
return false;
|
|
67344
67345
|
}
|
|
67345
67346
|
}
|
|
67347
|
+
function queueHoldHardDeadlineExceeded(meshId, row, gate, dispatchedAtMs, nowMs, detail) {
|
|
67348
|
+
const heldMs = nowMs - dispatchedAtMs;
|
|
67349
|
+
if (!Number.isFinite(heldMs) || heldMs < QUEUE_HOLD_HARD_DEADLINE_MS) return false;
|
|
67350
|
+
const auditKey = `${meshId}::${row.id}::${gate}`;
|
|
67351
|
+
if (queueHoldHardDeadlineAudited.has(auditKey)) return true;
|
|
67352
|
+
queueHoldHardDeadlineAudited.add(auditKey);
|
|
67353
|
+
const heldMin = Math.round(heldMs / 6e4);
|
|
67354
|
+
LOG2.warn("MeshReconcile", `Queue-hold HARD DEADLINE exceeded for task ${row.id} on mesh ${meshId}: gate '${gate}'${detail ? ` (${detail})` : ""} held the row 'assigned' for ${heldMin}min (> ${Math.round(QUEUE_HOLD_HARD_DEADLINE_MS / 6e4)}min ceiling) on node=${row.assignedNodeId ?? "?"} session=${row.assignedSessionId ?? "?"} \u2014 the hold signal is presumed stale (a lost queue-status write), forcing the bounded reclaim so the node can claim again`);
|
|
67355
|
+
try {
|
|
67356
|
+
appendLedgerEntry(meshId, {
|
|
67357
|
+
kind: "queue_hold_hard_deadline",
|
|
67358
|
+
nodeId: row.assignedNodeId,
|
|
67359
|
+
sessionId: row.assignedSessionId,
|
|
67360
|
+
providerType: row.assignedProviderType,
|
|
67361
|
+
payload: {
|
|
67362
|
+
taskId: row.id,
|
|
67363
|
+
reason: "queue_hold_hard_deadline",
|
|
67364
|
+
gate,
|
|
67365
|
+
heldMs,
|
|
67366
|
+
ceilingMs: QUEUE_HOLD_HARD_DEADLINE_MS,
|
|
67367
|
+
...detail ? { detail } : {}
|
|
67368
|
+
}
|
|
67369
|
+
});
|
|
67370
|
+
} catch {
|
|
67371
|
+
}
|
|
67372
|
+
traceMeshEventStage("queue_hold_hard_deadline", {
|
|
67373
|
+
taskId: row.id,
|
|
67374
|
+
sessionId: row.assignedSessionId,
|
|
67375
|
+
nodeId: row.assignedNodeId,
|
|
67376
|
+
meshId,
|
|
67377
|
+
event: "agent:generating_completed"
|
|
67378
|
+
}, `${gate} held ${heldMin}min > ceiling \u2014 forcing reclaim`);
|
|
67379
|
+
return true;
|
|
67380
|
+
}
|
|
67346
67381
|
function resolveAssignedTranscriptProfile(components, row) {
|
|
67347
67382
|
const stamped = row.assignedTranscriptProfile;
|
|
67348
67383
|
if (stamped && typeof stamped === "object" && typeof stamped.emitsPtyTurnEvents === "boolean") {
|
|
@@ -67532,6 +67567,11 @@ ${cleanBody}`;
|
|
|
67532
67567
|
for (const key2 of [...assignedIdleFinalAssistantSince.keys()]) {
|
|
67533
67568
|
if (key2.startsWith(meshKeyPrefix) && !assignedKeys.has(key2)) assignedIdleFinalAssistantSince.delete(key2);
|
|
67534
67569
|
}
|
|
67570
|
+
for (const key2 of [...queueHoldHardDeadlineAudited]) {
|
|
67571
|
+
if (!key2.startsWith(meshKeyPrefix)) continue;
|
|
67572
|
+
const taskKey = key2.slice(0, key2.lastIndexOf("::"));
|
|
67573
|
+
if (!assignedKeys.has(taskKey)) queueHoldHardDeadlineAudited.delete(key2);
|
|
67574
|
+
}
|
|
67535
67575
|
for (const row of assigned) {
|
|
67536
67576
|
restampReboundMeshWorkerAssignment(components, store, meshId, row);
|
|
67537
67577
|
const dispatchedAtMs = Date.parse(row.dispatchTimestamp ?? "");
|
|
@@ -67680,7 +67720,7 @@ ${cleanBody}`;
|
|
|
67680
67720
|
}
|
|
67681
67721
|
if (verdict === "IDLE_CONFIRMED") {
|
|
67682
67722
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
67683
|
-
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, evidenceSessionId)) {
|
|
67723
|
+
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, evidenceSessionId) && !queueHoldHardDeadlineExceeded(meshId, row, "live_awaiting_approval", dispatchedAtMs, nowMs, "short_redrive")) {
|
|
67684
67724
|
traceMeshEventDrop("short_redrive_deferred_awaiting_approval", {
|
|
67685
67725
|
taskId: row.id,
|
|
67686
67726
|
sessionId: row.assignedSessionId,
|
|
@@ -67712,7 +67752,15 @@ ${cleanBody}`;
|
|
|
67712
67752
|
// the bounded UNKNOWN grace just exhausted above
|
|
67713
67753
|
nowMs
|
|
67714
67754
|
});
|
|
67715
|
-
|
|
67755
|
+
const suspensionHoldExpired = suspensionGate.kind === "blocked" && queueHoldHardDeadlineExceeded(
|
|
67756
|
+
meshId,
|
|
67757
|
+
row,
|
|
67758
|
+
"held_suspension",
|
|
67759
|
+
dispatchedAtMs,
|
|
67760
|
+
nowMs,
|
|
67761
|
+
`short_redrive; stages ${suspensionGate.stages.join("/")}`
|
|
67762
|
+
);
|
|
67763
|
+
if (!suspensionHoldExpired && (suspensionGate.kind === "recovered" || suspensionGate.kind === "blocked")) {
|
|
67716
67764
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
67717
67765
|
traceMeshEventDrop(suspensionGate.kind === "recovered" ? "suspension_consumed_recovered" : "redrive_blocked_by_suspension", {
|
|
67718
67766
|
taskId: row.id,
|
|
@@ -67818,7 +67866,7 @@ ${cleanBody}`;
|
|
|
67818
67866
|
if (verdict === "IDLE_CONFIRMED") {
|
|
67819
67867
|
deliveredNoTurnUnknownStreak.delete(streakKey);
|
|
67820
67868
|
reclaimReason = "delivered_no_turn_deadline";
|
|
67821
|
-
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, evidenceSessionId)) {
|
|
67869
|
+
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, evidenceSessionId) && !queueHoldHardDeadlineExceeded(meshId, row, "live_awaiting_approval", dispatchedAtMs, nowMs, "delivered_no_turn")) {
|
|
67822
67870
|
traceMeshEventDrop("reclaim_deferred_awaiting_approval", {
|
|
67823
67871
|
taskId: row.id,
|
|
67824
67872
|
sessionId: row.assignedSessionId,
|
|
@@ -67851,7 +67899,15 @@ ${cleanBody}`;
|
|
|
67851
67899
|
// the bounded UNKNOWN grace just exhausted above
|
|
67852
67900
|
nowMs
|
|
67853
67901
|
});
|
|
67854
|
-
|
|
67902
|
+
const suspensionHoldExpired = suspensionGate.kind === "blocked" && queueHoldHardDeadlineExceeded(
|
|
67903
|
+
meshId,
|
|
67904
|
+
row,
|
|
67905
|
+
"held_suspension",
|
|
67906
|
+
dispatchedAtMs,
|
|
67907
|
+
nowMs,
|
|
67908
|
+
`delivered_no_turn; stages ${suspensionGate.stages.join("/")}`
|
|
67909
|
+
);
|
|
67910
|
+
if (!suspensionHoldExpired && (suspensionGate.kind === "recovered" || suspensionGate.kind === "blocked")) {
|
|
67855
67911
|
deliveredNoTurnUnknownStreak.delete(streakKey);
|
|
67856
67912
|
traceMeshEventDrop(suspensionGate.kind === "recovered" ? "suspension_consumed_recovered" : "redrive_blocked_by_suspension", {
|
|
67857
67913
|
taskId: row.id,
|
|
@@ -67922,7 +67978,14 @@ ${cleanBody}`;
|
|
|
67922
67978
|
}
|
|
67923
67979
|
})();
|
|
67924
67980
|
const attemptStage = readNonEmptyString(currentAttempt?.stage);
|
|
67925
|
-
if (currentAttempt && !currentAttempt.terminalOutcome && (attemptStage === "generating" || attemptStage === "waiting_approval" || attemptStage === "waiting_choice" || attemptStage === "finalizing")
|
|
67981
|
+
if (currentAttempt && !currentAttempt.terminalOutcome && (attemptStage === "generating" || attemptStage === "waiting_approval" || attemptStage === "waiting_choice" || attemptStage === "finalizing") && !queueHoldHardDeadlineExceeded(
|
|
67982
|
+
meshId,
|
|
67983
|
+
row,
|
|
67984
|
+
"active_attempt_stage",
|
|
67985
|
+
dispatchedAtMs,
|
|
67986
|
+
nowMs,
|
|
67987
|
+
`attempt ${currentAttempt.attemptId} stage ${attemptStage}`
|
|
67988
|
+
)) {
|
|
67926
67989
|
deliveredNoTurnUnknownStreak.delete(streakKey);
|
|
67927
67990
|
noteRedriveBlocked("active_attempt_stage");
|
|
67928
67991
|
traceMeshEventDrop("redrive_blocked_active_attempt", {
|
|
@@ -68588,6 +68651,8 @@ ${cleanBody}`;
|
|
|
68588
68651
|
var NATIVE_SOURCE_ACTIVITY_STALE_MS;
|
|
68589
68652
|
var ASSIGNED_DELIVERED_UNCONSUMED_REDRIVE_MS;
|
|
68590
68653
|
var RECLAIM_UNKNOWN_GRACE_TICKS;
|
|
68654
|
+
var QUEUE_HOLD_HARD_DEADLINE_MS;
|
|
68655
|
+
var queueHoldHardDeadlineAudited;
|
|
68591
68656
|
var deliveredNoTurnUnknownStreak;
|
|
68592
68657
|
var deliveredUnconsumedUnknownStreak;
|
|
68593
68658
|
var ASSIGNED_IDLE_TRANSCRIPT_COMPLETE_MS;
|
|
@@ -68641,6 +68706,8 @@ ${cleanBody}`;
|
|
|
68641
68706
|
NATIVE_SOURCE_ACTIVITY_STALE_MS = 10 * 6e4;
|
|
68642
68707
|
ASSIGNED_DELIVERED_UNCONSUMED_REDRIVE_MS = 25e3;
|
|
68643
68708
|
RECLAIM_UNKNOWN_GRACE_TICKS = 3;
|
|
68709
|
+
QUEUE_HOLD_HARD_DEADLINE_MS = 90 * 6e4;
|
|
68710
|
+
queueHoldHardDeadlineAudited = /* @__PURE__ */ new Set();
|
|
68644
68711
|
deliveredNoTurnUnknownStreak = /* @__PURE__ */ new Map();
|
|
68645
68712
|
deliveredUnconsumedUnknownStreak = /* @__PURE__ */ new Map();
|
|
68646
68713
|
ASSIGNED_IDLE_TRANSCRIPT_COMPLETE_MS = 8e3;
|