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

Function addGoal

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

Source from the content-addressed store, hash-verified

1497 const command = action.replace(/^[!$]\s*/, "").trim()
1498 if (job.safe && dangerousShell(command)) {
1499 await toast(client, `Blocked dangerous shell command in safe mode: ${command}`, "error")
1500 await appendLoopLog(directory, "blocked", { sessionID, job: job.name || job.id, command })
1501 return { startsAssistantTurn: false }
1502 }
1503 guardLoopOwnedUserMessage(sessionID)
1504 fireSdk(
1505 client,
1506 "session.shell",
1507 client.session.shell.bind(client.session),
1508 { path: { id: sessionID }, body: { command } },
1509 { path: { sessionID }, body: { command } },
1510 { sessionID, command },
1511 )
1512 return { startsAssistantTurn: true }
1513 }

Callers 1

handleCommandFunction · 0.85

Calls 8

splitFirstFunction · 0.85
statusGoalFunction · 0.85
pauseGoalFunction · 0.85
resumeGoalFunction · 0.85
clearGoalFunction · 0.85
completeGoalCommandFunction · 0.85
blockGoalCommandFunction · 0.85
addLoopFunction · 0.85

Tested by

no test coverage detected