Documentation
¶
Overview ¶
Browser, Canvas, and Nodes tools (mock implementations)
Edit Tool - precise in-file replacements ¶
Exec Tool - run shell commands ¶
Memory Tool - vector memory tool (FAISS/SQLite)
Package tools - OpenClaw-Go tool invocation framework ¶
Provides exec, read, write, process, edit, memory, web, browser, sessions tools Also provides adapter-based plugin system for dynamic tool loading
Process Tool - manage running processes with optional PTY ¶
Read Tool - read file content ¶
Sessions tools - session management ¶
Tools module - tool invocation framework ¶
Web search and fetch tools ¶
Write Tool - create or overwrite files
Index ¶
- func DetectCategory(text string) string
- func ErrorResult(toolName string, err error) map[string]interface{}
- func FindRelevantMemories(store *memory.VectorMemoryStore, prompt string, limit int) ([]memory.MemoryResult, error)
- func FormatMemoriesForContext(results []memory.MemoryResult) string
- func FormatToolResult(toolName string, result interface{}) map[string]interface{}
- func GetBool(args map[string]interface{}, key string) bool
- func GetFloat64(args map[string]interface{}, key string) float64
- func GetInt(args map[string]interface{}, key string) int
- func GetString(args map[string]interface{}, key string) string
- func NewAdapterRegistry(workspace string) *adapter.ToolAdapter
- func ParseArgs(argsJSON string) (map[string]interface{}, error)
- func ParseToolCalls(response map[string]interface{}) []map[string]interface{}
- func RegisterBuiltinWithAdapter(a *adapter.ToolAdapter)
- func ShouldCapture(text string) bool
- func Summarize(s string, maxLen int) string
- func Truncate(s string, maxLen int) string
- type AgentsListTool
- type BrowserTool
- type CanvasTool
- type EditError
- type EditResult
- type EditTool
- type EditToolWrapper
- func (w *EditToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *EditToolWrapper) HealthCheck() error
- func (w *EditToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *EditToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *EditToolWrapper) Shutdown() error
- type ExecError
- type ExecResult
- type ExecTool
- type ExecToolWrapper
- func (w *ExecToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *ExecToolWrapper) HealthCheck() error
- func (w *ExecToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *ExecToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *ExecToolWrapper) Shutdown() error
- type MemoryGetTool
- type MemorySearchResult
- type MemoryStoreTool
- type MemoryTool
- type MemoryToolWrapper
- func (w *MemoryToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *MemoryToolWrapper) HealthCheck() error
- func (w *MemoryToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *MemoryToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *MemoryToolWrapper) Shutdown() error
- type NodesTool
- type ProcessInfo
- type ProcessLogResult
- type ProcessStartResult
- type ProcessTool
- type ProcessToolWrapper
- func (w *ProcessToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *ProcessToolWrapper) HealthCheck() error
- func (w *ProcessToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *ProcessToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *ProcessToolWrapper) Shutdown() error
- type PulseAgentInterface
- type PulseTool
- type ReadError
- type ReadResult
- type ReadTool
- type ReadToolWrapper
- func (w *ReadToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *ReadToolWrapper) HealthCheck() error
- func (w *ReadToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *ReadToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *ReadToolWrapper) Shutdown() error
- type Registry
- type SessionStatusTool
- type SessionsHistoryTool
- type SessionsListTool
- type SessionsSendTool
- type SessionsSpawnTool
- type Tool
- type WebFetchTool
- type WebFetchToolWrapper
- func (w *WebFetchToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *WebFetchToolWrapper) HealthCheck() error
- func (w *WebFetchToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *WebFetchToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *WebFetchToolWrapper) Shutdown() error
- type WebSearchTool
- type WebSearchToolWrapper
- func (w *WebSearchToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *WebSearchToolWrapper) HealthCheck() error
- func (w *WebSearchToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *WebSearchToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *WebSearchToolWrapper) Shutdown() error
- type WriteError
- type WriteResult
- type WriteTool
- type WriteToolWrapper
- func (w *WriteToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
- func (w *WriteToolWrapper) HealthCheck() error
- func (w *WriteToolWrapper) Initialize(cfg map[string]interface{}) error
- func (w *WriteToolWrapper) PluginInfo() adapter.PluginInfo
- func (w *WriteToolWrapper) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectCategory ¶
func ErrorResult ¶
ErrorResult returns an error payload
func FindRelevantMemories ¶
func FindRelevantMemories(store *memory.VectorMemoryStore, prompt string, limit int) ([]memory.MemoryResult, error)
FindRelevantMemories to find relevant memories (auto recall)
func FormatMemoriesForContext ¶
func FormatMemoriesForContext(results []memory.MemoryResult) string
Format memories for context injection
func FormatToolResult ¶
FormatToolResult formats tool result as a message
func GetFloat64 ¶
GetFloat64 gets a float arg
func NewAdapterRegistry ¶
func NewAdapterRegistry(workspace string) *adapter.ToolAdapter
NewAdapterRegistry creates a new plugin-based adapter registry This enables dynamic tool loading and plugin support
func ParseToolCalls ¶
ParseToolCalls parse OpenAI tool_calls response
func RegisterBuiltinWithAdapter ¶
func RegisterBuiltinWithAdapter(a *adapter.ToolAdapter)
RegisterBuiltinWithAdapter registers all built-in tools with the adapter
func ShouldCapture ¶
Types ¶
type AgentsListTool ¶
type AgentsListTool struct{}
Agents List Tool
func NewAgentsListTool ¶
func NewAgentsListTool() *AgentsListTool
func (*AgentsListTool) Description ¶
func (t *AgentsListTool) Description() string
func (*AgentsListTool) Execute ¶
func (t *AgentsListTool) Execute(args map[string]interface{}) (interface{}, error)
func (*AgentsListTool) Name ¶
func (t *AgentsListTool) Name() string
func (*AgentsListTool) Parameters ¶
func (t *AgentsListTool) Parameters() map[string]interface{}
type BrowserTool ¶
type BrowserTool struct {
// contains filtered or unexported fields
}
func NewBrowserTool ¶
func NewBrowserTool() *BrowserTool
func (*BrowserTool) Description ¶
func (t *BrowserTool) Description() string
func (*BrowserTool) Execute ¶
func (t *BrowserTool) Execute(args map[string]interface{}) (interface{}, error)
func (*BrowserTool) Name ¶
func (t *BrowserTool) Name() string
func (*BrowserTool) Parameters ¶
func (t *BrowserTool) Parameters() map[string]interface{}
type CanvasTool ¶
type CanvasTool struct{}
Canvas Tool (mock)
func NewCanvasTool ¶
func NewCanvasTool() *CanvasTool
func (*CanvasTool) Description ¶
func (t *CanvasTool) Description() string
func (*CanvasTool) Execute ¶
func (t *CanvasTool) Execute(args map[string]interface{}) (interface{}, error)
func (*CanvasTool) Name ¶
func (t *CanvasTool) Name() string
func (*CanvasTool) Parameters ¶
func (t *CanvasTool) Parameters() map[string]interface{}
type EditResult ¶
type EditTool ¶
type EditTool struct{}
func (*EditTool) Description ¶
func (*EditTool) Parameters ¶
type EditToolWrapper ¶
type EditToolWrapper struct{}
func (*EditToolWrapper) Execute ¶
func (w *EditToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*EditToolWrapper) HealthCheck ¶
func (w *EditToolWrapper) HealthCheck() error
func (*EditToolWrapper) Initialize ¶
func (w *EditToolWrapper) Initialize(cfg map[string]interface{}) error
func (*EditToolWrapper) PluginInfo ¶
func (w *EditToolWrapper) PluginInfo() adapter.PluginInfo
func (*EditToolWrapper) Shutdown ¶
func (w *EditToolWrapper) Shutdown() error
type ExecResult ¶
type ExecTool ¶
type ExecTool struct{}
func (*ExecTool) Description ¶
func (*ExecTool) Parameters ¶
type ExecToolWrapper ¶
type ExecToolWrapper struct{}
func (*ExecToolWrapper) Execute ¶
func (w *ExecToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*ExecToolWrapper) HealthCheck ¶
func (w *ExecToolWrapper) HealthCheck() error
func (*ExecToolWrapper) Initialize ¶
func (w *ExecToolWrapper) Initialize(cfg map[string]interface{}) error
func (*ExecToolWrapper) PluginInfo ¶
func (w *ExecToolWrapper) PluginInfo() adapter.PluginInfo
func (*ExecToolWrapper) Shutdown ¶
func (w *ExecToolWrapper) Shutdown() error
type MemoryGetTool ¶
type MemoryGetTool struct {
Store *memory.VectorMemoryStore
}
func NewMemoryGetTool ¶
func NewMemoryGetTool(store *memory.VectorMemoryStore) *MemoryGetTool
func (*MemoryGetTool) Description ¶
func (t *MemoryGetTool) Description() string
func (*MemoryGetTool) Execute ¶
func (t *MemoryGetTool) Execute(args map[string]interface{}) (interface{}, error)
func (*MemoryGetTool) Name ¶
func (t *MemoryGetTool) Name() string
func (*MemoryGetTool) Parameters ¶
func (t *MemoryGetTool) Parameters() map[string]interface{}
type MemorySearchResult ¶
type MemoryStoreTool ¶
type MemoryStoreTool struct {
Store *memory.VectorMemoryStore
}
func NewMemoryStoreTool ¶
func NewMemoryStoreTool(store *memory.VectorMemoryStore) *MemoryStoreTool
func (*MemoryStoreTool) Description ¶
func (t *MemoryStoreTool) Description() string
func (*MemoryStoreTool) Execute ¶
func (t *MemoryStoreTool) Execute(args map[string]interface{}) (interface{}, error)
func (*MemoryStoreTool) Name ¶
func (t *MemoryStoreTool) Name() string
func (*MemoryStoreTool) Parameters ¶
func (t *MemoryStoreTool) Parameters() map[string]interface{}
type MemoryTool ¶
type MemoryTool struct {
Store *memory.VectorMemoryStore
}
func NewMemoryTool ¶
func NewMemoryTool(store *memory.VectorMemoryStore) *MemoryTool
func (*MemoryTool) Description ¶
func (t *MemoryTool) Description() string
func (*MemoryTool) Execute ¶
func (t *MemoryTool) Execute(args map[string]interface{}) (interface{}, error)
func (*MemoryTool) Name ¶
func (t *MemoryTool) Name() string
func (*MemoryTool) Parameters ¶
func (t *MemoryTool) Parameters() map[string]interface{}
type MemoryToolWrapper ¶
type MemoryToolWrapper struct{}
func (*MemoryToolWrapper) Execute ¶
func (w *MemoryToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*MemoryToolWrapper) HealthCheck ¶
func (w *MemoryToolWrapper) HealthCheck() error
func (*MemoryToolWrapper) Initialize ¶
func (w *MemoryToolWrapper) Initialize(cfg map[string]interface{}) error
func (*MemoryToolWrapper) PluginInfo ¶
func (w *MemoryToolWrapper) PluginInfo() adapter.PluginInfo
func (*MemoryToolWrapper) Shutdown ¶
func (w *MemoryToolWrapper) Shutdown() error
type NodesTool ¶
type NodesTool struct{}
Nodes Tool (mock)
func NewNodesTool ¶
func NewNodesTool() *NodesTool
func (*NodesTool) Description ¶
func (*NodesTool) Parameters ¶
type ProcessInfo ¶
type ProcessLogResult ¶
type ProcessStartResult ¶
type ProcessTool ¶
type ProcessTool struct{}
func (*ProcessTool) Description ¶
func (t *ProcessTool) Description() string
func (*ProcessTool) Execute ¶
func (t *ProcessTool) Execute(args map[string]interface{}) (interface{}, error)
func (*ProcessTool) Name ¶
func (t *ProcessTool) Name() string
func (*ProcessTool) Parameters ¶
func (t *ProcessTool) Parameters() map[string]interface{}
type ProcessToolWrapper ¶
type ProcessToolWrapper struct{}
func (*ProcessToolWrapper) Execute ¶
func (w *ProcessToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*ProcessToolWrapper) HealthCheck ¶
func (w *ProcessToolWrapper) HealthCheck() error
func (*ProcessToolWrapper) Initialize ¶
func (w *ProcessToolWrapper) Initialize(cfg map[string]interface{}) error
func (*ProcessToolWrapper) PluginInfo ¶
func (w *ProcessToolWrapper) PluginInfo() adapter.PluginInfo
func (*ProcessToolWrapper) Shutdown ¶
func (w *ProcessToolWrapper) Shutdown() error
type PulseAgentInterface ¶
type PulseAgentInterface interface {
AddPulseEvent(title string, content string, priority int, channel string) (int64, error)
GetPulseStatus() (map[string]interface{}, error)
}
PulseAgentInterface defines the interface for pulse functionality
type PulseTool ¶
type PulseTool struct {
// contains filtered or unexported fields
}
PulseTool allows adding events to the pulse system
func NewPulseTool ¶
func NewPulseTool(a PulseAgentInterface) *PulseTool
NewPulseTool creates a new pulse tool
func (*PulseTool) Description ¶
func (*PulseTool) Parameters ¶
type ReadResult ¶
type ReadTool ¶
type ReadTool struct{}
func (*ReadTool) Description ¶
func (*ReadTool) Parameters ¶
type ReadToolWrapper ¶
type ReadToolWrapper struct{}
func (*ReadToolWrapper) Execute ¶
func (w *ReadToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*ReadToolWrapper) HealthCheck ¶
func (w *ReadToolWrapper) HealthCheck() error
func (*ReadToolWrapper) Initialize ¶
func (w *ReadToolWrapper) Initialize(cfg map[string]interface{}) error
func (*ReadToolWrapper) PluginInfo ¶
func (w *ReadToolWrapper) PluginInfo() adapter.PluginInfo
func (*ReadToolWrapper) Shutdown ¶
func (w *ReadToolWrapper) Shutdown() error
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds registered tools
func NewDefaultRegistry ¶
func NewDefaultRegistry() *Registry
NewDefaultRegistry creates the default registry and registers all tools
func NewMemoryRegistry ¶
func NewMemoryRegistry(store *memory.VectorMemoryStore) *Registry
NewMemoryRegistry creates a registry with memory store
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) GetToolSpecs ¶
GetToolSpecs returns OpenAI-format specs with function wrapper
type SessionStatusTool ¶
type SessionStatusTool struct{}
Session Status Tool
func NewSessionStatusTool ¶
func NewSessionStatusTool() *SessionStatusTool
func (*SessionStatusTool) Description ¶
func (t *SessionStatusTool) Description() string
func (*SessionStatusTool) Execute ¶
func (t *SessionStatusTool) Execute(args map[string]interface{}) (interface{}, error)
func (*SessionStatusTool) Name ¶
func (t *SessionStatusTool) Name() string
func (*SessionStatusTool) Parameters ¶
func (t *SessionStatusTool) Parameters() map[string]interface{}
type SessionsHistoryTool ¶
type SessionsHistoryTool struct{}
Sessions History Tool - fetch history
func NewSessionsHistoryTool ¶
func NewSessionsHistoryTool() *SessionsHistoryTool
func (*SessionsHistoryTool) Description ¶
func (t *SessionsHistoryTool) Description() string
func (*SessionsHistoryTool) Execute ¶
func (t *SessionsHistoryTool) Execute(args map[string]interface{}) (interface{}, error)
func (*SessionsHistoryTool) Name ¶
func (t *SessionsHistoryTool) Name() string
func (*SessionsHistoryTool) Parameters ¶
func (t *SessionsHistoryTool) Parameters() map[string]interface{}
type SessionsListTool ¶
type SessionsListTool struct{}
func NewSessionsListTool ¶
func NewSessionsListTool() *SessionsListTool
func (*SessionsListTool) Description ¶
func (t *SessionsListTool) Description() string
func (*SessionsListTool) Execute ¶
func (t *SessionsListTool) Execute(args map[string]interface{}) (interface{}, error)
func (*SessionsListTool) Name ¶
func (t *SessionsListTool) Name() string
func (*SessionsListTool) Parameters ¶
func (t *SessionsListTool) Parameters() map[string]interface{}
type SessionsSendTool ¶
type SessionsSendTool struct{}
Sessions Send Tool - send message to another session
func NewSessionsSendTool ¶
func NewSessionsSendTool() *SessionsSendTool
func (*SessionsSendTool) Description ¶
func (t *SessionsSendTool) Description() string
func (*SessionsSendTool) Execute ¶
func (t *SessionsSendTool) Execute(args map[string]interface{}) (interface{}, error)
func (*SessionsSendTool) Name ¶
func (t *SessionsSendTool) Name() string
func (*SessionsSendTool) Parameters ¶
func (t *SessionsSendTool) Parameters() map[string]interface{}
type SessionsSpawnTool ¶
type SessionsSpawnTool struct{}
Sessions Spawn Tool - start a sub-session
func NewSessionsSpawnTool ¶
func NewSessionsSpawnTool() *SessionsSpawnTool
func (*SessionsSpawnTool) Description ¶
func (t *SessionsSpawnTool) Description() string
func (*SessionsSpawnTool) Execute ¶
func (t *SessionsSpawnTool) Execute(args map[string]interface{}) (interface{}, error)
func (*SessionsSpawnTool) Name ¶
func (t *SessionsSpawnTool) Name() string
func (*SessionsSpawnTool) Parameters ¶
func (t *SessionsSpawnTool) Parameters() map[string]interface{}
type Tool ¶
type Tool interface {
Name() string
Description() string
Parameters() map[string]interface{}
Execute(args map[string]interface{}) (interface{}, error)
}
Tool defines the tool interface
type WebFetchTool ¶
type WebFetchTool struct{}
Web Fetch Tool - fetch and extract readable content
func NewWebFetchTool ¶
func NewWebFetchTool() *WebFetchTool
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(args map[string]interface{}) (interface{}, error)
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
func (*WebFetchTool) Parameters ¶
func (t *WebFetchTool) Parameters() map[string]interface{}
type WebFetchToolWrapper ¶
type WebFetchToolWrapper struct{}
func (*WebFetchToolWrapper) Execute ¶
func (w *WebFetchToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*WebFetchToolWrapper) HealthCheck ¶
func (w *WebFetchToolWrapper) HealthCheck() error
func (*WebFetchToolWrapper) Initialize ¶
func (w *WebFetchToolWrapper) Initialize(cfg map[string]interface{}) error
func (*WebFetchToolWrapper) PluginInfo ¶
func (w *WebFetchToolWrapper) PluginInfo() adapter.PluginInfo
func (*WebFetchToolWrapper) Shutdown ¶
func (w *WebFetchToolWrapper) Shutdown() error
type WebSearchTool ¶
type WebSearchTool struct{}
func NewWebSearchTool ¶
func NewWebSearchTool() *WebSearchTool
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(args map[string]interface{}) (interface{}, error)
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
func (*WebSearchTool) Parameters ¶
func (t *WebSearchTool) Parameters() map[string]interface{}
type WebSearchToolWrapper ¶
type WebSearchToolWrapper struct{}
func (*WebSearchToolWrapper) Execute ¶
func (w *WebSearchToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*WebSearchToolWrapper) HealthCheck ¶
func (w *WebSearchToolWrapper) HealthCheck() error
func (*WebSearchToolWrapper) Initialize ¶
func (w *WebSearchToolWrapper) Initialize(cfg map[string]interface{}) error
func (*WebSearchToolWrapper) PluginInfo ¶
func (w *WebSearchToolWrapper) PluginInfo() adapter.PluginInfo
func (*WebSearchToolWrapper) Shutdown ¶
func (w *WebSearchToolWrapper) Shutdown() error
type WriteError ¶
type WriteError struct {
Message string
}
func (*WriteError) Error ¶
func (e *WriteError) Error() string
type WriteResult ¶
type WriteTool ¶
type WriteTool struct{}
func (*WriteTool) Description ¶
func (*WriteTool) Parameters ¶
type WriteToolWrapper ¶
type WriteToolWrapper struct{}
func (*WriteToolWrapper) Execute ¶
func (w *WriteToolWrapper) Execute(args map[string]interface{}) (interface{}, error)
func (*WriteToolWrapper) HealthCheck ¶
func (w *WriteToolWrapper) HealthCheck() error
func (*WriteToolWrapper) Initialize ¶
func (w *WriteToolWrapper) Initialize(cfg map[string]interface{}) error
func (*WriteToolWrapper) PluginInfo ¶
func (w *WriteToolWrapper) PluginInfo() adapter.PluginInfo
func (*WriteToolWrapper) Shutdown ¶
func (w *WriteToolWrapper) Shutdown() error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adapter - Tool plugin adapter system Provides plugin-based tool loading with hot-reload support
|
Package adapter - Tool plugin adapter system Provides plugin-based tool loading with hot-reload support |
|
Package plugin provides plugin utilities for the tool adapter
|
Package plugin provides plugin utilities for the tool adapter |