community

package
v0.0.0-...-c11c1a8 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package community provides GitHub integration for community features including discussions, issues, and collaborative workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDiscussion

func CreateDiscussion(ctx context.Context, owner, repo, category, title, body string) error

func FetchIssues

func FetchIssues(ctx context.Context, owner, repo string, issueTypes []IssueType, limit int) (map[IssueType][]Issue, error)

FetchIssues retrieves issues by label type, sorted by net vote score.

func FormatDiscussions

func FormatDiscussions(discussions []Discussion) string

func FormatIssuesByType

func FormatIssuesByType(issues map[IssueType][]Issue) string

FormatIssuesByType returns formatted strings for all issue types for the agent prompt.

func NewGitHubClient

func NewGitHubClient(ctx context.Context) *github.Client

NewGitHubClient creates an authenticated go-github client using GITHUB_TOKEN. Returns nil if the token is not set.

func PostDiscussionReply

func PostDiscussionReply(ctx context.Context, owner, repo string, discussionNumber int, body string) error

func PostReply

func PostReply(ctx context.Context, owner, repo string, issueNumber int, body string) error

PostReply posts a comment on a GitHub issue as the bot.

func SetGraphQLClientForTests

func SetGraphQLClientForTests(c *http.Client)

SetGraphQLClientForTests allows tests to inject a custom http.Client.

Types

type Discussion

type Discussion struct {
	Number     int
	Title      string
	Body       string
	Category   string
	Author     string
	URL        string
	Comments   int
	IsAnswered bool
}

func FetchDiscussions

func FetchDiscussions(ctx context.Context, owner, repo string, limit int) ([]Discussion, error)

type Issue

type Issue struct {
	Number   int
	Title    string
	Body     string
	NetVotes int // thumbsup - thumbsdown reactions
	URL      string
	Type     IssueType
}

Issue represents a community-submitted GitHub issue.

type IssueType

type IssueType string
const (
	IssueTypeInput      IssueType = "agent-input"
	IssueTypeSelf       IssueType = "agent-self"
	IssueTypeHelpWanted IssueType = "agent-help-wanted"
)

Jump to

Keyboard shortcuts

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