Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PRStateHash ¶
PRStateHash produces a stable dedup hash over one or more PRDetails. Comments are keyed "id:body" (edits are detected), CI checks by "name:conclusion". Both are sorted before hashing so insertion order never causes false positives.
Types ¶
type CICheck ¶
type CICheck struct {
Name string
Status string // "queued", "in_progress", "completed"
Conclusion string // "success", "failure", "neutral", "cancelled", "skipped", "timed_out", ""
// CheckRunID is the provider-specific ID used to fetch logs (GitHub check run ID).
CheckRunID int64
}
CICheck is a single CI check run or commit status.
type Client ¶
type Client interface {
GetPRDetails(ctx context.Context, prURL string) (*PRDetails, error)
// GetCILogs fetches the log output for a single failed check run.
// prURL is used to resolve owner/repo; checkRunID is from CICheck.CheckRunID.
GetCILogs(ctx context.Context, prURL string, checkRunID int64) (string, error)
// ReactToComment adds a reaction emoji to a PR comment.
// reactableID is in the format "<type>:<numericID>" (from PRComment.ReactableID()).
ReactToComment(ctx context.Context, prURL string, reactableID string, state CommentReactState) error
}
Client fetches live PR state directly from the SCM provider.
type CommentReactState ¶
type CommentReactState string
CommentReactState is the agent's work state conveyed as a GitHub reaction.
const ( // CommentReactStateWorking maps to (eyes) — agent is looking at it. CommentReactStateWorking CommentReactState = "working" // CommentReactStateComplete maps to (+1) — agent finished. CommentReactStateComplete CommentReactState = "complete" )
type PRComment ¶
type PRComment struct {
// ID is the numeric provider comment ID
ID string
// Type distinguishes top level issue comments from inline review comments, which have separate reaction endpoints in GitHub's API.
// Used to route react API calls to the correct endpoint.
Type PRCommentType
Author string
Body string
CreatedAt time.Time
}
PRComment is a single review or issue comment on the PR.
func (PRComment) ReactableID ¶
ReactableID returns a composite key that encodes both the comment type and numeric ID e.g. "issue:123456" or "review:789012". This is the value the agent should pass to the reactToComment MCP tool.
type PRCommentType ¶
type PRCommentType string
PRCommentType distinguishes top-level issue comments from inline review comments.
const ( PRCommentTypeIssue PRCommentType = "issue" PRCommentTypeReview PRCommentType = "review" )
type PRDetails ¶
type PRDetails struct {
Title string
Body string
HeadRef string // source branch of the PR (e.g. "feat/my-branch")
State PRState // PRStateOpen, PRStateClosed, PRStateMerged
Comments []PRComment
CIChecks []CICheck
}
PRDetails is the live state of a pull request fetched directly from the SCM provider.