@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.mjs
CHANGED
|
@@ -786,10 +786,10 @@ function readInjected(value) {
|
|
|
786
786
|
}
|
|
787
787
|
function getDaemonBuildInfo() {
|
|
788
788
|
if (cached) return cached;
|
|
789
|
-
const commit = readInjected(true ? "
|
|
790
|
-
const commitShort = readInjected(true ? "
|
|
791
|
-
const version = readInjected(true ? "1.0.28-rc.
|
|
792
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
789
|
+
const commit = readInjected(true ? "ff6245c8979ff5d300c1fa1e123cc241a3207f92" : void 0) ?? "unknown";
|
|
790
|
+
const commitShort = readInjected(true ? "ff6245c8" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
791
|
+
const version = readInjected(true ? "1.0.28-rc.3" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
792
|
+
const builtAt = readInjected(true ? "2026-07-25T04:34:49.755Z" : void 0);
|
|
793
793
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
794
794
|
return cached;
|
|
795
795
|
}
|
|
@@ -24627,6 +24627,50 @@ async function autoPruneStaleDirectDispatches(components, mesh, selfIds, localDa
|
|
|
24627
24627
|
LOG.info("MeshReconcile", `Auto-pruned ${result.prunedCount} orphaned direct dispatch record(s) for mesh ${mesh.id}`);
|
|
24628
24628
|
}
|
|
24629
24629
|
}
|
|
24630
|
+
async function pollAssignedTaskInTurnProgress(components, mesh, row) {
|
|
24631
|
+
const sessionId = readNonEmptyString(row.assignedSessionId);
|
|
24632
|
+
const nodeId = readNonEmptyString(row.assignedNodeId);
|
|
24633
|
+
if (!sessionId || !nodeId) return false;
|
|
24634
|
+
const dispatchedAtMs = Date.parse(readNonEmptyString(row.dispatchTimestamp));
|
|
24635
|
+
if (!Number.isFinite(dispatchedAtMs)) return false;
|
|
24636
|
+
const node = (mesh.nodes ?? []).find((n) => n.id === nodeId);
|
|
24637
|
+
const nodeDaemonId = readNonEmptyString(node?.daemonId);
|
|
24638
|
+
const localDaemonId = readNonEmptyString(components.statusInstanceId);
|
|
24639
|
+
const isLocalNode = !nodeDaemonId || daemonIdsEquivalent(nodeDaemonId, localDaemonId) || !!components.instanceManager.getInstance(sessionId);
|
|
24640
|
+
const providerType = readNonEmptyString(row.assignedProviderType);
|
|
24641
|
+
const readArgs = {
|
|
24642
|
+
sessionId,
|
|
24643
|
+
targetSessionId: sessionId,
|
|
24644
|
+
tailLimit: 10,
|
|
24645
|
+
...node?.workspace ? { workspace: node.workspace } : {},
|
|
24646
|
+
...providerType ? { agentType: providerType, providerType } : {}
|
|
24647
|
+
};
|
|
24648
|
+
let payload = null;
|
|
24649
|
+
try {
|
|
24650
|
+
if (isLocalNode) {
|
|
24651
|
+
const result = await components.commandHandler?.handle("read_chat", readArgs);
|
|
24652
|
+
if (result && result.success === false) return false;
|
|
24653
|
+
payload = unwrapReadChatPayload(result);
|
|
24654
|
+
} else if (components.dispatchMeshCommand) {
|
|
24655
|
+
const result = await components.dispatchMeshCommand(nodeDaemonId, "read_chat", readArgs);
|
|
24656
|
+
payload = unwrapReadChatPayload(result);
|
|
24657
|
+
if (payload && payload.success === false) return false;
|
|
24658
|
+
} else {
|
|
24659
|
+
return false;
|
|
24660
|
+
}
|
|
24661
|
+
} catch {
|
|
24662
|
+
return false;
|
|
24663
|
+
}
|
|
24664
|
+
if (!payload) return false;
|
|
24665
|
+
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
|
24666
|
+
return messages.some((msg) => {
|
|
24667
|
+
if (!msg) return false;
|
|
24668
|
+
if (msg.role === "user" || msg.role === "system") return false;
|
|
24669
|
+
const ts2 = readChatMessageTimestampMs(msg);
|
|
24670
|
+
if (typeof ts2 !== "number" || !Number.isFinite(ts2)) return false;
|
|
24671
|
+
return ts2 >= dispatchedAtMs;
|
|
24672
|
+
});
|
|
24673
|
+
}
|
|
24630
24674
|
async function pollAssignedTaskTerminalEvidence(components, mesh, row) {
|
|
24631
24675
|
const sessionId = readNonEmptyString(row.assignedSessionId);
|
|
24632
24676
|
const nodeId = readNonEmptyString(row.assignedNodeId);
|
|
@@ -25154,6 +25198,18 @@ async function recoverStrandedAssignedDispatches(components, mesh, store, localD
|
|
|
25154
25198
|
if (verdict === "GENERATING") {
|
|
25155
25199
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25156
25200
|
} else {
|
|
25201
|
+
const nativeSourceRedriveCandidate = row.assignedSessionId ? resolveLocalSessionNativeSource(components, row.assignedSessionId) === true : false;
|
|
25202
|
+
if (nativeSourceRedriveCandidate && await pollAssignedTaskInTurnProgress(components, { id: meshId, nodes: mesh.nodes }, row)) {
|
|
25203
|
+
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25204
|
+
traceMeshEventDrop("short_redrive_deferred_native_source_progress", {
|
|
25205
|
+
taskId: row.id,
|
|
25206
|
+
sessionId: row.assignedSessionId,
|
|
25207
|
+
nodeId: row.assignedNodeId,
|
|
25208
|
+
meshId,
|
|
25209
|
+
event: "agent:generating_started"
|
|
25210
|
+
}, `native_source_in_turn_progress (verdict ${verdict})`);
|
|
25211
|
+
continue;
|
|
25212
|
+
}
|
|
25157
25213
|
if (verdict === "IDLE_CONFIRMED") {
|
|
25158
25214
|
deliveredUnconsumedUnknownStreak.delete(shortStreakKey);
|
|
25159
25215
|
} else if (assignedRowLiveStatusIsAwaitingApproval(mesh, row.assignedNodeId, row.assignedSessionId)) {
|