MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / OpenCodeLoopPlugin

Function OpenCodeLoopPlugin

src/index.js:1667–1682  ·  view source on GitHub ↗
({ client, directory })

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 6

logFunction · 0.85
goalToolsFunction · 0.85
handleCommandFunction · 0.85
rememberSessionFunction · 0.85
scheduleIdleWorkFunction · 0.85

Tested by

no test coverage detected