tools

package
v0.0.0-...-ac4fcd6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitDiffTool

type GitDiffTool struct{}

func (*GitDiffTool) Description

func (t *GitDiffTool) Description() string

func (*GitDiffTool) Execute

func (t *GitDiffTool) Execute(args map[string]any) (any, error)

func (*GitDiffTool) Name

func (t *GitDiffTool) Name() string

func (*GitDiffTool) Schema

func (t *GitDiffTool) Schema() map[string]any

type GitGrepTool

type GitGrepTool struct{}

func (*GitGrepTool) Description

func (t *GitGrepTool) Description() string

func (*GitGrepTool) Execute

func (t *GitGrepTool) Execute(args map[string]any) (any, error)

func (*GitGrepTool) Name

func (t *GitGrepTool) Name() string

func (*GitGrepTool) Schema

func (t *GitGrepTool) Schema() map[string]any

type GoParser

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

func NewGoParser

func NewGoParser() (*GoParser, error)

func (*GoParser) Language

func (gp *GoParser) Language() string

func (*GoParser) ParseFile

func (gp *GoParser) ParseFile(filePath string, content []byte) ([]types.Symbol, error)

func (*GoParser) Parser

func (gp *GoParser) Parser() *sitter.Parser

func (*GoParser) ShouldExcludeFile

func (gp *GoParser) ShouldExcludeFile(filePath, projectRoot string) bool

func (*GoParser) SitterLanguage

func (gp *GoParser) SitterLanguage() *sitter.Language

func (*GoParser) SupportedExtensions

func (gp *GoParser) SupportedExtensions() []string

type HumanLoopTool

type HumanLoopTool struct{}

func (*HumanLoopTool) Description

func (t *HumanLoopTool) Description() string

func (*HumanLoopTool) Execute

func (t *HumanLoopTool) Execute(args map[string]any) (any, error)

func (*HumanLoopTool) Name

func (t *HumanLoopTool) Name() string

func (*HumanLoopTool) Schema

func (t *HumanLoopTool) Schema() map[string]any

type JavaParser

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

func NewJavaParser

func NewJavaParser() (*JavaParser, error)

func (*JavaParser) Language

func (jp *JavaParser) Language() string

func (*JavaParser) ParseFile

func (jp *JavaParser) ParseFile(filePath string, content []byte) ([]types.Symbol, error)

func (*JavaParser) Parser

func (jp *JavaParser) Parser() *sitter.Parser

func (*JavaParser) ShouldExcludeFile

func (jp *JavaParser) ShouldExcludeFile(filePath, projectRoot string) bool

func (*JavaParser) SitterLanguage

func (jp *JavaParser) SitterLanguage() *sitter.Language

func (*JavaParser) SupportedExtensions

func (jp *JavaParser) SupportedExtensions() []string

type LanguageParser

type LanguageParser interface {
	// ParseFile extracts all symbols (functions, types, variables, etc.) from a file
	ParseFile(filePath string, content []byte) ([]types.Symbol, error)

	// SupportedExtensions returns the file extensions this parser can handle
	SupportedExtensions() []string

	// Language returns the human-readable name of the language this parser handles
	Language() string

	// ShouldExcludeFile determines if a file should be excluded from symbol context gathering
	// This allows language-specific filtering (e.g., Go excludes *_test.go, JS excludes node_modules)
	ShouldExcludeFile(filePath, projectRoot string) bool
}

type ParserRegistry

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

func NewParserRegistry

func NewParserRegistry() *ParserRegistry

func (*ParserRegistry) GetParser

func (pr *ParserRegistry) GetParser(filePath string) LanguageParser

func (*ParserRegistry) IsKnownLanguage

func (pr *ParserRegistry) IsKnownLanguage(filePath string) bool

func (*ParserRegistry) ParseFile

func (pr *ParserRegistry) ParseFile(filePath string, content []byte) ([]types.Symbol, error)

