tool

package
v0.0.0-...-7edc2c7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllTools

func AllTools() (res []llm.Tool)

func Bash

func Bash(input BashInput) string

func Cat

func Cat(input CatInput) string

func Create

func Create(input CreateInput) (string, error)

func Git

func Git(input GitInput) string

func Insert

func Insert(input InsertInput) (string, error)

func ListFiles

func ListFiles(input FileListInput) string

func NewLSPAgentTool

func NewLSPAgentTool(ctx context.Context, command string, root string) ([]llm.Tool, func(), error)

func NewMcpAgentTool

func NewMcpAgentTool(ctx context.Context, command string, args []string) ([]llm.Tool, func(), error)

func ProcessParams

func ProcessParams(callback any, cb func(name string, t reflect.Type, desc string))

func Skill

func Skill(input SkillInput) string

Skill loads the named skill and returns its instructions.

func SkillToolDescription

func SkillToolDescription() string

SkillToolDescription returns the dynamic description for the Skill tool, including the catalog of currently available skills.

func ToAgentTool

func ToAgentTool[I any](name string, desc string, f func(I) (string, error)) llm.Tool

Types

type BashInput

type BashInput struct {
	Command string `json:"command" description:"The bash command to execute"`
}

type CatInput

type CatInput struct {
	Path   string `json:"path" description:"The path of the file to read"`
	Offset int    `json:"offset" description:"Optional line number to start reading from (0-based)"`
	Limit  int    `json:"limit" description:"Optional maximum number of lines to read"`
}

CatInput defines the input parameters for the Cat tool

type CreateInput

type CreateInput struct {
	Path     string `json:"path" description:"The path of the file to be written"`
	FileText string `json:"file_text" description:"The file content to write to the specified path"`
}

type FileListInput

type FileListInput struct {
	Path      string `json:"path" description:"The directory path to list files from"`
	Recursive bool   `json:"recursive" description:"Whether to list files recursively (including subdirectories)"`
	Pattern   string `json:"pattern" description:"Optional glob pattern to filter files (e.g., *.go, *.md)"`
}

FileListInput defines the input parameters for the Files tool

type GitInput

type GitInput struct {
	Command string `json:"command" description:"The git command to execute including git itself as. For example: git status"`
}

type InsertInput

type InsertInput struct {
	Path       string `json:"path" description:"The path of the file where the content should be written to."`
	InsertLine int    `json:"insert_line" description:"The line number at which to insert the new content (0-based index)."`
	NewStr     string `json:"new_str" description:"The file content to write to the specified path"`
}

type LSPServer

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

func NewLSPServer

func NewLSPServer(ctx context.Context, command string, root string) (*LSPServer, error)

func (*LSPServer) Close

func (s *LSPServer) Close()

func (*LSPServer) Symbols

func (s *LSPServer) Symbols(i SymbolInput) (string, error)

type McpAgentTool

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

func NewMcpAgentToolMethod

func NewMcpAgentToolMethod(session *mcp.ClientSession, tool *mcp.Tool) *McpAgentTool

func (McpAgentTool) Info

func (m McpAgentTool) Info() llm.ToolInfo

func (McpAgentTool) Run

func (m McpAgentTool) Run(ctx context.Context, params llm.ToolCall) (llm.ToolResult, error)

type SkillInput

type SkillInput struct {
	Name string `json:"name" description:"The exact name of the skill to load, as listed in the tool description."`
}

SkillInput defines the input parameters for the Skill tool.

type SymbolInput

type SymbolInput struct {
	Paths []string `json:"path" description:"Relative path of the source files from the actual current directory, to list all including symbols."`
}

Jump to

Keyboard shortcuts

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