MCPcopy Create free account
hub / github.com/SethGammon/Citadel / updateLoop

Function updateLoop

core/loops/registry.js:57–68  ·  view source on GitHub ↗
(projectRoot, id, patch = {}, options = {})

Source from the content-addressed store, hash-verified

55}
56
57function updateLoop(projectRoot, id, patch = {}, options = {}) {
58 const current = readLoop(projectRoot, id);
59 if (!current) throw new Error(`Loop not found: ${id}`);
60 const updated = {
61 ...current,
62 ...patch,
63 status: patch.status ? normalizeStatus(patch.status) : current.status,
64 updatedAt: nowIso(options),
65 };
66 writeJson(loopPath(projectRoot, id), updated);
67 return updated;
68}
69
70function appendLoopRun(projectRoot, id, run = {}, options = {}) {
71 const current = readLoop(projectRoot, id);

Callers 1

stopLoopFunction · 0.85

Calls 5

readLoopFunction · 0.85
loopPathFunction · 0.85
normalizeStatusFunction · 0.70
nowIsoFunction · 0.70
writeJsonFunction · 0.70

Tested by

no test coverage detected