github

package
v0.0.0-...-ec8e4af Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 27 Imported by: 0

README

GitHub Tools (components/tool/github)

Eino tools for interacting with GitHub repositories, issues, pull requests, releases, branches, and webhooks.

Uses go-github (v71) for the GitHub REST API and go-git (v5) for local clone/branch operations.

Libraries

Library Purpose
github.com/google/go-github/v71 GitHub REST API (issues, PRs, releases, repos, webhooks, search)
github.com/go-git/go-git/v5 Local clone, branch creation

Configuration

configs := github.Configs{
    "default": github.Config{
        Token:    os.Getenv("GITHUB_TOKEN"),
        CloneDir: "/tmp/github-work",   // fixed at creation, NOT chosen by the LLM
        BaseURL:  "",                   // empty = github.com; set for GHES
    },
}

CloneDir is the base directory for local clones. The LLM cannot pick an arbitrary path — clones always go under <CloneDir>/<owner>/<repo>.

Tools

Read Tools
Tool Description
github_issue_list List issues in a repository
github_issue_get Get issue details
github_pr_list List pull requests in a repository
github_pr_get Get pull request details
github_org_repo_list List repositories in an organization
github_repo_search Search repositories by query
Write Tools
Tool Description
github_repo_clone Clone a repository to the local filesystem
github_branch_create Create a branch (local via go-git, or remote via API)
github_release_create Create a release (with optional tag)
github_issue_create Create an issue
github_issue_comment Add a comment to an issue
github_pr_create Create a pull request
github_pr_comment Add a comment to a pull request
github_pr_review Submit a review (APPROVE/REQUEST_CHANGES/COMMENT)
github_pr_suggest_change Post an inline code suggestion
github_pr_request_reviewers Request reviewers on a PR
github_repo_settings_update Update repository settings
github_webhook_upsert Create or update a repository webhook

Usage

// Create all tools
tools, err := github.NewAllTools(ctx, configs)

// Create read-only tools only
readTools, err := github.NewReadOnlyTools(ctx, configs)

// Create with safety middleware
tools, mw, err := github.NewAllToolsWithSafety(ctx, configs, &safety.Config{
    Policy: myCELPolicy,
})

Security

  • Path safety: Clone target always under Config.CloneDir; owner/repo segments are sanitized.
  • SSRF protection: Webhook URLs must use HTTPS; loopback/private/metadata IPs are blocked.
  • Secret redaction: GitHub tokens are redacted from all tool output.
  • Confirmation gating: All write tools require Confirmed=true (or use DryRun to preview).
  • Timeouts: Every API call bounded by Config.Timeout (default 30s).
  • Pagination caps: List/search tools cap results to prevent resource exhaustion.

Prompts

This package does not include system prompts. For the PR-reviewer persona, use:

prReviewPrompt := prompt.NewPullRequestReview(projectRules)

from components/prompt which is designed to work with these GitHub tools (github_pr_get, github_pr_review, github_pr_suggest_change, github_pr_request_reviewers).

Alternative: MCP

This repository also supports the MCP protocol via components/tool/mcp. Users running an MCP-capable host can use the official GitHub MCP server (github/github-mcp-server) as an alternative for API-only operations. The native tools in this package provide additional capabilities (local clone/branch via go-git) and tighter security controls.

Documentation

Overview

Package github provides eino tools that interact with GitHub repositories, issues, pull requests, releases, branches, and webhooks. It wraps the go-github REST client for API operations and go-git for local clone/branch operations.

Usage

