Documentation
¶
Index ¶
- Constants
- Variables
- func NewAgentTool(sessions session.Service, messages message.Service, ...) tools.BaseTool
- func NewToolSet(ctx context.Context, info *agentregistry.AgentInfo, reg agentregistry.Registry, ...) <-chan tools.BaseTool
- type AgentEvent
- type AgentEventType
- type AgentParamsdeprecated
- type MCPClient
- type MCPRegistry
- type MCPRegistryFiler
- type Service
- type TaskParams
Constants ¶
View Source
const (
AutoCompactionThreshold = 0.95
)
View Source
const (
TaskToolName = "task"
)
Variables ¶
View Source
var ( ErrRequestCancelled = errors.New("request cancelled by user") ErrSessionBusy = errors.New("session is currently processing another request") //go:embed prompts/*.md AgentPrompts embed.FS )
Common errors
Functions ¶
func NewAgentTool ¶
func NewToolSet ¶
func NewToolSet( ctx context.Context, info *agentregistry.AgentInfo, reg agentregistry.Registry, permissions permission.Service, historyService history.Service, lspClients map[string]*lsp.Client, sessions session.Service, messages message.Service, mcpRegistry MCPRegistry, ) <-chan tools.BaseTool
NewToolSet dynamically builds the tool slice for an agent based on its registry info. Only tools that pass registry.IsToolEnabled are included.
Types ¶
type AgentEvent ¶
type AgentEventType ¶
type AgentEventType string
const ( AgentEventTypeError AgentEventType = "error" AgentEventTypeResponse AgentEventType = "response" AgentEventTypeSummarize AgentEventType = "summarize" )
type AgentParams
deprecated
type AgentParams = TaskParams
Deprecated: use TaskParams instead
type MCPClient ¶
type MCPClient interface {
Initialize(
ctx context.Context,
request mcp.InitializeRequest,
) (*mcp.InitializeResult, error)
ListTools(ctx context.Context, request mcp.ListToolsRequest) (*mcp.ListToolsResult, error)
CallTool(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
Close() error
}
type MCPRegistry ¶
type MCPRegistry interface {
// GetTools return tools matching filter, if registry is not loaded it will begin loading
LoadTools(ctx context.Context, filter *MCPRegistryFiler) <-chan tools.BaseTool
// StartClient starts a new MCPClient, caller have to properly close when done
StartClient(ctx context.Context, name string) (c *client.Client, err error)
}
func NewMCPRegistry ¶
func NewMCPRegistry(permissions permission.Service, agentRegistry agentregistry.Registry) MCPRegistry
type MCPRegistryFiler ¶
type Service ¶
type Service interface {
pubsub.Suscriber[AgentEvent]
AgentID() config.AgentName
Model() models.Model
Run(ctx context.Context, sessionID string, content string, attachments ...message.Attachment) (<-chan AgentEvent, error)
Cancel(sessionID string)
IsSessionBusy(sessionID string) bool
IsBusy() bool
Update(agentName config.AgentName, modelID models.ModelID) (models.Model, error)
Summarize(ctx context.Context, sessionID string) error
}
func NewAgent ¶
func NewAgent( ctx context.Context, agentInfo *agentregistry.AgentInfo, sessions session.Service, messages message.Service, permissions permission.Service, historyService history.Service, lspClients map[string]*lsp.Client, reg agentregistry.Registry, mcpReg MCPRegistry, ) (Service, error)
Click to show internal directories.
Click to hide internal directories.