import { step } from "terse-sdk"import { query as claudeCode } from "@anthropic-ai/claude-agent-sdk" const github = new Octokit({ auth: process.env.GITHUB_TOKEN }) async function fixAndTest(prompt: string): Promise<void> { for await (const _ of claudeCode({ prompt, options: AGENT })) {}} createJob({ name: "Issue to pull request", triggers: [Triggers.github.onIssueOpened({ repo: REPO })], onTrigger: async ({ issue }) => { await step($`git clone ${REPO_URL} ${WORKDIR}`) await step(fixAndTest(`Fix and test: ${issue.title}`)) await sleep("2d") await step($({ cwd: WORKDIR })`git push origin ${PUSH_REF}`) return step(github.rest.pulls.create({ ...PR, head: BRANCH, title: issue.title })) }})