@adhdev/daemon-standalone 0.9.82-rc.234 → 0.9.82-rc.236
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 +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +3 -1
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -37451,6 +37451,31 @@ Next step: ${nextStep}`;
|
|
|
37451
37451
|
metadataEvent: event
|
|
37452
37452
|
});
|
|
37453
37453
|
});
|
|
37454
|
+
components.instanceManager.onEvent((event) => {
|
|
37455
|
+
if (event.event !== "agent:ready" && event.event !== "agent:generating_completed") return;
|
|
37456
|
+
const instanceId = readNonEmptyString2(event.instanceId);
|
|
37457
|
+
if (!instanceId) return;
|
|
37458
|
+
const sourceInstance = components.instanceManager.getInstance(instanceId);
|
|
37459
|
+
if (!sourceInstance || sourceInstance.category !== "cli") return;
|
|
37460
|
+
const state = sourceInstance.getState();
|
|
37461
|
+
const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
|
|
37462
|
+
const coordinatorMeshId = readNonEmptyString2(settings.meshCoordinatorFor);
|
|
37463
|
+
if (!coordinatorMeshId) return;
|
|
37464
|
+
const status = readNonEmptyString2(state.status).toLowerCase();
|
|
37465
|
+
if (status !== "idle") return;
|
|
37466
|
+
try {
|
|
37467
|
+
const localDaemonId = readNonEmptyString2(loadConfig2().machineId) || void 0;
|
|
37468
|
+
const pendingEvents = drainPendingMeshCoordinatorEvents(coordinatorMeshId, localDaemonId);
|
|
37469
|
+
if (pendingEvents.length === 0) return;
|
|
37470
|
+
LOG2.info("MeshEvents", `Auto-flushing ${pendingEvents.length} pending coordinator event(s) for mesh ${coordinatorMeshId} on coordinator idle`);
|
|
37471
|
+
for (const pending of pendingEvents) {
|
|
37472
|
+
if (!pending.coordinatorMessage) continue;
|
|
37473
|
+
sourceInstance.onEvent("send_message", { input: { text: pending.coordinatorMessage, textFallback: pending.coordinatorMessage } });
|
|
37474
|
+
}
|
|
37475
|
+
} catch (e) {
|
|
37476
|
+
LOG2.warn("MeshEvents", `Failed to auto-flush pending coordinator events: ${e?.message || e}`);
|
|
37477
|
+
}
|
|
37478
|
+
});
|
|
37454
37479
|
}
|
|
37455
37480
|
var import_fs10;
|
|
37456
37481
|
var REMOTE_IDLE_SESSION_TTL_MS;
|