func (*ParserRegistry) RegisterParser

func (pr *ParserRegistry) RegisterParser(parser LanguageParser)

type ReadFileTool

type ReadFileTool struct{}

func (*ReadFileTool) Description

func (t *ReadFileTool) Description() string

func (*ReadFileTool) Execute

func (t *ReadFileTool) Execute(args map[string]any) (any, error)

func (*ReadFileTool) Name

func (t *ReadFileTool) Name() string

func (*ReadFileTool) Schema

func (t *ReadFileTool) Schema() map[string]any

type SymbolContextGatherer

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

func NewSymbolContextGatherer

func NewSymbolContextGatherer(registry *ParserRegistry) *SymbolContextGatherer

func (*SymbolContextGatherer) GatherSymbolContext

func (g *SymbolContextGatherer) GatherSymbolContext(affectedSymbols []types.SymbolUsage, projectRoot, primaryLanguage string) error

type SymbolContextTool

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

func NewSymbolContextTool

func NewSymbolContextTool(projectRoot string, registry *ParserRegistry) *SymbolContextTool

func (*SymbolContextTool) Description

func (t *SymbolContextTool) Description() string

func (*SymbolContextTool) Execute

func (t *SymbolContextTool) Execute(args map[string]any) (any, error)

func (*SymbolContextTool) Name

func (t *SymbolContextTool) Name() string

func (*SymbolContextTool) Schema

func (t *SymbolContextTool) Schema() map[string]any

type Tool

type Tool interface {
	Name() string
	Description() string
	Schema() map[string]any
	Execute(args map[string]any) (any, error)
}

type ToolName

type ToolName string
const (
	ToolNameGitDiff       ToolName = "git_diff"
	ToolNameReadFile      ToolName = "read_file"
	ToolNameSymbolContext ToolName = "symbol_context"
	ToolNameWriteFile     ToolName = "write_file"
	ToolNameGitGrep       ToolName = "git_grep"
	ToolNameHumanLoop     ToolName = "human_loop"
)

type ToolRegistry

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

func NewToolRegistry

func NewToolRegistry() *ToolRegistry

func (*ToolRegistry) Get

func (r *ToolRegistry) Get(name ToolName) Tool

func (*ToolRegistry) GetAll

func (r *ToolRegistry) GetAll() map[ToolName]Tool

func (*ToolRegistry) GetAllAsList

func (r *ToolRegistry) GetAllAsList() []Tool

func (*ToolRegistry) Register

func (r *ToolRegistry) Register(name ToolName, tool Tool)

type TypeScriptParser

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

func NewTypeScriptParser

func NewTypeScriptParser() (*TypeScriptParser, error)

func (*TypeScriptParser) Language

func (tp *TypeScriptParser) Language() string

func (*TypeScriptParser) ParseFile

func (tp *TypeScriptParser) ParseFile(filePath string, content []byte) ([]types.Symbol, error)

func (*TypeScriptParser) Parser

func (tp *TypeScriptParser) Parser() *sitter.Parser

func (*TypeScriptParser) ShouldExcludeFile

func (tp *TypeScriptParser) ShouldExcludeFile(filePath, projectRoot string) bool

func (*TypeScriptParser) SitterLanguage

func (tp *TypeScriptParser) SitterLanguage() *sitter.Language

func (*TypeScriptParser) SupportedExtensions

func (tp *TypeScriptParser) SupportedExtensions() []string

type WriteFileTool

type WriteFileTool struct{}

func (*WriteFileTool) Description

func (t *WriteFileTool) Description() string

func (*WriteFileTool) Execute

func (t *WriteFileTool) Execute(args map[string]any) (any, error)

func (*WriteFileTool) Name

func (t *WriteFileTool) Name() string

func (*WriteFileTool) Schema

func (t *WriteFileTool) Schema() map[string]any

Jump to

Keyboard shortcuts

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