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, pull, and 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
- 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 FileCopyOutput
- type FileCopyParams
- type FileCopyTool
- type FileDeleteOutput
- type FileDeleteParams
- type FileDeleteTool
- type FileListOutput
- type FileListParams
- type FileListTool
- type FileMoveOutput
- type FileMoveParams
- type FileMoveTool
- type FileReadOutput
- type FileReadParams
- type FileReadTool
- type FileSearchOutput
- type FileSearchParams
- type FileSearchTool
- type FileWriteOutput
- type FileWriteParams
- type FileWriteTool
- type InstanceListParams
- type InstanceListTool
- 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 RepoPullParams
- type RepoPullTool
- type RepoSearchOutput
- type RepoSearchParams
- type RepoSearchTool
- type RepoSettingsUpdateParams
- type RepoSettingsUpdateTool
- type WebhookUpsertParams
- type WebhookUpsertTool
Constants ¶
const CloneSessionKey = "github_clone_session_id"
CloneSessionKey is the adk session-value key under which the per-user-session clone namespace is stored. Callers set it at run start via:
adk.AddSessionValue(ctx, github.CloneSessionKey, sessionID)
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. These names can be passed to the safety middleware's Config.WriteToolNames.
Contract: every name listed here MUST honor dryRun=true as a no-side-effect preview. The safety gate treats dry-run as always-safe, so a tool that mutates during dry-run would let an unconfirmed model call bypass the gate.
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 */
}
BranchCreateParams defines the parameters for creating a branch.
type BranchCreateTool ¶
type BranchCreateTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
BranchCreateTool is an eino tool for creating branches.
func NewBranchCreateTool ¶
func NewBranchCreateTool(ctx context.Context, configs Configs) (*BranchCreateTool, error)
NewBranchCreateTool creates a new BranchCreateTool.
func (*BranchCreateTool) Invoke ¶
func (t *BranchCreateTool) Invoke(ctx context.Context, params *BranchCreateParams) (result string, err error)
Invoke creates a branch in a GitHub repository.
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 FileCopyOutput ¶
type FileCopyOutput struct {
Source string `json:"source"`
Destination string `json:"destination"`
Type string `json:"type"` // "file" or "dir"
Copied bool `json:"copied"`
Branch string `json:"branch"`
FileCount int `json:"fileCount,omitempty"` // only for directory copies
TotalBytes int64 `json:"totalBytes,omitempty"` // only for directory copies
}
type FileCopyParams ¶
type FileCopyParams 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."`
Source string `json:"source" validate:"required" jsonschema:"(required) Relative source file or directory path inside the cloned repo."`
Destination string `` /* 130-byte string literal not displayed */
Branch string `json:"branch" validate:"required" jsonschema:"(required) Target branch (for context; no checkout is performed)."`
DryRun bool `json:"dryRun,omitempty" jsonschema:"(optional) If true, preview the copy without making changes."`
Confirmed bool `json:"confirmed,omitempty" jsonschema:"(optional) Must be true to actually execute. Set after approving the dry-run result."`
}
type FileCopyTool ¶
type FileCopyTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileCopyTool ¶
func NewFileCopyTool(ctx context.Context, configs Configs) (*FileCopyTool, error)
func (*FileCopyTool) Invoke ¶
func (t *FileCopyTool) Invoke(ctx context.Context, params *FileCopyParams) (string, error)
type FileDeleteOutput ¶
type FileDeleteParams ¶
type FileDeleteParams 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."`
Path string `` /* 126-byte string literal not displayed */
Branch string `json:"branch" validate:"required" jsonschema:"(required) Target branch (for context; no checkout is performed)."`
DryRun bool `json:"dryRun,omitempty" jsonschema:"(optional) If true, preview the deletion without making changes."`
Confirmed bool `json:"confirmed,omitempty" jsonschema:"(optional) Must be true to actually execute. Set after approving the dry-run result."`
}
type FileDeleteTool ¶
type FileDeleteTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileDeleteTool ¶
func NewFileDeleteTool(ctx context.Context, configs Configs) (*FileDeleteTool, error)
func (*FileDeleteTool) Invoke ¶
func (t *FileDeleteTool) Invoke(ctx context.Context, params *FileDeleteParams) (string, error)
type FileListOutput ¶
type FileListParams ¶
type FileListParams 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."`
SubPath string `json:"subPath,omitempty" jsonschema:"(optional) Relative subdirectory to list. Defaults to repo root."`
MaxDepth int `json:"maxDepth,omitempty" jsonschema:"(optional) Maximum recursion depth. 1 = immediate children (default). 0 = unlimited."`
MaxResults int `json:"maxResults,omitempty" jsonschema:"(optional) Maximum number of entries to return. Defaults to 100."`
}
type FileListTool ¶
type FileListTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileListTool ¶
func NewFileListTool(ctx context.Context, configs Configs) (*FileListTool, error)
func (*FileListTool) Invoke ¶
func (t *FileListTool) Invoke(ctx context.Context, params *FileListParams) (string, error)
type FileMoveOutput ¶
type FileMoveParams ¶
type FileMoveParams 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."`
Source string `json:"source" validate:"required" jsonschema:"(required) Relative source file or directory path inside the cloned repo."`
Destination string `` /* 130-byte string literal not displayed */
Branch string `json:"branch" validate:"required" jsonschema:"(required) Target branch (for context; no checkout is performed)."`
DryRun bool `json:"dryRun,omitempty" jsonschema:"(optional) If true, preview the move without making changes."`
Confirmed bool `json:"confirmed,omitempty" jsonschema:"(optional) Must be true to actually execute. Set after approving the dry-run result."`
}
type FileMoveTool ¶
type FileMoveTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileMoveTool ¶
func NewFileMoveTool(ctx context.Context, configs Configs) (*FileMoveTool, error)
func (*FileMoveTool) Invoke ¶
func (t *FileMoveTool) Invoke(ctx context.Context, params *FileMoveParams) (string, error)
type FileReadOutput ¶
type FileReadParams ¶
type FileReadParams 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."`
Path string `json:"path" validate:"required" jsonschema:"(required) Relative file path inside the cloned repo."`
StartLine int `json:"startLine,omitempty" jsonschema:"(optional) 1-indexed first line to read. 0 = start from beginning."`
EndLine int `json:"endLine,omitempty" jsonschema:"(optional) 1-indexed last line to read. 0 = read to end."`
}
type FileReadTool ¶
type FileReadTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileReadTool ¶
func NewFileReadTool(ctx context.Context, configs Configs) (*FileReadTool, error)
func (*FileReadTool) Invoke ¶
func (t *FileReadTool) Invoke(ctx context.Context, params *FileReadParams) (string, error)
type FileSearchOutput ¶
type FileSearchParams ¶
type FileSearchParams 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."`
Pattern string `json:"pattern" validate:"required" jsonschema:"(required) Go RE2 regex to search for in file contents."`
PathPrefix string `json:"pathPrefix,omitempty" jsonschema:"(optional) Subdirectory to search within. Defaults to repo root."`
MaxResults int `json:"maxResults,omitempty" jsonschema:"(optional) Maximum number of matches to return. Defaults to 100."`
}
type FileSearchTool ¶
type FileSearchTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileSearchTool ¶
func NewFileSearchTool(ctx context.Context, configs Configs) (*FileSearchTool, error)
func (*FileSearchTool) Invoke ¶
func (t *FileSearchTool) Invoke(ctx context.Context, params *FileSearchParams) (string, error)
type FileWriteOutput ¶
type FileWriteParams ¶
type FileWriteParams 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."`
Path string `json:"path" validate:"required" jsonschema:"(required) Relative file path inside the cloned repo."`
Content string `json:"content" validate:"required" jsonschema:"(required) File content to write."`
Branch string `json:"branch" validate:"required" jsonschema:"(required) Target branch to commit and push to."`
BaseBranch string `` /* 145-byte string literal not displayed */
CommitMessage string `json:"commitMessage" validate:"required" jsonschema:"(required) Git commit message."`
DryRun bool `json:"dryRun,omitempty" jsonschema:"(optional) If true, preview the write without making changes."`
Confirmed bool `` /* 130-byte string literal not displayed */
}
type FileWriteTool ¶
type FileWriteTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
func NewFileWriteTool ¶
func NewFileWriteTool(ctx context.Context, configs Configs) (*FileWriteTool, error)
func (*FileWriteTool) Invoke ¶
func (t *FileWriteTool) Invoke(ctx context.Context, params *FileWriteParams) (string, error)
type InstanceListParams ¶
type InstanceListParams struct{}
InstanceListParams defines the parameters for listing GitHub instances.
type InstanceListTool ¶
type InstanceListTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
InstanceListTool is an eino tool for listing configured GitHub instances.
func (*InstanceListTool) Invoke ¶
func (t *InstanceListTool) Invoke(ctx context.Context, params *InstanceListParams) (string, error)
Invoke returns known GitHub instances as JSON.
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 */
}
IssueCommentParams defines the parameters for commenting on a GitHub issue.
type IssueCommentTool ¶
type IssueCommentTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
IssueCommentTool is an eino tool for commenting on GitHub issues.
func NewIssueCommentTool ¶
func NewIssueCommentTool(ctx context.Context, configs Configs) (*IssueCommentTool, error)
NewIssueCommentTool creates a new IssueCommentTool.
func (*IssueCommentTool) Invoke ¶
func (t *IssueCommentTool) Invoke(ctx context.Context, params *IssueCommentParams) (result string, err error)
Invoke posts a comment on a GitHub issue.
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 */
}
IssueCreateParams defines the parameters for creating a GitHub issue.
type IssueCreateTool ¶
type IssueCreateTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
IssueCreateTool is an eino tool for creating GitHub issues.
func NewIssueCreateTool ¶
func NewIssueCreateTool(ctx context.Context, configs Configs) (*IssueCreateTool, error)
NewIssueCreateTool creates a new IssueCreateTool.
func (*IssueCreateTool) Invoke ¶
func (t *IssueCreateTool) Invoke(ctx context.Context, params *IssueCreateParams) (result string, err error)
Invoke creates a GitHub issue and returns the result.
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"`
}
IssueGetOutput is the structured output for an issue get.
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 */
}
IssueGetParams defines the parameters for getting a GitHub issue.
type IssueGetTool ¶
type IssueGetTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
IssueGetTool is an eino tool for getting GitHub issues.
func NewIssueGetTool ¶
func NewIssueGetTool(ctx context.Context, configs Configs) (*IssueGetTool, error)
NewIssueGetTool creates a new IssueGetTool.
func (*IssueGetTool) Invoke ¶
func (t *IssueGetTool) Invoke(ctx context.Context, params *IssueGetParams) (result string, err error)
Invoke fetches a GitHub issue and returns the result.
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"`
}
IssueListOutput is the structured output for an issue list.
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."`
MaxPages int `` /* 126-byte string literal not displayed */
Filter string `` /* 258-byte string literal not displayed */
}
IssueListParams defines the parameters for listing GitHub issues.
type IssueListTool ¶
type IssueListTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
IssueListTool is an eino tool for listing GitHub issues.
func NewIssueListTool ¶
func NewIssueListTool(ctx context.Context, configs Configs) (*IssueListTool, error)
NewIssueListTool creates a new IssueListTool.
func (*IssueListTool) Invoke ¶
func (t *IssueListTool) Invoke(ctx context.Context, params *IssueListParams) (result string, err error)
Invoke returns matching issues as JSON.
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"`
}
OrgRepoListOutput is the structured output for an org repo list.
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."`
MaxPages int `` /* 126-byte string literal not displayed */
Filter string `` /* 263-byte string literal not displayed */
}
OrgRepoListParams defines the parameters for listing an org's repos.
type OrgRepoListTool ¶
type OrgRepoListTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
OrgRepoListTool is an eino tool for listing an org's repos.
func NewOrgRepoListTool ¶
func NewOrgRepoListTool(ctx context.Context, configs Configs) (*OrgRepoListTool, error)
NewOrgRepoListTool creates a new OrgRepoListTool.
func (*OrgRepoListTool) Invoke ¶
func (t *OrgRepoListTool) Invoke(ctx context.Context, params *OrgRepoListParams) (result string, err error)
Invoke returns an org's repositories as JSON.
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 */
}
PRCommentParams defines the parameters for commenting on a GitHub PR.
type PRCommentTool ¶
type PRCommentTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRCommentTool is an eino tool for commenting on GitHub PRs.
func NewPRCommentTool ¶
func NewPRCommentTool(ctx context.Context, configs Configs) (*PRCommentTool, error)
NewPRCommentTool creates a new PRCommentTool.
func (*PRCommentTool) Invoke ¶
func (t *PRCommentTool) Invoke(ctx context.Context, params *PRCommentParams) (result string, err error)
Invoke posts a comment on a GitHub PR.
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 */
}
PRCreateParams defines the parameters for creating a GitHub PR.
type PRCreateTool ¶
type PRCreateTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRCreateTool is an eino tool for creating GitHub PRs.
func NewPRCreateTool ¶
func NewPRCreateTool(ctx context.Context, configs Configs) (*PRCreateTool, error)
NewPRCreateTool creates a new PRCreateTool.
func (*PRCreateTool) Invoke ¶
func (t *PRCreateTool) Invoke(ctx context.Context, params *PRCreateParams) (result string, err error)
Invoke creates a GitHub PR and returns the result.
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"`
}
PRGetOutput is the structured output for a PR get.
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 */
}
PRGetParams defines the parameters for fetching a GitHub PR.
type PRGetTool ¶
type PRGetTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRGetTool is an eino tool for getting GitHub PRs.
func NewPRGetTool ¶
NewPRGetTool creates a new PRGetTool.
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"`
}
PRListOutput is the structured output for a PR list.
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."`
MaxPages int `` /* 126-byte string literal not displayed */
Filter string `` /* 255-byte string literal not displayed */
}
PRListParams defines the parameters for listing GitHub PRs.
type PRListTool ¶
type PRListTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRListTool is an eino tool for listing GitHub PRs.
func NewPRListTool ¶
func NewPRListTool(ctx context.Context, configs Configs) (*PRListTool, error)
NewPRListTool creates a new PRListTool.
func (*PRListTool) Invoke ¶
func (t *PRListTool) Invoke(ctx context.Context, params *PRListParams) (result string, err error)
Invoke returns matching PRs as JSON.
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 */
}
PRRequestReviewersParams defines the parameters for requesting PR reviewers.
type PRRequestReviewersTool ¶
type PRRequestReviewersTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRRequestReviewersTool is an eino tool for requesting PR reviewers.
func NewPRRequestReviewersTool ¶
func NewPRRequestReviewersTool(ctx context.Context, configs Configs) (*PRRequestReviewersTool, error)
NewPRRequestReviewersTool creates a new PRRequestReviewersTool.
func (*PRRequestReviewersTool) Invoke ¶
func (t *PRRequestReviewersTool) Invoke(ctx context.Context, params *PRRequestReviewersParams) (result string, err error)
Invoke requests reviewers for a GitHub PR.
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 */
}
PRReviewParams defines the parameters for reviewing a GitHub PR.
type PRReviewTool ¶
type PRReviewTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRReviewTool is an eino tool for reviewing GitHub PRs.
func NewPRReviewTool ¶
func NewPRReviewTool(ctx context.Context, configs Configs) (*PRReviewTool, error)
NewPRReviewTool creates a new PRReviewTool.
func (*PRReviewTool) Invoke ¶
func (t *PRReviewTool) Invoke(ctx context.Context, params *PRReviewParams) (result string, err error)
Invoke submits a review on a GitHub PR.
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 */
}
PRSuggestChangeParams defines the parameters for suggesting a PR change.
type PRSuggestChangeTool ¶
type PRSuggestChangeTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
PRSuggestChangeTool is an eino tool for suggesting PR changes.
func NewPRSuggestChangeTool ¶
func NewPRSuggestChangeTool(ctx context.Context, configs Configs) (*PRSuggestChangeTool, error)
NewPRSuggestChangeTool creates a new PRSuggestChangeTool.
func (*PRSuggestChangeTool) Invoke ¶
func (t *PRSuggestChangeTool) Invoke(ctx context.Context, params *PRSuggestChangeParams) (result string, err error)
Invoke suggests a change on a GitHub PR.
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 */
}
ReleaseCreateParams defines the parameters for creating a GitHub release.
type ReleaseCreateTool ¶
type ReleaseCreateTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
ReleaseCreateTool is an eino tool for creating GitHub releases.
func NewReleaseCreateTool ¶
func NewReleaseCreateTool(ctx context.Context, configs Configs) (*ReleaseCreateTool, error)
NewReleaseCreateTool creates a new ReleaseCreateTool.
func (*ReleaseCreateTool) Invoke ¶
func (t *ReleaseCreateTool) Invoke(ctx context.Context, params *ReleaseCreateParams) (result string, err error)
Invoke creates a GitHub release and returns the result.
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 */
}
RepoCloneParams defines the parameters for cloning a GitHub repository.
type RepoCloneTool ¶
type RepoCloneTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
RepoCloneTool is an eino tool for cloning GitHub repositories.
func NewRepoCloneTool ¶
func NewRepoCloneTool(ctx context.Context, configs Configs) (*RepoCloneTool, error)
NewRepoCloneTool creates a new RepoCloneTool.
func (*RepoCloneTool) Invoke ¶
func (t *RepoCloneTool) Invoke(ctx context.Context, params *RepoCloneParams) (result string, err error)
Invoke clones a GitHub repository.
type RepoPullParams ¶
type RepoPullParams 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 update. Defaults to the currently checked-out branch."`
DryRun bool `json:"dryRun,omitempty" jsonschema:"(optional) If true, preview the pull without making changes."`
Confirmed bool `json:"confirmed,omitempty" jsonschema:"(optional) Must be true to actually execute. Set after approving the dry-run result."`
}
RepoPullParams defines the parameters for pulling updates into a cloned GitHub repository.
type RepoPullTool ¶
type RepoPullTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
RepoPullTool is an eino tool for updating an already-cloned GitHub repository to the latest remote state, non-destructively (fast-forward only).
func NewRepoPullTool ¶
func NewRepoPullTool(ctx context.Context, configs Configs) (*RepoPullTool, error)
NewRepoPullTool creates a new RepoPullTool.
func (*RepoPullTool) Invoke ¶
func (t *RepoPullTool) Invoke(ctx context.Context, params *RepoPullParams) (string, error)
Invoke pulls the latest remote state into the cloned repository.
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"`
}
RepoSearchOutput is the structured output for a repo search.
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."`
MaxPages int `` /* 126-byte string literal not displayed */
Filter string `` /* 263-byte string literal not displayed */
}
RepoSearchParams defines the parameters for searching GitHub repositories.
type RepoSearchTool ¶
type RepoSearchTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
RepoSearchTool is an eino tool for searching GitHub repositories.
func NewRepoSearchTool ¶
func NewRepoSearchTool(ctx context.Context, configs Configs) (*RepoSearchTool, error)
NewRepoSearchTool creates a new RepoSearchTool.
func (*RepoSearchTool) Invoke ¶
func (t *RepoSearchTool) Invoke(ctx context.Context, params *RepoSearchParams) (result string, err error)
Invoke searches GitHub repositories and returns results as JSON.
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 */
}
RepoSettingsUpdateParams defines the parameters for updating repo settings.
type RepoSettingsUpdateTool ¶
type RepoSettingsUpdateTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
RepoSettingsUpdateTool is an eino tool for updating repo settings.
func NewRepoSettingsUpdateTool ¶
func NewRepoSettingsUpdateTool(ctx context.Context, configs Configs) (*RepoSettingsUpdateTool, error)
NewRepoSettingsUpdateTool creates a new RepoSettingsUpdateTool.
func (*RepoSettingsUpdateTool) Invoke ¶
func (t *RepoSettingsUpdateTool) Invoke(ctx context.Context, params *RepoSettingsUpdateParams) (result string, err error)
Invoke updates repository settings.
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 */
}
WebhookUpsertParams defines the parameters for upserting a webhook.
type WebhookUpsertTool ¶
type WebhookUpsertTool struct {
tool.InvokableTool
// contains filtered or unexported fields
}
WebhookUpsertTool is an eino tool for upserting GitHub webhooks.
func NewWebhookUpsertTool ¶
func NewWebhookUpsertTool(ctx context.Context, configs Configs) (*WebhookUpsertTool, error)
NewWebhookUpsertTool creates a new WebhookUpsertTool.
func (*WebhookUpsertTool) Invoke ¶
func (t *WebhookUpsertTool) Invoke(ctx context.Context, params *WebhookUpsertParams) (result string, err error)
Invoke creates or updates a GitHub webhook.
Source Files
¶
- base.go
- branch_create.go
- check.go
- client.go
- config.go
- file_copy.go
- file_delete.go
- file_list.go
- file_move.go
- file_read.go
- file_search.go
- file_write.go
- github.go
- helper.go
- instance_list.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_pull.go
- repo_search.go
- repo_settings_update.go
- webhook_upsert.go