MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / clearGoal

Function clearGoal

src/index.js:1479–1487  ·  view source on GitHub ↗
(directory, client, sessionID, args)

Source from the content-addressed store, hash-verified

1477 const state = await readState(directory, sessionID)
1478 let count = 0
1479 state.jobs = (state.jobs || []).map((job, index) => {
1480 if (!isGoalJob(job) || !matchJob(job, target, index)) return job
1481 count++
1482 return { ...job, paused: false, enabled: true, goalStatus: job.goalStatus === "blocked" ? "active" : (job.goalStatus || "active"), lastRunAt: 0 }
1483 })
1484 await writeState(directory, sessionID, state)
1485 await toast(client, `Resumed ${count} experimental goal(s).`, count ? "success" : "warning")
1486 if (count) {
1487 await scheduleDueWork(directory, client, sessionID)
1488 scheduleIdleWork(directory, client, sessionID)
1489 }
1490}

Callers 2

addGoalFunction · 0.85
handleCommandFunction · 0.85

Calls 6

readStateFunction · 0.85
isGoalJobFunction · 0.85
matchJobFunction · 0.85
writeStateFunction · 0.85
scheduleDueWorkFunction · 0.85
toastFunction · 0.85

Tested by

no test coverage detected