Documentation
¶
Overview ¶
Package pr implements AI-powered pull request description generation. It collects completed PM tasks, git diff, and git log since a base ref, then asks the configured provider to write a PR title and markdown body.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
BuildPrompt constructs the AI prompt for PR generation.
Types ¶
type PRContext ¶
type PRContext struct {
// Base is the branch or SHA used as the comparison base.
Base string
// HeadSHA is the resolved HEAD SHA at collection time.
HeadSHA string
// GitLog is the output of `git log --oneline <base>..HEAD`.
GitLog string
// GitDiff is the output of `git diff <base>..HEAD` (possibly truncated).
GitDiff string
// CompletedTasks are PM tasks with status == done, collected from the plan.
CompletedTasks []*pm.Task
// Goal is the project goal from state.
Goal string
}
PRContext holds the raw data used to generate a pull request description.
type PRResult ¶
PRResult holds the generated pull request title and body.
func Generate ¶
func Generate(ctx context.Context, prov provider.Provider, model string, timeout time.Duration, prCtx *PRContext) (*PRResult, error)
Generate calls the provider to generate a PR title and body.
func ParseResponse ¶
ParseResponse extracts the title and body from the raw provider response. It expects the format:
TITLE: <title> <markdown body>
Click to show internal directories.
Click to hide internal directories.