configs := github.Configs{
    "default": github.Config{
        Token:    os.Getenv("GITHUB_TOKEN"),
        CloneDir: "/tmp/github",
    },
}
tools, err := github.NewAllTools(ctx, configs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildClients

func BuildClients(ctx context.Context, configs Configs) (map[string]*github.Client, error)

BuildClients creates GitHub clients for all configurations present in the Configs map. It returns a map of instance names to their corresponding clients, or an error if any client creation fails.

func Check

func Check(ctx context.Context, configs Configs) checkup.Results

func ExtractWriteToolNames

func ExtractWriteToolNames(ctx context.Context, configs Configs) ([]string, error)

ExtractWriteToolNames creates all write tools from the given configs and extracts their tool names via Info().

func NewAllTools

func NewAllTools(ctx context.Context, configs Configs) ([]tool.InvokableTool, error)

NewAllTools creates all GitHub tools (read + write) for the given configurations and returns them as a flat slice ready to be registered with an eino ToolsNode.

func NewAllToolsWithSafety

func NewAllToolsWithSafety(ctx context.Context, configs Configs, safetyCfg *safety.Config) ([]tool.InvokableTool, *safety.Middleware, error)

NewAllToolsWithSafety creates all GitHub tools (read + write) and returns them together with a pre-configured safety middleware.

func NewClient

func NewClient(ctx context.Context, cfg *Config) (*github.Client, error)

NewClient creates a new GitHub API client using the provided configuration.

func NewReadOnlyTools

func NewReadOnlyTools(ctx context.Context, configs Configs) ([]tool.InvokableTool, error)

NewReadOnlyTools creates only the read-only GitHub tools (list + get + search) and returns them as a flat slice ready to be registered with an eino ToolsNode.

func WriteToolNames

func WriteToolNames() []string

WriteToolNames returns the tool names of all GitHub write tools.

Types

type BranchCreateParams

type BranchCreateParams struct {
	Instance   string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner      string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo       string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	BranchName string `json:"branchName" validate:"required" jsonschema:"(required) Name of the branch to create."`
	BaseBranch string `json:"baseBranch,omitempty" jsonschema:"(optional) Base branch or commit SHA. Defaults to the default branch."`
	Remote     bool   `json:"remote,omitempty" jsonschema:"(optional) If true, create the branch remotely via the GitHub API instead of locally."`
	DryRun     bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the branch creation without making changes."`
	Confirmed  bool   `` /* 161-byte string literal not displayed */
}

type BranchCreateTool

type BranchCreateTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewBranchCreateTool

func NewBranchCreateTool(ctx context.Context, configs Configs) (*BranchCreateTool, error)

func (*BranchCreateTool) Invoke

func (t *BranchCreateTool) Invoke(ctx context.Context, params *BranchCreateParams) (result string, err error)

type Config

type Config struct {
	// Token is the GitHub PAT or App token. Required. REDACT in all output/logs.
	Token string `validate:"required" jsonschema:"description=GitHub token (PAT or App installation token)"`

	// BaseURL for GitHub Enterprise Server. Empty = github.com.
	BaseURL string `validate:"omitempty,url" jsonschema:"description=GitHub Enterprise base URL (empty for github.com)"`

	// UploadURL for GHES uploads (releases assets). Empty = derive from BaseURL.
	UploadURL string `validate:"omitempty,url" jsonschema:"description=GHES upload URL"`

	// CloneDir is the temp folder root where repos are cloned. Set at tool creation
	// time, NOT chosen by the LLM. Required for clone/branch tools.
	CloneDir string `` /* 132-byte string literal not displayed */

	// Timeout for API calls. Defaulted; validated as gte=1s.
	Timeout time.Duration `validate:"omitempty,gte=1000000000" jsonschema:"description=Per-request timeout"`

	// TLSSkipVerify disables TLS certificate verification. Useful for GitHub Enterprise
	// Server instances with self-signed certificates.
	TLSSkipVerify bool `validate:"omitempty" jsonschema:"description=Skip TLS certificate verification"`
}

Config represents the configuration for a GitHub instance.

type Configs

type Configs map[string]Config

Configs maps a named GitHub instance to its configuration.

func (Configs) GetConfig

func (c Configs) GetConfig(instanceName string) Config

GetConfig retrieves the configuration for a given instance name.

func (Configs) GetInstanceNames

func (c Configs) GetInstanceNames() []string

GetInstanceNames returns a slice of all instance names present in the Configs map.

type IssueCommentParams

type IssueCommentParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number    int    `json:"number" validate:"required" jsonschema:"(required) Issue number."`
	Body      string `json:"body" validate:"required" jsonschema:"(required) Comment body."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the comment without posting."`
	Confirmed bool   `` /* 150-byte string literal not displayed */
}

