github

package
v0.0.0-...-fe80ad5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 33 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, pull (fast-forward), 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>/<session>/<owner>/<repo>.

Session-scoped clones

The clone directory is namespaced per user session: <CloneDir>/<session>/<owner>/<repo>. Concurrent sessions sharing one Config.CloneDir root therefore never collide. The session ID is taken from the eino ADK session values, which the harness controls (the LLM cannot spoof it):

// ctx must be the current ADK agent run context (it carries the run session).
adk.AddSessionValue(ctx, github.CloneSessionKey, sessionID)

When the key is absent (plain context.Background(), unit tests, non-ADK usage), the fallback segment default is used, yielding <CloneDir>/default/<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
github_repo_clone Clone a repository to the local filesystem (read-classified; self-gates via DryRun/Confirmed)
github_repo_pull Update an existing clone to the latest remote state, non-destructively (fast-forward only; read-classified)
github_file_read Read file contents from a cloned repo
github_file_search Grep (regex) within a cloned repo
github_file_list List files/dirs in a cloned repo
Write Tools
Tool Description
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
github_file_write Write/create a file, commit, and push
github_file_delete Delete a file or directory from a cloned repo (local only, no commit/push)
github_file_copy Copy a file or directory within a cloned repo (local only, no commit/push)
github_file_move Move/rename a file or directory within a cloned repo (local only, no commit/push)
File Tools

File tools operate on repositories cloned by github_repo_clone. The workflow is:

  1. github_repo_clone — clone the repo to ///
  2. github_file_read / github_file_search / github_file_list — inspect
  3. github_branch_create (optional) — create a working branch
  4. github_file_write / github_file_delete / github_file_copy / github_file_move — modify files locally
  5. github_file_write — commit and push changes
  6. github_pr_create — open a PR from the pushed branch

github_repo_pull refreshes an existing clone to the latest remote state without destroying local work: it fails on a dirty worktree, only fast-forwards (local commits ahead of the remote are preserved and reported as an error), and never resets, stashes, or force-updates. Use it to re-sync after others have pushed, instead of re-cloning.

All file paths are validated to stay within the clone directory. Symlinks and the .git directory are always skipped or rejected.

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; session, owner, and repo segments are sanitized (no traversal).
  • 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, 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

View Source
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

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

Check performs a health check against configured GitHub instances.

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. 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

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 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 FileDeleteOutput struct {
	Path    string `json:"path"`
	Type    string `json:"type"` // "file" or "dir"
	Deleted bool   `json:"deleted"`
	Branch  string `json:"branch"`
}

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 FileListOutput struct {
	Name string `json:"name"`
	Type string `json:"type"` // "file" or "dir"
	Size int64  `json:"size"`
	Path string `json:"path"` // relative to repo root
}

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 FileMoveOutput struct {
	Source      string `json:"source"`
	Destination string `json:"destination"`
	Type        string `json:"type"` // "file" or "dir"
	Moved       bool   `json:"moved"`
	Branch      string `json:"branch"`
}

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 FileReadOutput struct {
	Path      string `json:"path"`
	Content   string `json:"content"`
	Bytes     int    `json:"bytes"`
	Truncated bool   `json:"truncated,omitempty"`
	Note      string `json:"note,omitempty"`
	StartLine int    `json:"startLine,omitempty"`
	EndLine   int    `json:"endLine,omitempty"`
}

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 FileSearchOutput struct {
	Path    string `json:"path"`
	Line    int    `json:"line"`
	Content string `json:"content"`
}

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 FileWriteOutput struct {
	Path      string `json:"path"`
	Branch    string `json:"branch"`
	CommitSHA string `json:"commitSha"`
	Pushed    bool   `json:"pushed"`
}

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

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

NewPRGetTool creates a new PRGetTool.

func (*PRGetTool) Invoke

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

Invoke fetches a GitHub PR and returns the result.

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.

Jump to

Keyboard shortcuts

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