MCPcopy Create free account
hub / github.com/cursor/plugins / printSweepHeartbeat

Function printSweepHeartbeat

orchestrate/skills/orchestrate/scripts/core/loop.ts:240–260  ·  view source on GitHub ↗

* One-line liveness signal per sweep. Distinguishes "still reconciling" from * "dead" for anyone tailing stdout or polling with `AwaitShell`.

(mgr: AgentManager)

Source from the content-addressed store, hash-verified

238 * "dead" for anyone tailing stdout or polling with `AwaitShell`.
239 */
240function printSweepHeartbeat(mgr: AgentManager): void {
241 const counts = mgr.tasks.reduce<Record<string, number>>((acc, s) => {
242 acc[s.status] = (acc[s.status] ?? 0) + 1;
243 return acc;
244 }, {});
245 const order = [
246 "pending",
247 "running",
248 "handed-off",
249 "error",
250 "cancelled",
251 "pruned",
252 ];
253 const parts = order
254 .filter(status => (counts[status] ?? 0) > 0)
255 .map(status => `${status}=${counts[status]}`);
256 const andon = isAndonActive(mgr.state.andon) ? " ANDON" : "";
257 console.log(
258 `[${new Date().toISOString()}] sweep ${mgr.plan.rootSlug}: ${parts.join(" ") || "(no tasks)"}${andon}`
259 );
260}
261
262function printLoopSummary(mgr: AgentManager): void {
263 const counts = mgr.tasks.reduce<Record<string, number>>((acc, s) => {

Callers 1

runOrchestrateLoopFunction · 0.85

Calls 1

isAndonActiveFunction · 0.90

Tested by

no test coverage detected