type IssueCommentTool

type IssueCommentTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewIssueCommentTool

func NewIssueCommentTool(ctx context.Context, configs Configs) (*IssueCommentTool, error)

func (*IssueCommentTool) Invoke

func (t *IssueCommentTool) Invoke(ctx context.Context, params *IssueCommentParams) (result string, err error)

type IssueCreateParams

type IssueCreateParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Title     string `json:"title" validate:"required" jsonschema:"(required) The issue title."`
	Body      string `json:"body,omitempty" jsonschema:"(optional) The issue body."`
	Labels    string `json:"labels,omitempty" jsonschema:"(optional) Comma-separated labels."`
	Assignee  string `json:"assignee,omitempty" jsonschema:"(optional) Assignee login."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the issue creation without making changes."`
	Confirmed bool   `` /* 160-byte string literal not displayed */
}

type IssueCreateTool

type IssueCreateTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewIssueCreateTool

func NewIssueCreateTool(ctx context.Context, configs Configs) (*IssueCreateTool, error)

func (*IssueCreateTool) Invoke

func (t *IssueCreateTool) Invoke(ctx context.Context, params *IssueCreateParams) (result string, err error)

type IssueGetOutput

type IssueGetOutput struct {
	Number    int      `json:"number"`
	Title     string   `json:"title"`
	State     string   `json:"state"`
	Author    string   `json:"author"`
	Body      string   `json:"body,omitempty"`
	Labels    []string `json:"labels,omitempty"`
	Assignees []string `json:"assignees,omitempty"`
	Milestone string   `json:"milestone,omitempty"`
	CreatedAt string   `json:"createdAt"`
	UpdatedAt string   `json:"updatedAt"`
	HTMLURL   string   `json:"htmlURL"`
}

type IssueGetParams

