tools

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeAnalyzer

type CodeAnalyzer struct {
	// contains filtered or unexported fields
}

CodeAnalyzer is a tool for analyzing code

func NewCodeAnalyzer

func NewCodeAnalyzer() *CodeAnalyzer

NewCodeAnalyzer creates a new code analyzer tool

func (*CodeAnalyzer) Description

func (c *CodeAnalyzer) Description() string

Description returns the tool description

func (*CodeAnalyzer) Execute

func (c *CodeAnalyzer) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute runs the code analyzer

func (*CodeAnalyzer) Name

func (c *CodeAnalyzer) Name() string

Name returns the tool name

func (*CodeAnalyzer) Parameters

func (c *CodeAnalyzer) Parameters() map[string]interface{}

Parameters returns the tool's parameter schema

type Comment

type Comment struct {
	ID        string
	Author    string
	Content   string
	CreatedAt string
}

Comment represents an issue comment

type CommitInfo

type CommitInfo struct {
	Hash    string
	Message string
	Author  string
	Date    string
}

CommitInfo represents commit information

type DatabaseQuery

type DatabaseQuery struct {
	// contains filtered or unexported fields
}

DatabaseQuery is a tool for querying databases with AI assistance

func NewDatabaseQuery

func NewDatabaseQuery(db database.Database) *DatabaseQuery

NewDatabaseQuery creates a new database query tool

func (*DatabaseQuery) AnalyzeResults

func (d *DatabaseQuery) AnalyzeResults(results []map[string]interface{}) map[string]interface{}

AnalyzeResults analyzes query results and provides insights

func (*DatabaseQuery) Description

func (d *DatabaseQuery) Description() string

Description returns the tool description

func (*DatabaseQuery) Execute

func (d *DatabaseQuery) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute runs the database query tool

func (*DatabaseQuery) Name

func (d *DatabaseQuery) Name() string

Name returns the tool name

func (*DatabaseQuery) Parameters

func (d *DatabaseQuery) Parameters() map[string]interface{}

Parameters returns the tool's parameter schema

type FileInfo

type FileInfo struct {
	Name string
	Type string // "file" or "directory"
	Size int64
	Path string
}

FileInfo represents file information

type IssueDetail

type IssueDetail struct {
	IssueInfo
	Description string
	Comments    []Comment
	Assignees   []string
}

IssueDetail represents detailed issue information

type IssueInfo

type IssueInfo struct {
	ID        string
	Title     string
	Status    string
	CreatedAt string
	Author    string
	Labels    []string
}

IssueInfo represents basic issue information

type IssueProvider

type IssueProvider interface {
	// ListIssues lists repository issues
	ListIssues(ctx context.Context, repoID, status string) ([]IssueInfo, error)

	// GetIssue retrieves a specific issue
	GetIssue(ctx context.Context, repoID, issueID string) (*IssueDetail, error)

	// CreateIssue creates a new issue
	CreateIssue(ctx context.Context, repoID, title, description string, labels []string) (string, error)

	// UpdateIssue updates an existing issue
	UpdateIssue(ctx context.Context, repoID, issueID string, updates map[string]interface{}) error

	// SearchIssues searches for issues
	SearchIssues(ctx context.Context, repoID, query string) ([]IssueInfo, error)
}

IssueProvider is an interface for issue operations

type IssueTool

type IssueTool struct {
	// contains filtered or unexported fields
}

IssueTool provides AI capabilities for issue management

func NewIssueTool

func NewIssueTool(provider IssueProvider) *IssueTool

NewIssueTool creates a new issue management tool

func (*IssueTool) Description

func (i *IssueTool) Description() string

Description returns the tool description

func (*IssueTool) Execute

func (i *IssueTool) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute runs the issue tool

func (*IssueTool) Name

func (i *IssueTool) Name() string

Name returns the tool name

func (*IssueTool) Parameters

func (i *IssueTool) Parameters() map[string]interface{}

Parameters returns the tool's parameter schema

type RepoSummarizer

type RepoSummarizer struct {
	// contains filtered or unexported fields
}

RepoSummarizer is a tool for summarizing repository structure and content

func NewRepoSummarizer

func NewRepoSummarizer() *RepoSummarizer

NewRepoSummarizer creates a new repository summarizer tool

func (*RepoSummarizer) Description

func (r *RepoSummarizer) Description() string

Description returns the tool description

func (*RepoSummarizer) Execute

func (r *RepoSummarizer) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute runs the repository summarizer

func (*RepoSummarizer) Name

func (r *RepoSummarizer) Name() string

Name returns the tool name

func (*RepoSummarizer) Parameters

func (r *RepoSummarizer) Parameters() map[string]interface{}

Parameters returns the tool's parameter schema

type RepositoryProvider

type RepositoryProvider interface {
	// ListFiles lists files in a repository
	ListFiles(ctx context.Context, repoID, path, branch string) ([]FileInfo, error)

	// GetFile retrieves a file's content
	GetFile(ctx context.Context, repoID, path, branch string) (string, error)

	// GetCommits retrieves commit history
	GetCommits(ctx context.Context, repoID, branch string, limit int) ([]CommitInfo, error)

	// GetBranches lists repository branches
	GetBranches(ctx context.Context, repoID string) ([]string, string, error)

	// SearchCode searches for code patterns
	SearchCode(ctx context.Context, repoID, searchTerm string, limit int) ([]SearchResult, error)
}

RepositoryProvider is an interface for repository operations This allows tools to work with repositories without depending on specific implementations

type RepositoryTool

type RepositoryTool struct {
	// contains filtered or unexported fields
}

RepositoryTool provides AI capabilities for repository operations

func NewRepositoryTool

func NewRepositoryTool(provider RepositoryProvider) *RepositoryTool

NewRepositoryTool creates a new repository tool

func (*RepositoryTool) Description

func (r *RepositoryTool) Description() string

Description returns the tool description

func (*RepositoryTool) Execute

func (r *RepositoryTool) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute runs the repository tool

func (*RepositoryTool) Name

func (r *RepositoryTool) Name() string

Name returns the tool name

func (*RepositoryTool) Parameters

func (r *RepositoryTool) Parameters() map[string]interface{}

Parameters returns the tool's parameter schema

type SearchResult

type SearchResult struct {
	File       string
	LineNumber int
	Content    string
}

SearchResult represents a code search result

Jump to

Keyboard shortcuts

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