// Builds the PR prompt exactly as main's GitManager does (diff, commits, thread digest).
import { buildPrContentPrompt } from "/home/ubuntu/wt/issue-26892/packages/provider-core/src/server/textGenerationPrompts.ts";
import { execFileSync } from "node:child_process";
const repo = process.argv[2]!;
const git = (...a: string[]) => execFileSync("git", ["-C", repo, ...a], { encoding: "utf8" });
const { prompt } = buildPrContentPrompt({
  baseBranch: "main",
  headBranch: "t3/demo",
  commitSummary: git("log", "--oneline", "main..HEAD"),
  diffSummary: git("diff", "--stat", "main...HEAD"),
  diffPatch: git("diff", "main...HEAD"),
  threadContext: "Digest of the thread that made this change, oldest first.\n\nuser: Make the greeting friendlier and add a bye helper, then commit.\n\nassistant: Updated greet.ts: greet now says \"Hello, <name>!\" and added bye(). Committed as \"Friendlier greeting and add bye\".",
});
process.stdout.write(prompt + "\n\nReturn only the JSON object.");