type IssueGetParams struct {
	Instance            string   `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner               string   `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo                string   `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number              int      `json:"number" validate:"required" jsonschema:"(required) Issue number."`
	ExcludeFieldsOutput []string `` /* 189-byte string literal not displayed */
}

type IssueGetTool

type IssueGetTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewIssueGetTool

func NewIssueGetTool(ctx context.Context, configs Configs) (*IssueGetTool, error)

func (*IssueGetTool) Invoke

func (t *IssueGetTool) Invoke(ctx context.Context, params *IssueGetParams) (result string, err error)

type IssueListOutput

type IssueListOutput struct {
	Number    int      `json:"number"`
	Title     string   `json:"title"`
	State     string   `json:"state"`
	Author    string   `json:"author"`
	Labels    []string `json:"labels"`
	CreatedAt string   `json:"createdAt"`
	UpdatedAt string   `json:"updatedAt"`
	HTMLURL   string   `json:"htmlURL"`
}

type IssueListParams

type IssueListParams struct {
	Instance string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner    string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo     string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	State    string `json:"state,omitempty" jsonschema:"(optional) Filter by state: open, closed, all. Defaults to open."`
	Labels   string `json:"labels,omitempty" jsonschema:"(optional) Comma-separated label names."`
	Assignee string `json:"assignee,omitempty" jsonschema:"(optional) Filter by assignee login."`
	PerPage  int    `json:"perPage,omitempty" jsonschema:"(optional) Results per page. Defaults to 30, max 100."`
	Filter   string `json:"filter,omitempty" jsonschema:"(optional) Go RE2 regex applied on each issue JSON output."`
}

type IssueListTool

type IssueListTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewIssueListTool

func NewIssueListTool(ctx context.Context, configs Configs) (*IssueListTool, error)

func (*IssueListTool) Invoke

func (t *IssueListTool) Invoke(ctx context.Context, params *IssueListParams) (result string, err error)

type OrgRepoListOutput

type OrgRepoListOutput struct {
	Name          string `json:"name"`
	FullName      string `json:"fullName"`
	Description   string `json:"description"`
	Language      string `json:"language"`
	Private       bool   `json:"private"`
	Stars         int    `json:"stars"`
	OpenIssues    int    `json:"openIssues"`
	DefaultBranch string `json:"defaultBranch"`
	HTMLURL       string `json:"htmlURL"`
}

type OrgRepoListParams

type OrgRepoListParams struct {
	Instance string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Org      string `json:"org" validate:"required" jsonschema:"(required) Organization name."`
	Type     string `json:"type,omitempty" jsonschema:"(optional) Repository type: all, public, private, forks, sources, member. Defaults to all."`
	PerPage  int    `json:"perPage,omitempty" jsonschema:"(optional) Results per page. Defaults to 30, max 100."`
	Filter   string `json:"filter,omitempty" jsonschema:"(optional) Go RE2 regex applied on each repository JSON output."`
}

type OrgRepoListTool

type OrgRepoListTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewOrgRepoListTool

func NewOrgRepoListTool(ctx context.Context, configs Configs) (*OrgRepoListTool, error)

func (*OrgRepoListTool) Invoke

func (t *OrgRepoListTool) Invoke(ctx context.Context, params *OrgRepoListParams) (result string, err error)

type PRCommentParams

type PRCommentParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number    int    `json:"number" validate:"required" jsonschema:"(required) PR number."`
	Body      string `json:"body" validate:"required" jsonschema:"(required) Comment body."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the comment without posting."`
	Confirmed bool   `` /* 150-byte string literal not displayed */
}

type PRCommentTool

type PRCommentTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRCommentTool

func NewPRCommentTool(ctx context.Context, configs Configs) (*PRCommentTool, error)

func (*PRCommentTool) Invoke

func (t *PRCommentTool) Invoke(ctx context.Context, params *PRCommentParams) (result string, err error)

type PRCreateParams

type PRCreateParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Title     string `json:"title" validate:"required" jsonschema:"(required) The PR title."`
	Head      string `json:"head" validate:"required" jsonschema:"(required) The name of the branch where your changes are implemented."`
	Base      string `` /* 145-byte string literal not displayed */
	Body      string `json:"body,omitempty" jsonschema:"(optional) The PR body."`
	Draft     bool   `json:"draft,omitempty" jsonschema:"(optional) Create as draft PR."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the PR creation without making changes."`
	Confirmed bool   `` /* 157-byte string literal not displayed */
}

type PRCreateTool

type PRCreateTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRCreateTool

func NewPRCreateTool(ctx context.Context, configs Configs) (*PRCreateTool, error)

func (*PRCreateTool) Invoke

func (t *PRCreateTool) Invoke(ctx context.Context, params *PRCreateParams) (result string, err error)

type PRGetOutput

type PRGetOutput struct {
	Number     int      `json:"number"`
	Title      string   `json:"title"`
	State      string   `json:"state"`
	Author     string   `json:"author"`
	Body       string   `json:"body,omitempty"`
	BaseBranch string   `json:"baseBranch"`
	HeadBranch string   `json:"headBranch"`
	Labels     []string `json:"labels,omitempty"`
	Assignees  []string `json:"assignees,omitempty"`
	Mergeable  *bool    `json:"mergeable"`
	Draft      bool     `json:"draft"`
	CreatedAt  string   `json:"createdAt"`
	UpdatedAt  string   `json:"updatedAt"`
	HTMLURL    string   `json:"htmlURL"`
}

