({ client, directory })
| 1665 | await scheduleDueWork(directory, client, sessionID); |
| 1666 | scheduleIdleWork(directory, client, sessionID); |
| 1667 | } |
| 1668 | } |
| 1669 | async function clearGoal(directory, client, sessionID, args) { |
| 1670 | const target = String(args || "").trim(); |
| 1671 | const state = await readState2(directory, sessionID); |
| 1672 | const before = state.jobs.length; |
| 1673 | state.jobs = (state.jobs || []).filter((job, index) => !isGoalJob(job) || target && !matchJob(job, target, index)); |
| 1674 | await writeState2(directory, sessionID, state); |
| 1675 | await scheduleDueWork(directory, client, sessionID); |
| 1676 | await toast2(client, `Cleared ${before - state.jobs.length} experimental goal(s).`, before !== state.jobs.length ? "success" : "warning"); |
| 1677 | } |
| 1678 | async function completeGoalCommand(directory, client, sessionID, args) { |
| 1679 | const result = await setGoalComplete2(directory, sessionID, { summary: String(args || "").trim() || "Goal manually marked complete.", evidence: "Marked complete by /loop-goal-done.", manual: true }); |
| 1680 | await toast2(client, result.message, result.ok ? "success" : "warning"); |
| 1681 | } |
| 1682 | async function blockGoalCommand(directory, client, sessionID, args) { |
| 1683 | const result = await setGoalBlocked2(directory, sessionID, { reason: String(args || "").trim() || "Goal manually marked blocked.", needed: "User input or manual intervention." }); |
| 1684 | await toast2(client, result.message, "warning"); |
| 1685 | } |
nothing calls this directly
no test coverage detected