@adhdev/daemon-standalone 0.9.82-rc.388 → 0.9.82-rc.389
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 +153 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +18 -5
- package/vendor/mcp-server/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -3901,6 +3901,14 @@ async function meshReviewInbox(ctx, args = {}) {
|
|
|
3901
3901
|
}
|
|
3902
3902
|
|
|
3903
3903
|
// src/tools/mesh-tools-session.ts
|
|
3904
|
+
function computeIdleDispatchAckRisk(sessionWasIdle, dispatchPreRecorded, sessionId) {
|
|
3905
|
+
if (!sessionWasIdle || dispatchPreRecorded) return {};
|
|
3906
|
+
return {
|
|
3907
|
+
dispatchAcknowledgementRisk: true,
|
|
3908
|
+
dispatchAcknowledgementRiskReason: "idle_dispatch_prerecord_failed",
|
|
3909
|
+
dispatchAcknowledgementNote: `Session '${sessionId}' was idle at dispatch time and the dispatch row could not be pre-recorded, so its completion may be deduplicated as a prior turn and lost. Use mesh_status to verify; if the session remains idle or the completion never lands, launch a fresh session and retry.`
|
|
3910
|
+
};
|
|
3911
|
+
}
|
|
3904
3912
|
async function meshPruneStaleDirect(ctx, args = {}) {
|
|
3905
3913
|
await refreshMeshFromDaemon(ctx);
|
|
3906
3914
|
const execute = args.execute === true && args.dry_run !== true;
|
|
@@ -4245,6 +4253,11 @@ async function meshSendTask(ctx, args) {
|
|
|
4245
4253
|
dispatchedToIdleSession: sessionWasIdle,
|
|
4246
4254
|
dispatchedAt
|
|
4247
4255
|
});
|
|
4256
|
+
let dispatchPreRecorded = false;
|
|
4257
|
+
try {
|
|
4258
|
+
dispatchPreRecorded = (0, import_daemon_core3.getActiveDirectDispatches)(ctx.mesh.id).some((d) => d.taskId === taskId);
|
|
4259
|
+
} catch {
|
|
4260
|
+
}
|
|
4248
4261
|
const dispatchResult = await commandForNode(ctx, node, "agent_command", {
|
|
4249
4262
|
targetSessionId: args.session_id,
|
|
4250
4263
|
agentType: resolvedProviderType,
|
|
@@ -4267,6 +4280,7 @@ async function meshSendTask(ctx, args) {
|
|
|
4267
4280
|
(0, import_daemon_core3.deleteDirectDispatchesByTaskId)(ctx.mesh.id, [taskId]);
|
|
4268
4281
|
} catch {
|
|
4269
4282
|
}
|
|
4283
|
+
dispatchPreRecorded = false;
|
|
4270
4284
|
const source = dispatchPayload?.success === false ? dispatchPayload : dispatchResult;
|
|
4271
4285
|
return JSON.stringify({
|
|
4272
4286
|
...source && typeof source === "object" ? source : {},
|
|
@@ -4316,11 +4330,10 @@ async function meshSendTask(ctx, args) {
|
|
|
4316
4330
|
providerType: resolvedProviderType,
|
|
4317
4331
|
nodeId: args.node_id,
|
|
4318
4332
|
sessionId: args.session_id,
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
} : {}
|
|
4333
|
+
// DISPATCH-ACK-RISK-STALE: only warn on a GENUINE residual loss risk — an idle
|
|
4334
|
+
// session whose dispatch row did NOT survive pre-record. A successfully
|
|
4335
|
+
// pre-recorded idle dispatch (the NOTIF-DROP / CANON-A path) is not at risk.
|
|
4336
|
+
...computeIdleDispatchAckRisk(sessionWasIdle, dispatchPreRecorded, args.session_id)
|
|
4324
4337
|
});
|
|
4325
4338
|
}
|
|
4326
4339
|
const task = (0, import_daemon_core3.enqueueTask)(ctx.mesh.id, args.message, {
|