type PRGetParams

type PRGetParams struct {
	Instance            string   `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner               string   `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo                string   `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number              int      `json:"number" validate:"required" jsonschema:"(required) PR number."`
	ExcludeFieldsOutput []string `` /* 164-byte string literal not displayed */
}

type PRGetTool

type PRGetTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRGetTool

func NewPRGetTool(ctx context.Context, configs Configs) (*PRGetTool, error)

func (*PRGetTool) Invoke

func (t *PRGetTool) Invoke(ctx context.Context, params *PRGetParams) (result string, err error)

type PRListOutput

type PRListOutput struct {
	Number     int    `json:"number"`
	Title      string `json:"title"`
	State      string `json:"state"`
	Author     string `json:"author"`
	BaseBranch string `json:"baseBranch"`
	HeadBranch string `json:"headBranch"`
	Draft      bool   `json:"draft"`
	CreatedAt  string `json:"createdAt"`
	UpdatedAt  string `json:"updatedAt"`
	HTMLURL    string `json:"htmlURL"`
}

type PRListParams

type PRListParams struct {
	Instance string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner    string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo     string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	State    string `json:"state,omitempty" jsonschema:"(optional) Filter by state: open, closed, all. Defaults to open."`
	Head     string `json:"head,omitempty" jsonschema:"(optional) Filter by head user/org and branch (format: user:ref-name)."`
	Base     string `json:"base,omitempty" jsonschema:"(optional) Filter by base branch name."`
	PerPage  int    `json:"perPage,omitempty" jsonschema:"(optional) Results per page. Defaults to 30, max 100."`
	Filter   string `json:"filter,omitempty" jsonschema:"(optional) Go RE2 regex applied on each PR JSON output."`
}

type PRListTool

type PRListTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRListTool

func NewPRListTool(ctx context.Context, configs Configs) (*PRListTool, error)

func (*PRListTool) Invoke

func (t *PRListTool) Invoke(ctx context.Context, params *PRListParams) (result string, err error)

type PRRequestReviewersParams

type PRRequestReviewersParams struct {
	Instance  string   `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string   `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string   `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number    int      `json:"number" validate:"required" jsonschema:"(required) PR number."`
	Reviewers []string `json:"reviewers" validate:"required,min=1" jsonschema:"(required) GitHub usernames to request as reviewers."`
	DryRun    bool     `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the request without making changes."`
	Confirmed bool     `` /* 151-byte string literal not displayed */
}

type PRRequestReviewersTool

type PRRequestReviewersTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRRequestReviewersTool

func NewPRRequestReviewersTool(ctx context.Context, configs Configs) (*PRRequestReviewersTool, error)

func (*PRRequestReviewersTool) Invoke

func (t *PRRequestReviewersTool) Invoke(ctx context.Context, params *PRRequestReviewersParams) (result string, err error)

type PRReviewParams

type PRReviewParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number    int    `json:"number" validate:"required" jsonschema:"(required) PR number."`
	Event     string `` /* 146-byte string literal not displayed */
	Body      string `json:"body,omitempty" jsonschema:"(optional) Review comment body."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the review without submitting."`
	Confirmed bool   `` /* 151-byte string literal not displayed */
}

type PRReviewTool

type PRReviewTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRReviewTool

func NewPRReviewTool(ctx context.Context, configs Configs) (*PRReviewTool, error)

func (*PRReviewTool) Invoke

func (t *PRReviewTool) Invoke(ctx context.Context, params *PRReviewParams) (result string, err error)

type PRSuggestChangeParams

type PRSuggestChangeParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Number    int    `json:"number" validate:"required" jsonschema:"(required) PR number."`
	CommitID  string `json:"commitId" validate:"required" jsonschema:"(required) The SHA of the commit to comment on."`
	FilePath  string `json:"filePath" validate:"required" jsonschema:"(required) The relative path to the file being commented on."`
	Line      int    `json:"line" validate:"required,gte=0" jsonschema:"(required) The line number in the file to comment on."`
	Body      string `json:"body" validate:"required" jsonschema:"(required) The suggestion text. Use GitHub suggestion blocks for code changes."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the suggestion without posting."`
	Confirmed bool   `` /* 153-byte string literal not displayed */
}

type PRSuggestChangeTool

type PRSuggestChangeTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewPRSuggestChangeTool

func NewPRSuggestChangeTool(ctx context.Context, configs Configs) (*PRSuggestChangeTool, error)

func (*PRSuggestChangeTool) Invoke

func (t *PRSuggestChangeTool) Invoke(ctx context.Context, params *PRSuggestChangeParams) (result string, err error)

type ReleaseCreateParams

type ReleaseCreateParams struct {
	Instance        string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner           string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo            string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	TagName         string `json:"tagName" validate:"required" jsonschema:"(required) Tag to create the release from."`
	TargetCommitish string `` /* 155-byte string literal not displayed */
	Name            string `json:"name,omitempty" jsonschema:"(optional) Release name. Defaults to tag name."`
	Body            string `json:"body,omitempty" jsonschema:"(optional) Release body/notes."`
	Draft           bool   `json:"draft,omitempty" jsonschema:"(optional) Mark as draft release."`
	Prerelease      bool   `json:"prerelease,omitempty" jsonschema:"(optional) Mark as pre-release."`
	DryRun          bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the release creation without making changes."`
	Confirmed       bool   `` /* 162-byte string literal not displayed */
}

type ReleaseCreateTool

type ReleaseCreateTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewReleaseCreateTool

func NewReleaseCreateTool(ctx context.Context, configs Configs) (*ReleaseCreateTool, error)

func (*ReleaseCreateTool) Invoke

func (t *ReleaseCreateTool) Invoke(ctx context.Context, params *ReleaseCreateParams) (result string, err error)

type RepoCloneParams

type RepoCloneParams struct {
	Instance  string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner     string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo      string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Branch    string `json:"branch,omitempty" jsonschema:"(optional) Branch to checkout. Defaults to the default branch."`
	Depth     int    `json:"depth,omitempty" jsonschema:"(optional) Clone depth (shallow clone). 0 = full clone."`
	DryRun    bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, return the resolved path without cloning."`
	Confirmed bool   `` /* 151-byte string literal not displayed */
}

type RepoCloneTool

type RepoCloneTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewRepoCloneTool

func NewRepoCloneTool(ctx context.Context, configs Configs) (*RepoCloneTool, error)

func (*RepoCloneTool) Invoke

func (t *RepoCloneTool) Invoke(ctx context.Context, params *RepoCloneParams) (result string, err error)

type RepoSearchOutput

type RepoSearchOutput struct {
	Name          string `json:"name"`
	FullName      string `json:"fullName"`
	Description   string `json:"description"`
	Language      string `json:"language"`
	Private       bool   `json:"private"`
	Stars         int    `json:"stars"`
	OpenIssues    int    `json:"openIssues"`
	DefaultBranch string `json:"defaultBranch"`
	HTMLURL       string `json:"htmlURL"`
}

type RepoSearchParams

type RepoSearchParams struct {
	Instance string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Query    string `json:"query" validate:"required" jsonschema:"(required) Search query (GitHub search syntax)."`
	PerPage  int    `json:"perPage,omitempty" jsonschema:"(optional) Results per page. Defaults to 30, max 100."`
	Filter   string `json:"filter,omitempty" jsonschema:"(optional) Go RE2 regex applied on each repository JSON output."`
}

type RepoSearchTool

type RepoSearchTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewRepoSearchTool

func NewRepoSearchTool(ctx context.Context, configs Configs) (*RepoSearchTool, error)

func (*RepoSearchTool) Invoke

