Documentation
¶
Overview ¶
Package diffreview is the service behind agents' reviews of a hive session's branch diff. Any agent writes one, through the hive CLI or Hive Desktop; the desktop shows it inline in the session's Diff view.
Index ¶
- Variables
- type Changes
- type CommentInput
- type Commits
- type PutInput
- type Service
- func (s *Service) Clear(ctx context.Context, sessionID, author string) (int, error)
- func (s *Service) Dismiss(ctx context.Context, commentID string) error
- func (s *Service) DismissReview(ctx context.Context, reviewID string) error
- func (s *Service) Fingerprint(ctx context.Context) (review.DiffReviewFingerprint, error)
- func (s *Service) List(ctx context.Context, sessionID string) ([]review.DiffReview, error)
- func (s *Service) Put(ctx context.Context, in PutInput) (review.DiffReview, error)
- type Sessions
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("invalid diff review")
ErrInvalid marks a review the service refuses: the message says what to fix.
Functions ¶
This section is empty.
Types ¶
type CommentInput ¶
type CommentInput struct {
Kind review.DiffCommentKind
Path string
StartSide review.DiffSide
StartLine int
EndSide review.DiffSide
EndLine int
Text string
Severity review.Severity
}
CommentInput is one comment as an agent writes it. A comment on rows names the first and last line, each on a side: additions numbers lines as the branch has them now, deletions as the base had them. The sides default to additions and EndLine to StartLine. Kind file comments on the whole file and takes no lines.
type PutInput ¶
type PutInput struct {
SessionID string
Author string
Agent string
Summary string
Comments []CommentInput
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Clear ¶
Clear removes the session's reviews: every one, or only author's when author is set. It returns how many it removed.
func (*Service) DismissReview ¶
DismissReview removes one review and its comments.