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 ¶
- func BuildClients(ctx context.Context, configs Configs) (map[string]*github.Client, error)
- func Check(ctx context.Context, configs Configs) checkup.Results
- func ExtractWriteToolNames(ctx context.Context, configs Configs) ([]string, error)
- func NewAllTools(ctx context.Context, configs Configs) ([]tool.InvokableTool, error)
- func NewAllToolsWithSafety(ctx context.Context, configs Configs, safetyCfg *safety.Config) ([]tool.InvokableTool, *safety.Middleware, error)
- func NewClient(ctx context.Context, cfg *Config) (*github.Client, error)
- func NewReadOnlyTools(ctx context.Context, configs Configs) ([]tool.InvokableTool, error)
- func WriteToolNames() []string
- type BranchCreateParams
- type BranchCreateTool
- type Config
- type Configs
- type IssueCommentParams
- type IssueCommentTool
- type IssueCreateParams
- type IssueCreateTool
- type IssueGetOutput
- type IssueGetParams
- type IssueGetTool
- type IssueListOutput
- type IssueListParams
- type IssueListTool
- type OrgRepoListOutput
- type OrgRepoListParams
- type OrgRepoListTool
- type PRCommentParams
- type PRCommentTool
- type PRCreateParams
- type PRCreateTool
- type PRGetOutput
- type PRGetParams
- type PRGetTool
- type PRListOutput
- type PRListParams
- type PRListTool
- type PRRequestReviewersParams
- type PRRequestReviewersTool
- type PRReviewParams
- type PRReviewTool
- type PRSuggestChangeParams
- type PRSuggestChangeTool
- type ReleaseCreateParams
- type ReleaseCreateTool
- type RepoCloneParams
- type RepoCloneTool
- type RepoSearchOutput
- type RepoSearchParams
- type RepoSearchTool
- type RepoSettingsUpdateParams
- type RepoSettingsUpdateTool
- type WebhookUpsertParams
- type WebhookUpsertTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClients ¶
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 ExtractWriteToolNames ¶
ExtractWriteToolNames creates all write tools from the given configs and extracts their tool names via Info().
func NewAllTools ¶
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 NewReadOnlyTools ¶
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 ¶
Configs maps a named GitHub instance to its configuration.
func (Configs) GetInstanceNames ¶
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 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
}
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)
Source Files
¶
- base.go
- branch_create.go
- check.go
- client.go
- config.go
- github.go
- helper.go
- issue_comment.go
- issue_create.go
- issue_get.go
- issue_list.go
- org_repo_list.go
- pr_comment.go
- pr_create.go
- pr_get.go
- pr_list.go
- pr_request_reviewers.go
- pr_review.go
- pr_suggest_change.go
- registry.go
- release_create.go
- repo_clone.go
- repo_search.go
- repo_settings_update.go
- webhook_upsert.go