Versions in this module Expand all Collapse all v1 v1.0.0 Sep 16, 2026 Changes in this version + const BM25SearchToolName + const MaxReadFileSize + const MaxRegexPatternLength + const RegexSearchToolName + const ToolPromptLayerCapability + const ToolPromptSlotMCP + const ToolPromptSlotTooling + const ToolPromptSourceDiscovery + const ToolPromptSourceRegistry + var ErrNoStdin = errors.New("no stdin available") + var ErrPTYNotSupported = errors.New("PTY is not supported on this platform") + var ErrSessionDone = errors.New("session already completed") + var ErrSessionNotFound = errors.New("session not found") + func ResolveWebSearchProviderName(opts WebSearchToolOptions, query string) (string, error) + func ToolAgentID(ctx context.Context) string + func ToolChannel(ctx context.Context) string + func ToolChatID(ctx context.Context) string + func ToolMessageID(ctx context.Context) string + func ToolReplyToMessageID(ctx context.Context) string + func ToolSessionKey(ctx context.Context) string + func ToolSessionScope(ctx context.Context) *session.SessionScope + func ToolToSchema(tool Tool) map[string]any + func WebSearchProviderReady(opts WebSearchToolOptions, name string) bool + func WithToolContext(ctx context.Context, channel, chatID string) context.Context + func WithToolInboundContext(ctx context.Context, channel, chatID, messageID, replyToMessageID string) context.Context + func WithToolMessageContext(ctx context.Context, messageID, replyToMessageID string) context.Context + func WithToolSessionContext(ctx context.Context, agentID, sessionKey string, scope *session.SessionScope) context.Context + type APIKeyIterator = integrationtools.APIKeyIterator + type APIKeyPool = integrationtools.APIKeyPool + func NewAPIKeyPool(keys []string) *APIKeyPool + type AppendFileTool = fstools.AppendFileTool + func NewAppendFileTool(workspace string, restrict bool, allowPaths ...[]*regexp.Regexp) *AppendFileTool + type AsyncCallback = toolshared.AsyncCallback + type AsyncExecutor = toolshared.AsyncExecutor + type BM25SearchTool struct + func NewBM25SearchTool(r *ToolRegistry, ttl int, maxSearchResults int) *BM25SearchTool + func (t *BM25SearchTool) Description() string + func (t *BM25SearchTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *BM25SearchTool) Name() string + func (t *BM25SearchTool) Parameters() map[string]any + func (t *BM25SearchTool) PromptMetadata() PromptMetadata + type BaiduSearchProvider = integrationtools.BaiduSearchProvider + type BraveSearchProvider = integrationtools.BraveSearchProvider + type CronTool struct + func NewCronTool(cronService *cron.CronService, executor JobExecutor, msgBus *bus.MessageBus, ...) (*CronTool, error) + func (t *CronTool) Description() string + func (t *CronTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string + func (t *CronTool) Name() string + func (t *CronTool) Parameters() map[string]any + type DelegateTool struct + func NewDelegateTool() *DelegateTool + func (t *DelegateTool) Description() string + func (t *DelegateTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *DelegateTool) Name() string + func (t *DelegateTool) Parameters() map[string]any + func (t *DelegateTool) SetAllowlistChecker(check func(targetAgentID string) bool) + func (t *DelegateTool) SetSelfAgentID(id string) + func (t *DelegateTool) SetSpawner(spawner SubTurnSpawner) + type DuckDuckGoSearchProvider = integrationtools.DuckDuckGoSearchProvider + type EditFileTool = fstools.EditFileTool + func NewEditFileTool(workspace string, restrict bool, allowPaths ...[]*regexp.Regexp) *EditFileTool + type ExecRequest = toolshared.ExecRequest + type ExecResponse = toolshared.ExecResponse + type ExecTool struct + func NewExecTool(workingDir string, restrict bool, allowPaths ...[]*regexp.Regexp) (*ExecTool, error) + func NewExecToolWithConfig(workingDir string, restrict bool, cfg *config.Config, ...) (*ExecTool, error) + func (t *ExecTool) Description() string + func (t *ExecTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *ExecTool) Name() string + func (t *ExecTool) Parameters() map[string]any + func (t *ExecTool) SetAllowPatterns(patterns []string) error + func (t *ExecTool) SetRestrictToWorkspace(restrict bool) + func (t *ExecTool) SetTimeout(timeout time.Duration) + type FindSkillsTool = integrationtools.FindSkillsTool + func NewFindSkillsTool(registryMgr *skills.RegistryManager, cache *skills.SearchCache) *FindSkillsTool + type FunctionCall = toolshared.FunctionCall + type GLMSearchProvider = integrationtools.GLMSearchProvider + type GeminiSearchProvider = integrationtools.GeminiSearchProvider + type HiddenToolDoc struct + Description string + Name string + type HiddenToolSnapshot struct + Docs []HiddenToolDoc + Version uint64 + type I2CTool = hardwaretools.I2CTool + func NewI2CTool() *I2CTool + type InstallSkillTool = integrationtools.InstallSkillTool + func NewInstallSkillTool(registryMgr *skills.RegistryManager, workspace string) *InstallSkillTool + type JobExecutor interface + ProcessDirectWithChannel func(ctx context.Context, content, sessionKey, channel, chatID string) (string, error) + PublishResponseIfNeeded func(ctx context.Context, channel, chatID, sessionKey, response string) + type LLMProvider = toolshared.LLMProvider + type LLMResponse = toolshared.LLMResponse + type ListDirTool = fstools.ListDirTool + func NewListDirTool(workspace string, restrict bool, allowPaths ...[]*regexp.Regexp) *ListDirTool + type LoadImageTool = fstools.LoadImageTool + func NewLoadImageTool(workspace string, restrict bool, maxFileSize int, store media.MediaStore, ...) *LoadImageTool + type MCPManager = integrationtools.MCPManager + type MCPTool = integrationtools.MCPTool + func NewMCPTool(manager MCPManager, serverName string, tool *mcp.Tool) *MCPTool + type Message = toolshared.Message + type MessageTool = integrationtools.MessageTool + func NewMessageTool() *MessageTool + type PerplexitySearchProvider = integrationtools.PerplexitySearchProvider + type ProcessSession struct + Background bool + Command string + ExitCode int + ID string + PID int + PTY bool + StartTime int64 + Status string + func (s *ProcessSession) GetExitCode() int + func (s *ProcessSession) GetPtyKeyMode() PtyKeyMode + func (s *ProcessSession) GetStatus() string + func (s *ProcessSession) IsDone() bool + func (s *ProcessSession) Kill() error + func (s *ProcessSession) Read() string + func (s *ProcessSession) SetExitCode(code int) + func (s *ProcessSession) SetPtyKeyMode(mode PtyKeyMode) + func (s *ProcessSession) SetStatus(status string) + func (s *ProcessSession) ToSessionInfo() SessionInfo + func (s *ProcessSession) Write(data string) error + type PromptMetadata = toolshared.PromptMetadata + type PromptMetadataProvider = toolshared.PromptMetadataProvider + type PtyKeyMode uint8 + const PtyKeyModeCSI + const PtyKeyModeNotFound + const PtyKeyModeSS3 + type ReactionCallback = integrationtools.ReactionCallback + type ReactionTool = integrationtools.ReactionTool + func NewReactionTool() *ReactionTool + type ReadFileLinesTool = fstools.ReadFileLinesTool + func NewReadFileLinesTool(workspace string, restrict bool, maxReadFileSize int, ...) *ReadFileLinesTool + type ReadFileTool = fstools.ReadFileTool + func NewReadFileBytesTool(workspace string, restrict bool, maxReadFileSize int, ...) *ReadFileTool + func NewReadFileTool(workspace string, restrict bool, maxReadFileSize int, ...) *ReadFileTool + type RegexSearchTool struct + func NewRegexSearchTool(r *ToolRegistry, ttl int, maxSearchResults int) *RegexSearchTool + func (t *RegexSearchTool) Description() string + func (t *RegexSearchTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *RegexSearchTool) Name() string + func (t *RegexSearchTool) Parameters() map[string]any + func (t *RegexSearchTool) PromptMetadata() PromptMetadata + type SPITool = hardwaretools.SPITool + func NewSPITool() *SPITool + type SearXNGSearchProvider = integrationtools.SearXNGSearchProvider + type SearchProvider = integrationtools.SearchProvider + type SearchResultItem = integrationtools.SearchResultItem + type SendCallbackWithContext = integrationtools.SendCallbackWithContext + type SendFileTool = fstools.SendFileTool + func NewSendFileTool(workspace string, restrict bool, maxFileSize int, store media.MediaStore, ...) *SendFileTool + type SendTTSTool = integrationtools.SendTTSTool + func NewSendTTSTool(provider tts.TTSProvider, store media.MediaStore) *SendTTSTool + type SerialTool = hardwaretools.SerialTool + func NewSerialTool() *SerialTool + type SessionInfo = toolshared.SessionInfo + type SessionManager struct + func NewSessionManager() *SessionManager + func (sm *SessionManager) Add(session *ProcessSession) + func (sm *SessionManager) Get(sessionID string) (*ProcessSession, error) + func (sm *SessionManager) List() []SessionInfo + func (sm *SessionManager) Remove(sessionID string) + func (sm *SessionManager) Stop() + type SogouSearchProvider = integrationtools.SogouSearchProvider + type SpawnStatusTool struct + func NewSpawnStatusTool(manager *SubagentManager) *SpawnStatusTool + func (t *SpawnStatusTool) Description() string + func (t *SpawnStatusTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *SpawnStatusTool) Name() string + func (t *SpawnStatusTool) Parameters() map[string]any + type SpawnSubTurnFunc func(ctx context.Context, task, label, agentID string, tools *ToolRegistry, ...) (*ToolResult, error) + type SpawnTool struct + func NewSpawnTool(manager *SubagentManager) *SpawnTool + func (t *SpawnTool) Description() string + func (t *SpawnTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *SpawnTool) ExecuteAsync(ctx context.Context, args map[string]any, cb AsyncCallback) *ToolResult + func (t *SpawnTool) Name() string + func (t *SpawnTool) Parameters() map[string]any + func (t *SpawnTool) SetAllowlistChecker(check func(targetAgentID string) bool) + func (t *SpawnTool) SetSpawner(spawner SubTurnSpawner) + type SubTurnConfig struct + ActualSystemPrompt string + Async bool + Critical bool + InitialMessages []providers.Message + InitialTokenBudget *atomic.Int64 + MaxContextRunes int + MaxTokens int + Model string + SystemPrompt string + TargetAgentID string + Temperature float64 + Timeout time.Duration + Tools []Tool + type SubTurnSpawner interface + SpawnSubTurn func(ctx context.Context, cfg SubTurnConfig) (*ToolResult, error) + type SubagentManager struct + func NewSubagentManager(provider providers.LLMProvider, defaultModel, workspace string) *SubagentManager + func (sm *SubagentManager) GetTask(taskID string) (*SubagentTask, bool) + func (sm *SubagentManager) GetTaskCopy(taskID string) (SubagentTask, bool) + func (sm *SubagentManager) ListTaskCopies() []SubagentTask + func (sm *SubagentManager) ListTasks() []*SubagentTask + func (sm *SubagentManager) RegisterTool(tool Tool) + func (sm *SubagentManager) SetLLMOptions(maxTokens int, temperature float64) + func (sm *SubagentManager) SetMediaResolver(resolver func([]providers.Message) []providers.Message) + func (sm *SubagentManager) SetSpawner(spawner SpawnSubTurnFunc) + func (sm *SubagentManager) SetTools(tools *ToolRegistry) + func (sm *SubagentManager) Spawn(ctx context.Context, task, label, agentID, originChannel, originChatID string, ...) (string, error) + type SubagentTask struct + AgentID string + Created int64 + ID string + Label string + OriginChannel string + OriginChatID string + Result string + Status string + Task string + type SubagentTool struct + func NewSubagentTool(manager *SubagentManager) *SubagentTool + func (t *SubagentTool) Description() string + func (t *SubagentTool) Execute(ctx context.Context, args map[string]any) *ToolResult + func (t *SubagentTool) Name() string + func (t *SubagentTool) Parameters() map[string]any + func (t *SubagentTool) SetSpawner(spawner SubTurnSpawner) + type TavilySearchProvider = integrationtools.TavilySearchProvider + type Tool = toolshared.Tool + type ToolCall = toolshared.ToolCall + type ToolDefinition = toolshared.ToolDefinition + type ToolEntry struct + IsCore bool + TTL int + Tool Tool + type ToolFunctionDefinition = toolshared.ToolFunctionDefinition + type ToolLoopConfig struct + LLMOptions map[string]any + MaxIterations int + MediaResolver func(messages []providers.Message) []providers.Message + Model string + Provider providers.LLMProvider + Tools *ToolRegistry + type ToolLoopResult struct + Content string + Iterations int + func RunToolLoop(ctx context.Context, config ToolLoopConfig, messages []providers.Message, ...) (*ToolLoopResult, error) + type ToolRegistry struct + func NewToolRegistry() *ToolRegistry + func (r *ToolRegistry) Clone() *ToolRegistry + func (r *ToolRegistry) Count() int + func (r *ToolRegistry) Execute(ctx context.Context, name string, args map[string]any) *ToolResult + func (r *ToolRegistry) ExecuteWithContext(ctx context.Context, name string, args map[string]any, channel, chatID string, ...) *ToolResult + func (r *ToolRegistry) Get(name string) (Tool, bool) + func (r *ToolRegistry) GetAll() []Tool + func (r *ToolRegistry) GetDefinitions() []map[string]any + func (r *ToolRegistry) GetSummaries() []string + func (r *ToolRegistry) HasRegistered(name string) bool + func (r *ToolRegistry) List() []string + func (r *ToolRegistry) PromoteTools(names []string, ttl int) + func (r *ToolRegistry) Register(tool Tool) + func (r *ToolRegistry) RegisterHidden(tool Tool) + func (r *ToolRegistry) SearchBM25(query string, maxSearchResults int) []ToolSearchResult + func (r *ToolRegistry) SearchRegex(pattern string, maxSearchResults int) ([]ToolSearchResult, error) + func (r *ToolRegistry) SetAllowlist(names []string) + func (r *ToolRegistry) SetMediaStore(store media.MediaStore) + func (r *ToolRegistry) SnapshotHiddenTools() HiddenToolSnapshot + func (r *ToolRegistry) TickTTL() + func (r *ToolRegistry) ToProviderDefs() []providers.ToolDefinition + func (r *ToolRegistry) Version() uint64 + type ToolResult = toolshared.ToolResult + func AsyncResult(forLLM string) *ToolResult + func DiffResult(path string, before, after []byte) *ToolResult + func ErrorResult(message string) *ToolResult + func MediaResult(forLLM string, mediaRefs []string) *ToolResult + func NewToolResult(forLLM string) *ToolResult + func SilentResult(forLLM string) *ToolResult + func UserResult(content string) *ToolResult + type ToolSearchResult struct + Description string + Name string + type UsageInfo = toolshared.UsageInfo + type WebFetchTool = integrationtools.WebFetchTool + func NewWebFetchTool(maxChars int, format string, fetchLimitBytes int64) (*WebFetchTool, error) + func NewWebFetchToolWithConfig(maxChars int, proxy string, format string, fetchLimitBytes int64, ...) (*WebFetchTool, error) + func NewWebFetchToolWithProxy(maxChars int, proxy string, format string, fetchLimitBytes int64, ...) (*WebFetchTool, error) + type WebSearchTool = integrationtools.WebSearchTool + func NewWebSearchTool(opts WebSearchToolOptions) (*WebSearchTool, error) + type WebSearchToolOptions = integrationtools.WebSearchToolOptions + func WebSearchToolOptionsFromConfig(cfg *config.Config) WebSearchToolOptions + type WriteFileTool = fstools.WriteFileTool + func NewWriteFileTool(workspace string, restrict bool, allowPaths ...[]*regexp.Regexp) *WriteFileTool