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

Function helpLoop

src/index.js:1530–1547  ·  view source on GitHub ↗
(client, sessionID)

Source from the content-addressed store, hash-verified

1528- Do not call completion tools just to be polite; only call them when the state is real.
1529- Do not ask the user questions unless blocked; make reasonable assumptions and continue.
1530- Follow safety rules: no destructive commands, force pushes, production deploys, production database resets, or deleting user data.
1531
1532${sections.join(`
1533
1534---
1535
1536`)}`;
1537}
1538
1539// src/source/runtime/goal-runtime.js
1540function pickGoalJob(state, target = "") {
1541 const goals = (state.jobs || []).filter(isGoalJob);
1542 if (!goals.length)
1543 return;
1544 const text = String(target || "").trim();
1545 if (!text || ["active", "current", "goal"].includes(text.toLowerCase()))
1546 return goals.find((job) => job.goalStatus === "active" && job.enabled !== false) || goals[0];
1547 return goals.find((job, index) => matchJob(job, text, index));
1548}
1549function parseGoalToolText(args, fields) {
1550 const result = {};

Callers 1

handleCommandFunction · 0.85

Calls 1

sayFunction · 0.85

Tested by

no test coverage detected