pr

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

internal/pr/pr.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveBase

func ResolveBase(explicit string) string

ResolveBase returns the base branch to diff against. If explicit is non-empty it is returned unchanged. Otherwise gh repo view is used; on any failure "main" is returned.

func Run

func Run(ctx context.Context, cfg Config) (string, error)

Run builds a prompt from git context and calls the runner once.

Types

type Config

type Config struct {
	Base   string // resolved base branch (never empty by the time Run is called)
	Diff   string
	Log    string
	Stat   string
	Runner Runner
}

Config holds all inputs for a pr run.

type Runner

type Runner interface {
	Run(ctx context.Context, prompt string, tools []string) (string, error)
}

Runner is the port for LLM calls.

type RunnerFunc

type RunnerFunc func(ctx context.Context, prompt string, tools []string) (string, error)

RunnerFunc is a function adapter for Runner.

func (RunnerFunc) Run

func (f RunnerFunc) Run(ctx context.Context, prompt string, tools []string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL