tools

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTool

func ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (any, error)

func GetInternalTools

func GetInternalTools() ([]tool.Tool, error)

Types

type DiffFile

type DiffFile struct {
	Header     string
	SourceFile string
	TargetFile string
	IsBinary   bool
	Hunks      []DiffHunk
}

type DiffHunk

type DiffHunk struct {
	SourceStart   int
	SourceLength  int
	TargetStart   int
	TargetLength  int
	SectionHeader string
	Lines         []DiffLine
}

type DiffLine

type DiffLine struct {
	Type         string // " ", "+", "-"
	SourceLineNo int
	TargetLineNo int
	Content      string
}

type FilterJsonArgs

type FilterJsonArgs struct {
	JsonData        interface{} `json:"json_data" jsonschema:"The JSON data to filter. Can be a JSON string, a list of dicts, or a dict."`
	FieldsToExtract []string    `json:"fields_to_extract" jsonschema:"A list of fields to extract. Use dot notation for nested fields."`
}

type FilterJsonResult

type FilterJsonResult struct {
	Result interface{} `json:"result"`
}

func FilterJson

func FilterJson(ctx tool.Context, args FilterJsonArgs) (FilterJsonResult, error)

type GitDiffAddLineNumbersArgs

type GitDiffAddLineNumbersArgs struct {
	DiffContent string `json:"diff_content" jsonschema:"The diff or patch content to add line numbers to"`
}

GitDiffAddLineNumbersArgs defines arguments for git_diff_add_line_numbers

type GitDiffAddLineNumbersResult

type GitDiffAddLineNumbersResult struct {
	FormattedDiff string `json:"formatted_diff"`
}

GitDiffAddLineNumbersResult defines the result for git_diff_add_line_numbers

func GitDiffAddLineNumbers

func GitDiffAddLineNumbers(ctx tool.Context, args GitDiffAddLineNumbersArgs) (GitDiffAddLineNumbersResult, error)

GitDiffAddLineNumbers parses a PR diff string or a patch snippet and adds line numbers

type ReadFileArgs

type ReadFileArgs struct {
	Path string `json:"path" jsonschema:"The path to the file to read"`
}

type ReadFileResult

type ReadFileResult struct {
	Content string `json:"content"`
}

func ReadFile

func ReadFile(ctx tool.Context, args ReadFileArgs) (ReadFileResult, error)

type ShellCommandArgs

type ShellCommandArgs struct {
	Command string `json:"command" jsonschema:"The shell command to execute"`
}

type ShellCommandResult

type ShellCommandResult struct {
	Stdout string `json:"stdout"`
}

func ShellCommand

func ShellCommand(ctx tool.Context, args ShellCommandArgs) (ShellCommandResult, error)

type WriteFileArgs added in v1.0.5

type WriteFileArgs struct {
	FilePath string      `json:"file_path" jsonschema:"The path to the file where content will be written."`
	Content  interface{} `json:"content" jsonschema:"The content to write to the file. Can be a single string or a list of strings."`
}

type WriteFileResult added in v1.0.5

type WriteFileResult struct {
	Message string `json:"message"`
}

func WriteFile added in v1.0.5

func WriteFile(ctx tool.Context, args WriteFileArgs) (WriteFileResult, error)

Jump to

Keyboard shortcuts

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