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

Function run

scripts/loopd.mjs:40–51  ·  view source on GitHub ↗
(command, cwd)

Source from the content-addressed store, hash-verified

38 if (unit.startsWith("s")) return n * 1000
39 if (unit.startsWith("m")) return n * 60_000
40 if (unit.startsWith("h")) return n * 3_600_000
41 if (unit.startsWith("d")) return n * 86_400_000
42
43 return n
44}
45
46function parseMaxRuns(value) {
47 const text = String(value ?? "0").trim()
48 if (!/^\d+$/.test(text)) throw new Error(`Invalid --max-runs value: ${value}`)
49 const parsed = Number(text)
50 if (!Number.isSafeInteger(parsed)) throw new Error(`Invalid --max-runs value: ${value}`)
51 return parsed
52}
53
54function validateProject(project) {

Callers 1

daemonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected