@adhdev/daemon-core 1.0.28-rc.1 → 1.0.28-rc.3
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 +60 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -4
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-completion-synthesis.d.ts +14 -0
- package/package.json +3 -3
- package/src/mesh/mesh-completion-synthesis.ts +85 -1
- package/src/mesh/mesh-reconcile-loop.ts +32 -0
package/dist/index.js
CHANGED
|
@@ -791,10 +791,10 @@ function readInjected(value) {
|
|
|
791
791
|
}
|
|
792
792
|
function getDaemonBuildInfo() {
|
|
793
793
|
if (cached) return cached;
|
|
794
|
-
const commit = readInjected(true ? "
|
|
795
|
-
const commitShort = readInjected(true ? "
|
|
796
|
-
const version = readInjected(true ? "1.0.28-rc.
|
|
797
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
794
|
+
const commit = readInjected(true ? "ff6245c8979ff5d300c1fa1e123cc241a3207f92" : void 0) ?? "unknown";
|
|
795
|
+
const commitShort = readInjected(true ? "ff6245c8" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
796
|
+
const version = readInjected(true ? "1.0.28-rc.3" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
797
|
+
const builtAt = readInjected(true ? "2026-07-25T04:34:49.755Z" : void 0);
|
|
798
798
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
799
799
|
return cached;
|
|
800
800
|
}
|
|
@@ -24619,6 +24619,50 @@ async function autoPruneStaleDirectDispatches(components, mesh, selfIds, localDa
|
|
|
24619
24619
|
LOG.info("MeshReconcile", `Auto-pruned ${result.prunedCount} orphaned direct dispatch record(s) for mesh ${mesh.id}`);
|
|
24620
24620
|
}
|
|
24621
24621
|
}
|
|
24622
|
+
async function pollAssignedTaskInTurnProgress(components, mesh, row) {
|
|
24623
|
+
const sessionId = readNonEmptyString(row.assignedSessionId);
|
|
24624
|
+
const nodeId = readNonEmptyString(row.assignedNodeId);
|
|
24625
|
+
if (!sessionId || !nodeId) return false;
|
|
24626
|
+
const dispatchedAtMs = Date.parse(readNonEmptyString(row.dispatchTimestamp));
|
|
24627
|
+
if (!Number.isFinite(dispatchedAtMs)) return false;
|
|
24628
|
+
const node = (mesh.nodes ?? []).find((n) => n.id === nodeId);
|
|
24629
|
+
const nodeDaemonId = readNonEmptyString(node?.daemonId);
|
|
24630
|
+
const localDaemonId = readNonEmptyString(components.statusInstanceId);
|
|
24631
|
+
const isLocalNode = !nodeDaemonId || daemonIdsEquivalent(nodeDaemonId, localDaemonId) || !!components.instanceManager.getInstance(sessionId);
|
|
24632
|
+
const providerType = readNonEmptyString(row.assignedProviderType);
|
|
24633
|
+
const readArgs = {
|
|
24634
|
+
sessionId,
|
|
24635
|
+
targetSessionId: sessionId,
|
|
24636
|
+
tailLimit: 10,
|
|
24637
|
+
...node?.workspace ? { workspace: node.workspace } : {},
|
|
24638
|
+
...providerType ? { agentType: providerType, providerType } : {}
|
|
24639
|
+
};
|
|
24640
|
+
let payload = null;
|
|
24641
|
+
try {
|
|
24642
|
+
if (isLocalNode) {
|
|
24643
|
+
const result = await components.commandHandler?.handle("read_chat", readArgs);
|
|
24644
|
+
if (result && result.success === false) return false;
|
|
24645
|
+
payload = unwrapReadChatPayload(result);
|
|
24646
|
+
} else if (components.dispatchMeshCommand) {
|
|
24647
|
+
const result = await components.dispatchMeshCommand(nodeDaemonId, "read_chat", readArgs);
|
|
24648
|
+
payload = unwrapReadChatPayload(result);
|
|
24649
|
+
if (payload && payload.success === false) return false;
|
|
24650
|
+
} else {
|
|
24651
|
+
return false;
|
|
24652
|
+
}
|
|
24653
|
+
} catch {
|
|
24654
|
+
return false;
|
|
24655
|
+
}
|
|
24656
|
+
if (!payload) return false;
|
|
24657
|
+
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
|
24658
|
+
return messages.some((msg) => {
|
|
24659
|
+
if (!msg) return false;
|
|
24660
|
+
if (msg.role === "user" || msg.role === "system") return false;
|
|
24661
|
+
const ts2 = readChatMessageTimestampMs(msg);
|
|
24662
|
+
if (typeof ts2 !== "number" || !Number.isFinite(ts2)) return false;
|
|
24663
|
+
return ts2 >= dispatchedAtMs;
|
|
24664
|
+
});
|
|
24665
|
+
}
|
|
24622
24666
|
async function pollAssignedTaskTerminalEvidence(components, mesh, row) {
|
|
24623
24667
|
const sessionId = readNonEmptyString(row.assignedSessionId);
|
|
24624
24668
|
const nodeId = readNonEmptyString(row.assignedNodeId);
|
|
@@ -25146,6 +25190,18 @@ async function recoverStrandedAssignedDispatches(components, mesh, store, localD
|
|
|
25146
25190
|
if (verdict === "GENERATING") {
|
|
25147
25191
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25148
25192
|
} else {
|
|
25193
|
+
const nativeSourceRedriveCandidate = row.assignedSessionId ? resolveLocalSessionNativeSource(components, row.assignedSessionId) === true : false;
|
|
25194
|
+
if (nativeSourceRedriveCandidate && await pollAssignedTaskInTurnProgress(components, { id: meshId, nodes: mesh.nodes }, row)) {
|
|
25195
|
+
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25196
|
+
traceMeshEventDrop("short_redrive_deferred_native_source_progress", {
|
|
25197
|
+
taskId: row.id,
|
|
25198
|
+
sessionId: row.assignedSessionId,
|
|
25199
|
+
nodeId: row.assignedNodeId,
|
|
25200
|
+
meshId,
|
|
25201
|
+
event: "agent:generating_started"
|
|
25202
|
+
}, `native_source_in_turn_progress (verdict ${verdict})`);
|
|
25203
|
+
continue;
|
|
25204
|
+
}
|
|
25149
25205
|
if (verdict === "IDLE_CONFIRMED") {
|
|
25150
25206
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25151
25207
|
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, row.assignedSessionId)) {
|