Documentation
¶
Index ¶
- Constants
- func GetAgentID(ctx context.Context) config.AgentName
- func GetContextValues(ctx context.Context) (string, string)
- func IsTaskAgent(ctx context.Context) bool
- func NewEmptyResponse() toolResponse
- func NewImageResponse(content string) toolResponse
- func NewTextErrorResponse(content string) toolResponse
- func NewTextResponse(content string) toolResponse
- func WithResponseMetadata(response toolResponse, metadata any) toolResponse
- type BaseTool
- func NewBashTool(permission permission.Service, reg agentregistry.Registry) BaseTool
- func NewDeleteTool(permissions permission.Service, files history.Service, ...) BaseTool
- func NewEditTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewFetchTool(permissions permission.Service) BaseTool
- func NewGlobTool() BaseTool
- func NewGrepTool() BaseTool
- func NewLsTool(cfg config.Configurator) BaseTool
- func NewLspTool(lspClients map[string]*lsp.Client) BaseTool
- func NewMultiEditTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewPatchTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewSkillTool(permissions permission.Service, reg agentregistry.Registry) BaseTool
- func NewSourcegraphTool() BaseTool
- func NewViewImageTool() BaseTool
- func NewViewTool(lspClients map[string]*lsp.Client) BaseTool
- func NewWriteTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- type BashParams
- type BashPermissionsParams
- type BashResponseMetadata
- type DeleteParams
- type DeletePermissionsParams
- type DeleteResponseMetadata
- type EditParams
- type EditPermissionsParams
- type EditResponseMetadata
- type FetchParams
- type FetchPermissionsParams
- type GlobParams
- type GlobResponseMetadata
- type GrepParams
- type GrepResponseMetadata
- type LSPToolMetadata
- type LSParams
- type LSResponseMetadata
- type LineScanner
- type LspParams
- type MultiEditItem
- type MultiEditParams
- type MultiEditResponseMetadata
- type PatchParams
- type PatchResponseMetadata
- type SkillParams
- type SourcegraphParams
- type SourcegraphResponseMetadata
- type ToolCall
- type ToolInfo
- type ToolResponse
- type TreeNode
- type ViewImageParams
- type ViewImageResponseMetadata
- type ViewParams
- type ViewResponseMetadata
- type WriteParams
- type WritePermissionsParams
- type WriteResponseMetadata
Constants ¶
View Source
const ( BashToolName = "bash" DefaultTimeout = 2 * 60 * 1000 // 2 minutes in milliseconds MaxTimeout = 10 * 60 * 1000 // 10 minutes in milliseconds MaxOutputBytes = 50 * 1024 // 50KB MaxOutputLines = 2000 )
View Source
const ( LSToolName = "ls" MaxLSFiles = 1000 )
View Source
const ( ToolResponseTypeText toolResponseType = "text" ToolResponseTypeImage toolResponseType = "image" SessionIDContextKey sessionIDContextKey = "session_id" MessageIDContextKey messageIDContextKey = "message_id" IsTaskAgentContextKey isTaskAgentContextKey = "is_task_agent" AgentIDContextKey agentIDContextKey = "agent_id" // MaxToolResponseTokens is the maximum number of tokens allowed in a tool response // to prevent context overflow. ~1200KB of text content. MaxToolResponseTokens = 300_000 )
View Source
const ( ViewToolName = "view" MaxReadSize = 250 * 1024 DefaultReadLimit = 2000 MaxLineLength = 2000 )
View Source
const ( ViewImageToolName = "view_image" MaxImageSize = 5 * 1024 * 1024 // 5MB )
View Source
const (
DeleteToolName = "delete"
)
View Source
const (
EditToolName = "edit"
)
View Source
const (
FetchToolName = "fetch"
)
View Source
const (
GlobToolName = "glob"
)
View Source
const (
GrepToolName = "grep"
)
View Source
const (
LSPToolName = "lsp"
)
View Source
const (
MultiEditToolName = "multiedit"
)
View Source
const (
PatchToolName = "patch"
)
View Source
const (
SkillToolName = "skill"
)
View Source
const (
SourcegraphToolName = "sourcegraph"
)
View Source
const (
WriteToolName = "write"
)
Variables ¶
This section is empty.
Functions ¶
func GetAgentID ¶
GetAgentID returns the agent name from context, or empty string if not set
func IsTaskAgent ¶
IsTaskAgent returns true if the context indicates this is a task agent
func NewEmptyResponse ¶
func NewEmptyResponse() toolResponse
func NewImageResponse ¶
func NewImageResponse(content string) toolResponse
func NewTextErrorResponse ¶
func NewTextErrorResponse(content string) toolResponse
func NewTextResponse ¶
func NewTextResponse(content string) toolResponse
func WithResponseMetadata ¶
func WithResponseMetadata(response toolResponse, metadata any) toolResponse
Types ¶
type BaseTool ¶
type BaseTool interface {
Info() ToolInfo
Run(ctx context.Context, params ToolCall) (ToolResponse, error)
}
func NewBashTool ¶
func NewBashTool(permission permission.Service, reg agentregistry.Registry) BaseTool
func NewDeleteTool ¶
func NewDeleteTool(permissions permission.Service, files history.Service, reg agentregistry.Registry) BaseTool
func NewEditTool ¶
func NewEditTool( lspClients map[string]*lsp.Client, permissions permission.Service, files history.Service, reg agentregistry.Registry, ) BaseTool
func NewFetchTool ¶
func NewFetchTool(permissions permission.Service) BaseTool
func NewGlobTool ¶
func NewGlobTool() BaseTool
func NewGrepTool ¶
func NewGrepTool() BaseTool
func NewLsTool ¶
func NewLsTool(cfg config.Configurator) BaseTool
func NewMultiEditTool ¶
func NewMultiEditTool(lspClients map[string]*lsp.Client, permissions permission.Service, files history.Service, reg agentregistry.Registry) BaseTool
func NewPatchTool ¶
func NewPatchTool(lspClients map[string]*lsp.Client, permissions permission.Service, files history.Service, reg agentregistry.Registry) BaseTool
func NewSkillTool ¶
func NewSkillTool(permissions permission.Service, reg agentregistry.Registry) BaseTool
NewSkillTool creates a new skill tool instance.
func NewSourcegraphTool ¶
func NewSourcegraphTool() BaseTool
func NewViewImageTool ¶
func NewViewImageTool() BaseTool
func NewWriteTool ¶
func NewWriteTool(lspClients map[string]*lsp.Client, permissions permission.Service, files history.Service, reg agentregistry.Registry) BaseTool
type BashParams ¶
type BashPermissionsParams ¶
type BashResponseMetadata ¶
type DeleteParams ¶
type DeleteParams struct {
Path string `json:"path"`
}
type DeletePermissionsParams ¶
type DeleteResponseMetadata ¶
type EditParams ¶
type EditPermissionsParams ¶
type EditResponseMetadata ¶
type FetchParams ¶
type FetchPermissionsParams ¶
type GlobParams ¶
type GlobResponseMetadata ¶
type GrepParams ¶
type GrepResponseMetadata ¶
type LSPToolMetadata ¶
type LSPToolMetadata struct {
Title string `json:"title"`
}
type LSResponseMetadata ¶
type LineScanner ¶
type LineScanner struct {
// contains filtered or unexported fields
}
func NewLineScanner ¶
func NewLineScanner(r io.Reader) *LineScanner
func (*LineScanner) Err ¶
func (s *LineScanner) Err() error
func (*LineScanner) Scan ¶
func (s *LineScanner) Scan() bool
func (*LineScanner) Text ¶
func (s *LineScanner) Text() string
type MultiEditItem ¶
type MultiEditParams ¶
type MultiEditParams struct {
FilePath string `json:"file_path"`
Edits []MultiEditItem `json:"edits"`
}
type PatchParams ¶
type PatchParams struct {
PatchText string `json:"patch_text"`
}
type PatchResponseMetadata ¶
type SkillParams ¶
type SkillParams struct {
Name string `json:"name"`
}
type SourcegraphParams ¶
type ToolResponse ¶
type ToolResponse = toolResponse
ToolResponse is the public interface for tool responses
type ViewImageParams ¶
type ViewImageParams struct {
FilePath string `json:"file_path"`
}
type ViewParams ¶
type ViewResponseMetadata ¶
type WriteParams ¶
type WritePermissionsParams ¶
type WriteResponseMetadata ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.