Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAgentSessionKey(agentID, taskID string) string
- func EventRecordID(runID, eventType string, at int64) string
- func ExpandToolAllowlistEntries(entries []string) []string
- func IsTerminalRuntimeStatus(status string) bool
- func IsWorldDecisionTask(task *AgentTask) bool
- func MapBoolArg(args map[string]interface{}, key string) (bool, bool)
- func MapIntArg(args map[string]interface{}, key string, fallback int) int
- func MapObjectArg(args map[string]interface{}, key string) map[string]interface{}
- func MapRawStringArg(args map[string]interface{}, key string) string
- func MapStringArg(args map[string]interface{}, key string) string
- func MapStringListArg(args map[string]interface{}, key string) []string
- func OriginValues(in *OriginRef) (string, string)
- func ParseMCPDynamicToolName(name string) (serverName string, remoteName string, ok bool)
- func PromptFileFromPolicy(policy *ExecutionPolicy) string
- func TargetNodeID(target *TargetRef) string
- func TargetParentAgentID(target *TargetRef) string
- func TargetTransport(target *TargetRef) string
- func ToolAllowlistFromPolicy(policy *ExecutionPolicy) []string
- func ToolToSchema(tool Tool) map[string]interface{}
- type AgentDispatchReply
- type AgentDispatchRequest
- type AgentDispatcher
- func (r *AgentDispatcher) DispatchTask(ctx context.Context, req AgentDispatchRequest) (*AgentTask, error)
- func (r *AgentDispatcher) MergeResults(replies []*AgentDispatchReply) string
- func (r *AgentDispatcher) WaitReply(ctx context.Context, taskID string, interval time.Duration) (*AgentDispatchReply, error)
- type AgentMailboxStore
- func (s *AgentMailboxStore) AppendMessage(msg AgentMessage) (AgentMessage, error)
- func (s *AgentMailboxStore) EnsureThreadID(threadID string) string
- func (s *AgentMailboxStore) Inbox(agentID string, limit int) ([]AgentMessage, error)
- func (s *AgentMailboxStore) Message(messageID string) (*AgentMessage, bool)
- func (s *AgentMailboxStore) ThreadInbox(threadID, agentID string, limit int) ([]AgentMessage, error)
- func (s *AgentMailboxStore) UpdateMessageStatus(messageID, status string, at int64) (*AgentMessage, error)
- type AgentManager
- func (sm *AgentManager) Events(taskID string, limit int) ([]AgentRunEvent, error)
- func (sm *AgentManager) GetTask(taskID string) (*AgentTask, bool)
- func (sm *AgentManager) HasProvider() bool
- func (sm *AgentManager) Inbox(agentID string, limit int) ([]AgentMessage, error)
- func (sm *AgentManager) ListTasks() []*AgentTask
- func (sm *AgentManager) NextTaskSequence() int
- func (sm *AgentManager) ProfileStore() *AgentProfileStore
- func (sm *AgentManager) ResolveMemoryNamespace(agentID string) string
- func (sm *AgentManager) RuntimeSnapshot(limit int) RuntimeSnapshot
- func (sm *AgentManager) SendAgentMessage(fromAgent, toAgent, messageType, content, threadID string) (AgentMessage, error)
- func (sm *AgentManager) SetRunFunc(f AgentRunFunc)
- func (sm *AgentManager) Spawn(ctx context.Context, opts AgentSpawnOptions) (string, error)
- func (sm *AgentManager) SpawnTask(ctx context.Context, opts AgentSpawnOptions) (*AgentTask, error)
- func (sm *AgentManager) WaitTask(ctx context.Context, taskID string) (*AgentTask, bool, error)
- type AgentMessage
- type AgentProfile
- type AgentProfileStore
- func (s *AgentProfileStore) Delete(agentID string) error
- func (s *AgentProfileStore) FindByRole(role string) (*AgentProfile, bool, error)
- func (s *AgentProfileStore) Get(agentID string) (*AgentProfile, bool, error)
- func (s *AgentProfileStore) List() ([]AgentProfile, error)
- func (s *AgentProfileStore) Upsert(profile AgentProfile) (*AgentProfile, error)
- type AgentProfileTool
- type AgentRunEvent
- type AgentRunFunc
- type AgentRunStore
- func (s *AgentRunStore) AppendEvent(evt AgentRunEvent) error
- func (s *AgentRunStore) AppendRun(task *AgentTask) error
- func (s *AgentRunStore) Events(runID string, limit int) ([]AgentRunEvent, error)
- func (s *AgentRunStore) Get(runID string) (*AgentTask, bool)
- func (s *AgentRunStore) List() []*AgentTask
- func (s *AgentRunStore) NextIDSeed() int
- type AgentSpawnOptions
- type AgentTask
- type AliasTool
- type BrowserTool
- type CameraTool
- type CatalogTool
- type CronTool
- type DispatchDecision
- type EditFileTool
- type EventRecord
- type ExecTool
- type ExecutionPolicy
- type ExecutionRun
- type FunctionCall
- type LLMProvider
- type LLMResponse
- type ListDirTool
- type MCPRemoteTool
- func (t *MCPRemoteTool) CatalogEntry() map[string]interface{}
- func (t *MCPRemoteTool) Description() string
- func (t *MCPRemoteTool) Execute(ctx context.Context, args map[string]interface{}) (string, error)
- func (t *MCPRemoteTool) Name() string
- func (t *MCPRemoteTool) Parameters() map[string]interface{}
- type MCPTool
- type MemoryGetTool
- type MemorySearchTool
- type MemoryWriteTool
- type Message
- type MessageTool
- func (t *MessageTool) Description() string
- func (t *MessageTool) Execute(ctx context.Context, args map[string]interface{}) (string, error)
- func (t *MessageTool) Name() string
- func (t *MessageTool) Parameters() map[string]interface{}
- func (t *MessageTool) SetContext(channel, chatID string)
- func (t *MessageTool) SetSendCallback(callback SendCallback)
- type NodesTool
- type OriginRef
- type ParallelFetchTool
- type ParallelSafeTool
- type ParallelTool
- type ProcessEvent
- type ProcessManager
- func (m *ProcessManager) Get(id string) (*processSession, bool)
- func (m *ProcessManager) Kill(id string) error
- func (m *ProcessManager) List() []map[string]interface{}
- func (m *ProcessManager) Log(id string, offset, limit int) (string, error)
- func (m *ProcessManager) Start(parent context.Context, command, cwd string) (string, error)
- func (m *ProcessManager) SubscribeEvents(buffer int) <-chan ProcessEvent
- type ProcessTool
- type ReadFileTool
- type RemindTool
- type RepoMapTool
- type ResourceScopedTool
- type RunRecord
- type RuntimeError
- type RuntimeSnapshot
- type SendCallback
- type SessionInfo
- type SessionsTool
- type SkillExecTool
- type SystemInfoTool
- type TargetRef
- type TaskRecord
- type Tool
- type ToolAllowlistGroup
- type ToolCall
- type ToolDefinition
- type ToolFunctionDefinition
- type ToolRegistry
- func (r *ToolRegistry) Catalog() []map[string]interface{}
- func (r *ToolRegistry) Count() int
- func (r *ToolRegistry) Execute(ctx context.Context, name string, args map[string]interface{}) (string, error)
- func (r *ToolRegistry) Get(name string) (Tool, bool)
- func (r *ToolRegistry) GetDefinitions() []map[string]interface{}
- func (r *ToolRegistry) GetSummaries() []string
- func (r *ToolRegistry) List() []string
- func (r *ToolRegistry) Register(tool Tool)
- type UsageInfo
- type WebFetchTool
- type WebSearchTool
- type WorldDecisionContext
- type WorldTool
- type WorldToolRuntime
- type WriteFileTool
Constants ¶
const ( RuntimeStatusPending = "pending" RuntimeStatusRouting = "routing" RuntimeStatusRunning = "running" RuntimeStatusWaiting = "waiting" RuntimeStatusCompleted = "completed" RuntimeStatusFailed = "failed" RuntimeStatusCancelled = "cancelled" RuntimeStatusRecovered = "recovered" )
const GlobalWatchdogTick = watchdogTick
Variables ¶
var ( ErrUnsupportedAction = errors.New("unsupported action") ErrMissingField = errors.New("missing required field") )
var ErrCommandNoProgress = errors.New("command no progress across tick rounds")
var ErrTaskWatchdogTimeout = errors.New("task watchdog timeout exceeded")
Functions ¶
func BuildAgentSessionKey ¶ added in v0.0.4
func EventRecordID ¶ added in v0.0.3
func IsTerminalRuntimeStatus ¶ added in v0.0.3
func IsWorldDecisionTask ¶ added in v0.0.4
func MapBoolArg ¶ added in v0.0.3
func MapObjectArg ¶ added in v0.0.3
func MapRawStringArg ¶ added in v0.0.3
func MapStringArg ¶ added in v0.0.3
func MapStringListArg ¶ added in v0.0.3
func OriginValues ¶ added in v0.0.4
func ParseMCPDynamicToolName ¶
func PromptFileFromPolicy ¶ added in v0.0.4
func PromptFileFromPolicy(policy *ExecutionPolicy) string
func TargetNodeID ¶ added in v0.0.4
func TargetParentAgentID ¶ added in v0.0.4
func TargetTransport ¶ added in v0.0.4
func ToolAllowlistFromPolicy ¶ added in v0.0.4
func ToolAllowlistFromPolicy(policy *ExecutionPolicy) []string
func ToolToSchema ¶
Types ¶
type AgentDispatchReply ¶ added in v0.0.4
type AgentDispatchRequest ¶ added in v0.0.4
type AgentDispatchRequest struct {
Task string
RunKind string
AgentID string
Decision *DispatchDecision
Target *TargetRef
Origin *OriginRef
ExecutionPolicy *ExecutionPolicy
WorldDecision *WorldDecisionContext
}
type AgentDispatcher ¶ added in v0.0.4
type AgentDispatcher struct {
// contains filtered or unexported fields
}
func NewAgentDispatcher ¶ added in v0.0.4
func NewAgentDispatcher(manager *AgentManager) *AgentDispatcher
func (*AgentDispatcher) DispatchTask ¶ added in v0.0.4
func (r *AgentDispatcher) DispatchTask(ctx context.Context, req AgentDispatchRequest) (*AgentTask, error)
func (*AgentDispatcher) MergeResults ¶ added in v0.0.4
func (r *AgentDispatcher) MergeResults(replies []*AgentDispatchReply) string
func (*AgentDispatcher) WaitReply ¶ added in v0.0.4
func (r *AgentDispatcher) WaitReply(ctx context.Context, taskID string, interval time.Duration) (*AgentDispatchReply, error)
type AgentMailboxStore ¶
type AgentMailboxStore struct {
// contains filtered or unexported fields
}
func NewAgentMailboxStore ¶
func NewAgentMailboxStore(workspace string) *AgentMailboxStore
func (*AgentMailboxStore) AppendMessage ¶
func (s *AgentMailboxStore) AppendMessage(msg AgentMessage) (AgentMessage, error)
func (*AgentMailboxStore) EnsureThreadID ¶ added in v0.0.4
func (s *AgentMailboxStore) EnsureThreadID(threadID string) string
func (*AgentMailboxStore) Inbox ¶
func (s *AgentMailboxStore) Inbox(agentID string, limit int) ([]AgentMessage, error)
func (*AgentMailboxStore) Message ¶
func (s *AgentMailboxStore) Message(messageID string) (*AgentMessage, bool)
func (*AgentMailboxStore) ThreadInbox ¶
func (s *AgentMailboxStore) ThreadInbox(threadID, agentID string, limit int) ([]AgentMessage, error)
func (*AgentMailboxStore) UpdateMessageStatus ¶
func (s *AgentMailboxStore) UpdateMessageStatus(messageID, status string, at int64) (*AgentMessage, error)
type AgentManager ¶ added in v0.0.4
type AgentManager struct {
// contains filtered or unexported fields
}
func NewAgentManager ¶ added in v0.0.4
func NewAgentManager(provider providers.LLMProvider, workspace string, bus *bus.MessageBus) *AgentManager
func (*AgentManager) Events ¶ added in v0.0.4
func (sm *AgentManager) Events(taskID string, limit int) ([]AgentRunEvent, error)
func (*AgentManager) GetTask ¶ added in v0.0.4
func (sm *AgentManager) GetTask(taskID string) (*AgentTask, bool)
func (*AgentManager) HasProvider ¶ added in v0.0.4
func (sm *AgentManager) HasProvider() bool
func (*AgentManager) Inbox ¶ added in v0.0.4
func (sm *AgentManager) Inbox(agentID string, limit int) ([]AgentMessage, error)
func (*AgentManager) ListTasks ¶ added in v0.0.4
func (sm *AgentManager) ListTasks() []*AgentTask
func (*AgentManager) NextTaskSequence ¶ added in v0.0.4
func (sm *AgentManager) NextTaskSequence() int
func (*AgentManager) ProfileStore ¶ added in v0.0.4
func (sm *AgentManager) ProfileStore() *AgentProfileStore
func (*AgentManager) ResolveMemoryNamespace ¶ added in v0.0.4
func (sm *AgentManager) ResolveMemoryNamespace(agentID string) string
func (*AgentManager) RuntimeSnapshot ¶ added in v0.0.4
func (sm *AgentManager) RuntimeSnapshot(limit int) RuntimeSnapshot
func (*AgentManager) SendAgentMessage ¶ added in v0.0.4
func (sm *AgentManager) SendAgentMessage(fromAgent, toAgent, messageType, content, threadID string) (AgentMessage, error)
func (*AgentManager) SetRunFunc ¶ added in v0.0.4
func (sm *AgentManager) SetRunFunc(f AgentRunFunc)
func (*AgentManager) Spawn ¶ added in v0.0.4
func (sm *AgentManager) Spawn(ctx context.Context, opts AgentSpawnOptions) (string, error)
func (*AgentManager) SpawnTask ¶ added in v0.0.4
func (sm *AgentManager) SpawnTask(ctx context.Context, opts AgentSpawnOptions) (*AgentTask, error)
type AgentMessage ¶
type AgentProfile ¶ added in v0.0.4
type AgentProfile struct {
AgentID string `json:"agent_id"`
Name string `json:"name"`
Kind string `json:"kind,omitempty"`
Transport string `json:"transport,omitempty"`
NodeID string `json:"node_id,omitempty"`
ParentAgentID string `json:"parent_agent_id,omitempty"`
Role string `json:"role,omitempty"`
Persona string `json:"persona,omitempty"`
Traits []string `json:"traits,omitempty"`
Faction string `json:"faction,omitempty"`
HomeLocation string `json:"home_location,omitempty"`
DefaultGoals []string `json:"default_goals,omitempty"`
PerceptionScope int `json:"perception_scope,omitempty"`
ScheduleHint string `json:"schedule_hint,omitempty"`
WorldTags []string `json:"world_tags,omitempty"`
PromptFile string `json:"prompt_file,omitempty"`
ToolAllowlist []string `json:"tool_allowlist,omitempty"`
MemoryNamespace string `json:"memory_namespace,omitempty"`
MaxRetries int `json:"max_retries,omitempty"`
RetryBackoff int `json:"retry_backoff_ms,omitempty"`
TimeoutSec int `json:"timeout_sec,omitempty"`
MaxTaskChars int `json:"max_task_chars,omitempty"`
MaxResultChars int `json:"max_result_chars,omitempty"`
Status string `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
ManagedBy string `json:"managed_by,omitempty"`
}
type AgentProfileStore ¶ added in v0.0.4
type AgentProfileStore struct {
// contains filtered or unexported fields
}
func NewAgentProfileStore ¶ added in v0.0.4
func NewAgentProfileStore(workspace string) *AgentProfileStore
func (*AgentProfileStore) Delete ¶ added in v0.0.4
func (s *AgentProfileStore) Delete(agentID string) error
func (*AgentProfileStore) FindByRole ¶ added in v0.0.4
func (s *AgentProfileStore) FindByRole(role string) (*AgentProfile, bool, error)
func (*AgentProfileStore) Get ¶ added in v0.0.4
func (s *AgentProfileStore) Get(agentID string) (*AgentProfile, bool, error)
func (*AgentProfileStore) List ¶ added in v0.0.4
func (s *AgentProfileStore) List() ([]AgentProfile, error)
func (*AgentProfileStore) Upsert ¶ added in v0.0.4
func (s *AgentProfileStore) Upsert(profile AgentProfile) (*AgentProfile, error)
type AgentProfileTool ¶ added in v0.0.4
type AgentProfileTool struct {
// contains filtered or unexported fields
}
func NewAgentProfileTool ¶ added in v0.0.4
func NewAgentProfileTool(store *AgentProfileStore) *AgentProfileTool
func (*AgentProfileTool) Description ¶ added in v0.0.4
func (t *AgentProfileTool) Description() string
func (*AgentProfileTool) Name ¶ added in v0.0.4
func (t *AgentProfileTool) Name() string
func (*AgentProfileTool) Parameters ¶ added in v0.0.4
func (t *AgentProfileTool) Parameters() map[string]interface{}
type AgentRunEvent ¶ added in v0.0.4
type AgentRunFunc ¶ added in v0.0.4
type AgentRunStore ¶ added in v0.0.4
type AgentRunStore struct {
// contains filtered or unexported fields
}
func NewAgentRunStore ¶ added in v0.0.4
func NewAgentRunStore(workspace string) *AgentRunStore
func (*AgentRunStore) AppendEvent ¶ added in v0.0.4
func (s *AgentRunStore) AppendEvent(evt AgentRunEvent) error
func (*AgentRunStore) AppendRun ¶ added in v0.0.4
func (s *AgentRunStore) AppendRun(task *AgentTask) error
func (*AgentRunStore) Events ¶ added in v0.0.4
func (s *AgentRunStore) Events(runID string, limit int) ([]AgentRunEvent, error)
func (*AgentRunStore) Get ¶ added in v0.0.4
func (s *AgentRunStore) Get(runID string) (*AgentTask, bool)
func (*AgentRunStore) List ¶ added in v0.0.4
func (s *AgentRunStore) List() []*AgentTask
func (*AgentRunStore) NextIDSeed ¶ added in v0.0.4
func (s *AgentRunStore) NextIDSeed() int
type AgentSpawnOptions ¶ added in v0.0.4
type AgentSpawnOptions struct {
Task string
RunKind string
Role string
AgentID string
Target *TargetRef
ExecutionPolicy *ExecutionPolicy
Origin *OriginRef
WorldDecision *WorldDecisionContext
}
type AgentTask ¶ added in v0.0.4
type AgentTask struct {
ID string `json:"id"`
Task string `json:"task"`
RunKind string `json:"run_kind,omitempty"`
AgentID string `json:"agent_id"`
Target *TargetRef `json:"target,omitempty"`
ExecutionPolicy *ExecutionPolicy `json:"execution_policy,omitempty"`
RetryCount int `json:"retry_count,omitempty"`
WorldDecision *WorldDecisionContext `json:"world_decision,omitempty"`
Origin *OriginRef `json:"origin,omitempty"`
Status string `json:"status"`
Result string `json:"result,omitempty"`
Created int64 `json:"created"`
Updated int64 `json:"updated"`
}
type AliasTool ¶
type AliasTool struct {
// contains filtered or unexported fields
}
AliasTool exposes OpenClaw-compatible tool names while forwarding to existing implementations.
func NewAliasTool ¶
func (*AliasTool) Description ¶
func (*AliasTool) Parameters ¶
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) Name ¶
func (t *BrowserTool) Name() string
func (*BrowserTool) Parameters ¶
func (t *BrowserTool) Parameters() map[string]interface{}
type CameraTool ¶
type CameraTool struct {
// contains filtered or unexported fields
}
func NewCameraTool ¶
func NewCameraTool(workspace string) *CameraTool
func (*CameraTool) Description ¶
func (t *CameraTool) Description() string
func (*CameraTool) Name ¶
func (t *CameraTool) Name() string
func (*CameraTool) Parameters ¶
func (t *CameraTool) Parameters() map[string]interface{}
type CatalogTool ¶
type CatalogTool interface {
CatalogEntry() map[string]interface{}
}
type CronTool ¶
type CronTool struct {
// contains filtered or unexported fields
}
func NewCronTool ¶
func NewCronTool(cs *cron.CronService) *CronTool
func (*CronTool) Description ¶
func (*CronTool) Parameters ¶
type DispatchDecision ¶ added in v0.0.3
type DispatchDecision struct {
TargetAgent string `json:"target_agent,omitempty"`
Reason string `json:"reason,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
TaskText string `json:"task_text,omitempty"`
RouteSource string `json:"route_source,omitempty"`
}
func (DispatchDecision) Valid ¶ added in v0.0.3
func (d DispatchDecision) Valid() bool
type EditFileTool ¶
type EditFileTool struct {
// contains filtered or unexported fields
}
EditFileTool edits a file by replacing old_text with new_text. The old_text must exist exactly in the file.
func NewEditFileTool ¶
func NewEditFileTool(allowedDir string) *EditFileTool
func (*EditFileTool) Description ¶
func (t *EditFileTool) Description() string
func (*EditFileTool) Name ¶
func (t *EditFileTool) Name() string
func (*EditFileTool) Parameters ¶
func (t *EditFileTool) Parameters() map[string]interface{}
type EventRecord ¶ added in v0.0.3
type EventRecord struct {
ID string `json:"id,omitempty"`
RunID string `json:"run_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
AgentID string `json:"agent_id,omitempty"`
Type string `json:"type"`
Status string `json:"status,omitempty"`
Message string `json:"message,omitempty"`
RetryCount int `json:"retry_count,omitempty"`
Error *RuntimeError `json:"error,omitempty"`
At int64 `json:"ts"`
}
type ExecTool ¶
type ExecTool struct {
// contains filtered or unexported fields
}
func NewExecTool ¶
func NewExecTool(cfg config.ShellConfig, workspace string, pm *ProcessManager) *ExecTool
func (*ExecTool) Description ¶
func (*ExecTool) Parameters ¶
func (*ExecTool) SetTimeout ¶
type ExecutionPolicy ¶ added in v0.0.4
type ExecutionPolicy struct {
PromptFile string `json:"prompt_file,omitempty"`
ToolAllowlist []string `json:"tool_allowlist,omitempty"`
MaxRetries int `json:"max_retries,omitempty"`
RetryBackoff int `json:"retry_backoff,omitempty"`
TimeoutSec int `json:"timeout_sec,omitempty"`
MaxTaskChars int `json:"max_task_chars,omitempty"`
MaxResultChars int `json:"max_result_chars,omitempty"`
}
type ExecutionRun ¶ added in v0.0.3
type ExecutionRun struct {
Run RunRecord `json:"run"`
Task TaskRecord `json:"task"`
Decision DispatchDecision `json:"decision,omitempty"`
}
type FunctionCall ¶
type LLMProvider ¶
type LLMProvider interface {
Chat(ctx context.Context, messages []Message, tools []ToolDefinition, model string, options map[string]interface{}) (*LLMResponse, error)
GetDefaultModel() string
}
type LLMResponse ¶
type ListDirTool ¶
type ListDirTool struct {
// contains filtered or unexported fields
}
ListDirTool lists files and directories in a path.
func NewListDirTool ¶
func NewListDirTool(allowedDir string) *ListDirTool
func (*ListDirTool) Description ¶
func (t *ListDirTool) Description() string
func (*ListDirTool) Name ¶
func (t *ListDirTool) Name() string
func (*ListDirTool) Parameters ¶
func (t *ListDirTool) Parameters() map[string]interface{}
type MCPRemoteTool ¶
type MCPRemoteTool struct {
// contains filtered or unexported fields
}
func (*MCPRemoteTool) CatalogEntry ¶
func (t *MCPRemoteTool) CatalogEntry() map[string]interface{}
func (*MCPRemoteTool) Description ¶
func (t *MCPRemoteTool) Description() string
func (*MCPRemoteTool) Name ¶
func (t *MCPRemoteTool) Name() string
func (*MCPRemoteTool) Parameters ¶
func (t *MCPRemoteTool) Parameters() map[string]interface{}
type MCPTool ¶
type MCPTool struct {
// contains filtered or unexported fields
}
func NewMCPTool ¶
func NewMCPTool(workspace string, cfg config.MCPToolsConfig) *MCPTool
func (*MCPTool) Description ¶
func (*MCPTool) Parameters ¶
type MemoryGetTool ¶
type MemoryGetTool struct {
// contains filtered or unexported fields
}
func NewMemoryGetTool ¶
func NewMemoryGetTool(workspace string) *MemoryGetTool
func (*MemoryGetTool) Description ¶
func (t *MemoryGetTool) Description() string
func (*MemoryGetTool) Name ¶
func (t *MemoryGetTool) Name() string
func (*MemoryGetTool) Parameters ¶
func (t *MemoryGetTool) Parameters() map[string]interface{}
type MemorySearchTool ¶
type MemorySearchTool struct {
// contains filtered or unexported fields
}
func NewMemorySearchTool ¶
func NewMemorySearchTool(workspace string) *MemorySearchTool
func (*MemorySearchTool) Description ¶
func (t *MemorySearchTool) Description() string
func (*MemorySearchTool) Name ¶
func (t *MemorySearchTool) Name() string
func (*MemorySearchTool) Parameters ¶
func (t *MemorySearchTool) Parameters() map[string]interface{}
type MemoryWriteTool ¶
type MemoryWriteTool struct {
// contains filtered or unexported fields
}
func NewMemoryWriteTool ¶
func NewMemoryWriteTool(workspace string) *MemoryWriteTool
func (*MemoryWriteTool) Description ¶
func (t *MemoryWriteTool) Description() string
func (*MemoryWriteTool) Name ¶
func (t *MemoryWriteTool) Name() string
func (*MemoryWriteTool) Parameters ¶
func (t *MemoryWriteTool) Parameters() map[string]interface{}
type MessageTool ¶
type MessageTool struct {
// contains filtered or unexported fields
}
func NewMessageTool ¶
func NewMessageTool() *MessageTool
func (*MessageTool) Description ¶
func (t *MessageTool) Description() string
func (*MessageTool) Name ¶
func (t *MessageTool) Name() string
func (*MessageTool) Parameters ¶
func (t *MessageTool) Parameters() map[string]interface{}
func (*MessageTool) SetContext ¶
func (t *MessageTool) SetContext(channel, chatID string)
func (*MessageTool) SetSendCallback ¶
func (t *MessageTool) SetSendCallback(callback SendCallback)
type NodesTool ¶
type NodesTool struct {
// contains filtered or unexported fields
}
NodesTool provides an OpenClaw-style control surface for paired nodes.
func NewNodesTool ¶
func (*NodesTool) Description ¶
func (*NodesTool) Parameters ¶
type ParallelFetchTool ¶
type ParallelFetchTool struct {
// contains filtered or unexported fields
}
func NewParallelFetchTool ¶
func NewParallelFetchTool(fetcher *WebFetchTool, maxParallelCalls int, parallelSafe map[string]struct{}) *ParallelFetchTool
func (*ParallelFetchTool) Description ¶
func (t *ParallelFetchTool) Description() string
func (*ParallelFetchTool) Name ¶
func (t *ParallelFetchTool) Name() string
func (*ParallelFetchTool) Parameters ¶
func (t *ParallelFetchTool) Parameters() map[string]interface{}
type ParallelSafeTool ¶
type ParallelSafeTool interface {
ParallelSafe() bool
}
ParallelSafeTool is an optional capability interface. If implemented by a tool, AgentLoop should trust this declaration over name-based whitelist when deciding parallel execution safety.
type ParallelTool ¶
type ParallelTool struct {
// contains filtered or unexported fields
}
func NewParallelTool ¶
func NewParallelTool(registry *ToolRegistry, maxParallelCalls int, parallelSafe map[string]struct{}) *ParallelTool
func (*ParallelTool) Description ¶
func (t *ParallelTool) Description() string
func (*ParallelTool) Name ¶
func (t *ParallelTool) Name() string
func (*ParallelTool) Parameters ¶
func (t *ParallelTool) Parameters() map[string]interface{}
type ProcessEvent ¶
type ProcessEvent struct {
Type string `json:"type"`
SessionID string `json:"session_id"`
Command string `json:"command,omitempty"`
At time.Time `json:"at"`
ExitCode *int `json:"exit_code,omitempty"`
}
ProcessEvent is a typed lifecycle event for process sessions.
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager(workspace string) *ProcessManager
func (*ProcessManager) Get ¶
func (m *ProcessManager) Get(id string) (*processSession, bool)
func (*ProcessManager) Kill ¶
func (m *ProcessManager) Kill(id string) error
func (*ProcessManager) List ¶
func (m *ProcessManager) List() []map[string]interface{}
func (*ProcessManager) Log ¶
func (m *ProcessManager) Log(id string, offset, limit int) (string, error)
func (*ProcessManager) SubscribeEvents ¶
func (m *ProcessManager) SubscribeEvents(buffer int) <-chan ProcessEvent
type ProcessTool ¶
type ProcessTool struct {
// contains filtered or unexported fields
}
func NewProcessTool ¶
func NewProcessTool(m *ProcessManager) *ProcessTool
func (*ProcessTool) Description ¶
func (t *ProcessTool) Description() string
func (*ProcessTool) Name ¶
func (t *ProcessTool) Name() string
func (*ProcessTool) Parameters ¶
func (t *ProcessTool) Parameters() map[string]interface{}
type ReadFileTool ¶
type ReadFileTool struct {
// contains filtered or unexported fields
}
ReadFileTool reads the contents of a file.
func NewReadFileTool ¶
func NewReadFileTool(allowedDir string) *ReadFileTool
func (*ReadFileTool) Description ¶
func (t *ReadFileTool) Description() string
func (*ReadFileTool) Name ¶
func (t *ReadFileTool) Name() string
func (*ReadFileTool) Parameters ¶
func (t *ReadFileTool) Parameters() map[string]interface{}
type RemindTool ¶
type RemindTool struct {
// contains filtered or unexported fields
}
func NewRemindTool ¶
func NewRemindTool(cs *cron.CronService) *RemindTool
func (*RemindTool) Description ¶
func (t *RemindTool) Description() string
func (*RemindTool) Name ¶
func (t *RemindTool) Name() string
func (*RemindTool) Parameters ¶
func (t *RemindTool) Parameters() map[string]interface{}
func (*RemindTool) SetContext ¶
func (t *RemindTool) SetContext(channel, chatID string)
type RepoMapTool ¶
type RepoMapTool struct {
// contains filtered or unexported fields
}
func NewRepoMapTool ¶
func NewRepoMapTool(workspace string) *RepoMapTool
func (*RepoMapTool) Description ¶
func (t *RepoMapTool) Description() string
func (*RepoMapTool) Name ¶
func (t *RepoMapTool) Name() string
func (*RepoMapTool) Parameters ¶
func (t *RepoMapTool) Parameters() map[string]interface{}
type ResourceScopedTool ¶
ResourceScopedTool is an optional capability interface. If implemented by a tool, AgentLoop can avoid running calls that touch the same resource keys in parallel.
type RunRecord ¶ added in v0.0.3
type RunRecord struct {
ID string `json:"id"`
TaskID string `json:"task_id,omitempty"`
AgentID string `json:"agent_id,omitempty"`
Kind string `json:"kind,omitempty"`
Status string `json:"status"`
Input string `json:"input,omitempty"`
Output string `json:"output,omitempty"`
Error *RuntimeError `json:"error,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type RuntimeError ¶ added in v0.0.3
type RuntimeError struct {
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Stage string `json:"stage,omitempty"`
Retryable bool `json:"retryable,omitempty"`
Source string `json:"source,omitempty"`
}
func NewRuntimeError ¶ added in v0.0.3
func NewRuntimeError(code, message, stage string, retryable bool, source string) *RuntimeError
type RuntimeSnapshot ¶ added in v0.0.3
type RuntimeSnapshot struct {
Tasks []TaskRecord `json:"tasks,omitempty"`
Runs []RunRecord `json:"runs,omitempty"`
Events []EventRecord `json:"events,omitempty"`
World interface{} `json:"world,omitempty"`
}
type SendCallback ¶
type SessionInfo ¶
type SessionsTool ¶
type SessionsTool struct {
// contains filtered or unexported fields
}
func NewSessionsTool ¶
func NewSessionsTool(listFn func(limit int) []SessionInfo, historyFn func(key string, limit int) []providers.Message) *SessionsTool
func (*SessionsTool) Description ¶
func (t *SessionsTool) Description() string
func (*SessionsTool) Name ¶
func (t *SessionsTool) Name() string
func (*SessionsTool) Parameters ¶
func (t *SessionsTool) Parameters() map[string]interface{}
type SkillExecTool ¶
type SkillExecTool struct {
// contains filtered or unexported fields
}
func NewSkillExecTool ¶
func NewSkillExecTool(workspace string) *SkillExecTool
func (*SkillExecTool) Description ¶
func (t *SkillExecTool) Description() string
func (*SkillExecTool) Name ¶
func (t *SkillExecTool) Name() string
func (*SkillExecTool) Parameters ¶
func (t *SkillExecTool) Parameters() map[string]interface{}
type SystemInfoTool ¶
type SystemInfoTool struct{}
func NewSystemInfoTool ¶
func NewSystemInfoTool() *SystemInfoTool
func (*SystemInfoTool) Description ¶
func (t *SystemInfoTool) Description() string
func (*SystemInfoTool) Name ¶
func (t *SystemInfoTool) Name() string
func (*SystemInfoTool) Parameters ¶
func (t *SystemInfoTool) Parameters() map[string]interface{}
type TaskRecord ¶ added in v0.0.3
type ToolAllowlistGroup ¶
type ToolAllowlistGroup struct {
Name string `json:"name"`
Description string `json:"description"`
Aliases []string `json:"aliases,omitempty"`
Tools []string `json:"tools"`
}
func ToolAllowlistGroups ¶
func ToolAllowlistGroups() []ToolAllowlistGroup
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function *FunctionCall `json:"function,omitempty"`
Name string `json:"name,omitempty"`
Arguments map[string]interface{} `json:"arguments,omitempty"`
}
type ToolDefinition ¶
type ToolDefinition struct {
Type string `json:"type"`
Function ToolFunctionDefinition `json:"function"`
}
type ToolFunctionDefinition ¶
type ToolRegistry ¶
type ToolRegistry struct {
// contains filtered or unexported fields
}
func NewToolRegistry ¶
func NewToolRegistry() *ToolRegistry
func (*ToolRegistry) Catalog ¶
func (r *ToolRegistry) Catalog() []map[string]interface{}
func (*ToolRegistry) Count ¶
func (r *ToolRegistry) Count() int
Count returns the number of registered tools.
func (*ToolRegistry) GetDefinitions ¶
func (r *ToolRegistry) GetDefinitions() []map[string]interface{}
func (*ToolRegistry) GetSummaries ¶
func (r *ToolRegistry) GetSummaries() []string
GetSummaries returns human-readable summaries of all registered tools. Returns a slice of "name - description" strings.
func (*ToolRegistry) List ¶
func (r *ToolRegistry) List() []string
List returns a list of all registered tool names.
func (*ToolRegistry) Register ¶
func (r *ToolRegistry) Register(tool Tool)
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
func NewWebFetchTool ¶
func NewWebFetchTool(maxChars int) *WebFetchTool
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
func (*WebFetchTool) ParallelSafe ¶
func (t *WebFetchTool) ParallelSafe() bool
func (*WebFetchTool) Parameters ¶
func (t *WebFetchTool) Parameters() map[string]interface{}
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
func NewWebSearchTool ¶
func NewWebSearchTool(apiKey string, maxResults int) *WebSearchTool
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
func (*WebSearchTool) Parameters ¶
func (t *WebSearchTool) Parameters() map[string]interface{}
type WorldDecisionContext ¶ added in v0.0.4
type WorldDecisionContext struct {
WorldTick int64 `json:"world_tick,omitempty"`
WorldSnapshot map[string]interface{} `json:"world_snapshot,omitempty"`
NPCSnapshot map[string]interface{} `json:"npc_snapshot,omitempty"`
VisibleEvents []map[string]interface{} `json:"visible_events,omitempty"`
IntentSchemaVersion string `json:"intent_schema_version,omitempty"`
}
type WorldTool ¶ added in v0.0.4
type WorldTool struct {
// contains filtered or unexported fields
}
func NewWorldTool ¶ added in v0.0.4
func NewWorldTool(runtime WorldToolRuntime) *WorldTool
func (*WorldTool) Description ¶ added in v0.0.4
func (*WorldTool) Parameters ¶ added in v0.0.4
type WorldToolRuntime ¶ added in v0.0.4
type WorldToolRuntime interface {
Snapshot(limit int) (interface{}, error)
Tick(ctx context.Context, source string) (string, error)
NPCList() ([]map[string]interface{}, error)
NPCGet(id string) (map[string]interface{}, bool, error)
EntityList() ([]map[string]interface{}, error)
EntityGet(id string) (map[string]interface{}, bool, error)
UpdateEntity(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
UpdateLocation(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
UpdateRoom(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
WorldGet() (map[string]interface{}, error)
EventLog(limit int) ([]map[string]interface{}, error)
CreateNPC(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
CreateEntity(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
QuestList() ([]map[string]interface{}, error)
QuestGet(id string) (map[string]interface{}, bool, error)
CreateQuest(ctx context.Context, args map[string]interface{}) (map[string]interface{}, error)
}
type WriteFileTool ¶
type WriteFileTool struct {
// contains filtered or unexported fields
}
WriteFileTool writes content to a file.
func NewWriteFileTool ¶
func NewWriteFileTool(allowedDir string) *WriteFileTool
func (*WriteFileTool) Description ¶
func (t *WriteFileTool) Description() string
func (*WriteFileTool) Name ¶
func (t *WriteFileTool) Name() string
func (*WriteFileTool) Parameters ¶
func (t *WriteFileTool) Parameters() map[string]interface{}
Source Files
¶
- agent.go
- agent_dispatcher.go
- agent_mailbox.go
- agent_profile.go
- agent_store.go
- arg_helpers.go
- base.go
- browser.go
- camera.go
- compat_alias.go
- cron_tool.go
- errors.go
- filesystem.go
- mcp.go
- memory.go
- memory_get.go
- memory_index.go
- memory_namespace.go
- memory_write.go
- message.go
- nodes_tool.go
- parallel.go
- parallel_fetch.go
- process_manager.go
- process_tool.go
- registry.go
- remind.go
- repo_map.go
- runtime_types.go
- sessions_tool.go
- shell.go
- skill_exec.go
- system.go
- system_disk_unix.go
- task_watchdog.go
- tool_allowlist_groups.go
- tracked_output.go
- types.go
- web.go
- world_tool.go