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

Function watchChanged

src/index.js:722–729  ·  view source on GitHub ↗
(directory, job)

Source from the content-addressed store, hash-verified

720 if (text.startsWith("/")) return "command"
721 if (text.startsWith("!") || text.startsWith("$")) return "shell"
722 return "prompt"
723}
724
725function decoratePrompt(job) {
726 const additions = []
727 if (job.progressFile) additions.push(`Use ${job.progressFile} as the main progress/TODO state file. Read it before choosing the next task and update it after work.`)
728 if (job.lastVerifyFailure) additions.push("Previous verify command failed. Fix this before moving on. Failure summary: " + String(job.lastVerifyFailure).slice(0, 1200))
729 if (job.askNever) additions.push("Do not ask the user questions. Make reasonable assumptions and continue. Only write a short BLOCKED note if truly blocked.")
730 if (job.safe) additions.push("Safety rules: do not run destructive commands such as git reset, git clean, rm -rf, del /s, rmdir /s, force push, production deploys, production migrations, terraform destroy, or deleting user data. If such an action seems needed, write a BLOCKED note instead.")
731 if (job.batch > 0) additions.push(`Batch rule: in this run, work on at most ${job.batch} unfinished TODO item(s). Mark completed items with [x].`)
732 if (job.quiet) additions.push("Keep replies short. Summarize only what changed, tests run, and next step.")

Callers 1

maybeRunDueJobsFunction · 0.85

Calls 1

snapshotPathsFunction · 0.85

Tested by

no test coverage detected