func (t *RepoSearchTool) Invoke(ctx context.Context, params *RepoSearchParams) (result string, err error)

type RepoSettingsUpdateParams

type RepoSettingsUpdateParams struct {
	Instance            string `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner               string `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo                string `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	Description         string `json:"description,omitempty" jsonschema:"(optional) Repository description."`
	Homepage            string `json:"homepage,omitempty" jsonschema:"(optional) Repository homepage URL."`
	Private             *bool  `json:"private,omitempty" jsonschema:"(optional) Set repository visibility: true=private, false=public."`
	HasIssues           *bool  `json:"hasIssues,omitempty" jsonschema:"(optional) Enable/disable issues."`
	HasProjects         *bool  `json:"hasProjects,omitempty" jsonschema:"(optional) Enable/disable projects."`
	HasWiki             *bool  `json:"hasWiki,omitempty" jsonschema:"(optional) Enable/disable wiki."`
	DefaultBranch       string `json:"defaultBranch,omitempty" jsonschema:"(optional) Default branch name."`
	AllowSquashMerge    *bool  `json:"allowSquashMerge,omitempty" jsonschema:"(optional) Allow squash merging."`
	AllowMergeCommit    *bool  `json:"allowMergeCommit,omitempty" jsonschema:"(optional) Allow merge commits."`
	AllowRebaseMerge    *bool  `json:"allowRebaseMerge,omitempty" jsonschema:"(optional) Allow rebase merging."`
	DeleteBranchOnMerge *bool  `json:"deleteBranchOnMerge,omitempty" jsonschema:"(optional) Auto-delete head branch after merge."`
	DryRun              bool   `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the update without making changes."`
	Confirmed           bool   `` /* 152-byte string literal not displayed */
}

type RepoSettingsUpdateTool

type RepoSettingsUpdateTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewRepoSettingsUpdateTool

func NewRepoSettingsUpdateTool(ctx context.Context, configs Configs) (*RepoSettingsUpdateTool, error)

func (*RepoSettingsUpdateTool) Invoke

func (t *RepoSettingsUpdateTool) Invoke(ctx context.Context, params *RepoSettingsUpdateParams) (result string, err error)

type WebhookUpsertParams

type WebhookUpsertParams struct {
	Instance    string   `json:"instance" validate:"required" jsonschema:"(required) The GitHub instance to connect to."`
	Owner       string   `json:"owner" validate:"required" jsonschema:"(required) Repository owner."`
	Repo        string   `json:"repo" validate:"required" jsonschema:"(required) Repository name."`
	HookURL     string   `json:"hookUrl" validate:"required,url" jsonschema:"(required) Webhook payload URL."`
	Secret      string   `json:"secret,omitempty" jsonschema:"(optional) Webhook secret."`
	ContentType string   `json:"contentType,omitempty" jsonschema:"(optional) Content type: json or form. Defaults to json."`
	Events      []string `json:"events,omitempty" jsonschema:"(optional) Event names. Defaults to push."`
	Active      bool     `json:"active,omitempty" jsonschema:"(optional) Whether the webhook is active. Defaults to true."`
	HookID      int64    `json:"hookId,omitempty" jsonschema:"(optional) Existing hook ID to update. If not provided, creates a new hook."`
	DryRun      bool     `json:"dryRun,omitempty" jsonschema:"(optional) If true, simulate the operation without making changes."`
	Confirmed   bool     `` /* 141-byte string literal not displayed */
}

type WebhookUpsertTool

type WebhookUpsertTool struct {
	tool.InvokableTool
	// contains filtered or unexported fields
}

func NewWebhookUpsertTool

func NewWebhookUpsertTool(ctx context.Context, configs Configs) (*WebhookUpsertTool, error)

func (*WebhookUpsertTool) Invoke

func (t *WebhookUpsertTool) Invoke(ctx context.Context, params *WebhookUpsertParams) (result string, err error)

Jump to

Keyboard shortcuts

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