Documentation
¶
Index ¶
- func ValidateParams(schema, params json.RawMessage) error
- func WithApproved(ctx context.Context) context.Context
- type CronManageTool
- type DNATools
- type FileEditTool
- type FileReadTool
- type FileWriteTool
- type FindSkillsTool
- type ListTasksTool
- type LogReadTool
- type MemoryRecallTool
- type MemoryStoreTool
- type PathChecker
- type ReadSkillTool
- type Registry
- func (r *Registry) Count() int
- func (r *Registry) Deregister(name string)
- func (r *Registry) Execute(ctx context.Context, name string, params json.RawMessage) (ToolResult, error)
- func (r *Registry) Get(name string) (Tool, bool)
- func (r *Registry) Register(tool Tool)
- func (r *Registry) SetDefaultTimeout(d time.Duration)
- func (r *Registry) SetLogger(l *slog.Logger)
- func (r *Registry) ToolDefs() []providers.ToolDef
- type RunSkillTool
- type SecurityChecker
- type ShellExecTool
- type SkillFactoryTool
- type SpawnAgentTool
- type SubagentSpawner
- type TaskInfo
- type Tool
- type ToolResult
- type WebReadTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateParams ¶
func ValidateParams(schema, params json.RawMessage) error
ValidateParams performs lightweight JSON schema validation: checks required fields, basic types (string/integer/number/boolean/object/array), and enum values.
Types ¶
type CronManageTool ¶
type CronManageTool struct {
// contains filtered or unexported fields
}
CronManageTool allows the LLM to manage scheduled jobs.
func NewCronManage ¶
func NewCronManage(sched *scheduler.Scheduler) *CronManageTool
func (*CronManageTool) Description ¶
func (t *CronManageTool) Description() string
func (*CronManageTool) Execute ¶
func (t *CronManageTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*CronManageTool) Name ¶
func (t *CronManageTool) Name() string
func (*CronManageTool) Parameters ¶
func (t *CronManageTool) Parameters() json.RawMessage
type DNATools ¶
type DNATools struct {
ShellExec *ShellExecTool
FileRead *FileReadTool
FileWrite *FileWriteTool
FileEdit *FileEditTool
WebRead *WebReadTool
}
DNATools holds references to built-in tools that need security wiring.
func RegisterDNATools ¶
RegisterDNATools registers all built-in (DNA) tools into the registry. Returns a DNATools struct so security can be wired to all tools that need it.
type FileEditTool ¶
type FileEditTool struct {
// contains filtered or unexported fields
}
func NewFileEdit ¶
func NewFileEdit() *FileEditTool
func (*FileEditTool) Description ¶
func (t *FileEditTool) Description() string
func (*FileEditTool) Execute ¶
func (t *FileEditTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*FileEditTool) Name ¶
func (t *FileEditTool) Name() string
func (*FileEditTool) Parameters ¶
func (t *FileEditTool) Parameters() json.RawMessage
func (*FileEditTool) SetSecurity ¶
func (t *FileEditTool) SetSecurity(s PathChecker)
type FileReadTool ¶
type FileReadTool struct {
// contains filtered or unexported fields
}
func NewFileRead ¶
func NewFileRead() *FileReadTool
func (*FileReadTool) Description ¶
func (t *FileReadTool) Description() string
func (*FileReadTool) Execute ¶
func (t *FileReadTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*FileReadTool) Name ¶
func (t *FileReadTool) Name() string
func (*FileReadTool) Parameters ¶
func (t *FileReadTool) Parameters() json.RawMessage
func (*FileReadTool) SetSecurity ¶
func (t *FileReadTool) SetSecurity(s PathChecker)
type FileWriteTool ¶
type FileWriteTool struct {
// contains filtered or unexported fields
}
func NewFileWrite ¶
func NewFileWrite() *FileWriteTool
func (*FileWriteTool) Description ¶
func (t *FileWriteTool) Description() string
func (*FileWriteTool) Execute ¶
func (t *FileWriteTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*FileWriteTool) Name ¶
func (t *FileWriteTool) Name() string
func (*FileWriteTool) Parameters ¶
func (t *FileWriteTool) Parameters() json.RawMessage
func (*FileWriteTool) SetSecurity ¶
func (t *FileWriteTool) SetSecurity(s PathChecker)
type FindSkillsTool ¶
type FindSkillsTool struct {
// contains filtered or unexported fields
}
func NewFindSkills ¶
func NewFindSkills(loader *skills.Loader) *FindSkillsTool
func (*FindSkillsTool) Description ¶
func (t *FindSkillsTool) Description() string
func (*FindSkillsTool) Execute ¶
func (t *FindSkillsTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*FindSkillsTool) Name ¶
func (t *FindSkillsTool) Name() string
func (*FindSkillsTool) Parameters ¶
func (t *FindSkillsTool) Parameters() json.RawMessage
type ListTasksTool ¶
type ListTasksTool struct {
// contains filtered or unexported fields
}
func NewListTasks ¶
func NewListTasks(spawner SubagentSpawner) *ListTasksTool
func (*ListTasksTool) Description ¶
func (t *ListTasksTool) Description() string
func (*ListTasksTool) Execute ¶
func (t *ListTasksTool) Execute(_ context.Context, _ json.RawMessage) (ToolResult, error)
func (*ListTasksTool) Name ¶
func (t *ListTasksTool) Name() string
func (*ListTasksTool) Parameters ¶
func (t *ListTasksTool) Parameters() json.RawMessage
type LogReadTool ¶
type LogReadTool struct{}
func NewLogRead ¶
func NewLogRead() *LogReadTool
func (*LogReadTool) Description ¶
func (t *LogReadTool) Description() string
func (*LogReadTool) Execute ¶
func (t *LogReadTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*LogReadTool) Name ¶
func (t *LogReadTool) Name() string
func (*LogReadTool) Parameters ¶
func (t *LogReadTool) Parameters() json.RawMessage
type MemoryRecallTool ¶
type MemoryRecallTool struct {
// contains filtered or unexported fields
}
func NewMemoryRecall ¶
func NewMemoryRecall(store *memory.Store) *MemoryRecallTool
func (*MemoryRecallTool) Description ¶
func (t *MemoryRecallTool) Description() string
func (*MemoryRecallTool) Execute ¶
func (t *MemoryRecallTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*MemoryRecallTool) Name ¶
func (t *MemoryRecallTool) Name() string
func (*MemoryRecallTool) Parameters ¶
func (t *MemoryRecallTool) Parameters() json.RawMessage
type MemoryStoreTool ¶
type MemoryStoreTool struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore(store *memory.Store) *MemoryStoreTool
func (*MemoryStoreTool) Description ¶
func (t *MemoryStoreTool) Description() string
func (*MemoryStoreTool) Execute ¶
func (t *MemoryStoreTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*MemoryStoreTool) Name ¶
func (t *MemoryStoreTool) Name() string
func (*MemoryStoreTool) Parameters ¶
func (t *MemoryStoreTool) Parameters() json.RawMessage
type PathChecker ¶
PathChecker validates file paths against security policy.
type ReadSkillTool ¶
type ReadSkillTool struct {
// contains filtered or unexported fields
}
func NewReadSkill ¶
func NewReadSkill(loader *skills.Loader) *ReadSkillTool
func (*ReadSkillTool) Description ¶
func (t *ReadSkillTool) Description() string
func (*ReadSkillTool) Execute ¶
func (t *ReadSkillTool) Execute(_ context.Context, params json.RawMessage) (ToolResult, error)
func (*ReadSkillTool) Name ¶
func (t *ReadSkillTool) Name() string
func (*ReadSkillTool) Parameters ¶
func (t *ReadSkillTool) Parameters() json.RawMessage
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Deregister ¶
func (*Registry) Execute ¶
func (r *Registry) Execute(ctx context.Context, name string, params json.RawMessage) (ToolResult, error)
func (*Registry) SetDefaultTimeout ¶
SetDefaultTimeout sets the timeout for tool execution.
type RunSkillTool ¶
type RunSkillTool struct {
// contains filtered or unexported fields
}
func NewRunSkill ¶
func NewRunSkill(loader *skills.Loader) *RunSkillTool
func (*RunSkillTool) Description ¶
func (t *RunSkillTool) Description() string
func (*RunSkillTool) Execute ¶
func (t *RunSkillTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*RunSkillTool) Name ¶
func (t *RunSkillTool) Name() string
func (*RunSkillTool) Parameters ¶
func (t *RunSkillTool) Parameters() json.RawMessage
type SecurityChecker ¶
type ShellExecTool ¶
type ShellExecTool struct {
// contains filtered or unexported fields
}
func NewShellExec ¶
func NewShellExec() *ShellExecTool
func (*ShellExecTool) Description ¶
func (t *ShellExecTool) Description() string
func (*ShellExecTool) Execute ¶
func (t *ShellExecTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*ShellExecTool) Name ¶
func (t *ShellExecTool) Name() string
func (*ShellExecTool) Parameters ¶
func (t *ShellExecTool) Parameters() json.RawMessage
func (*ShellExecTool) SetSecurity ¶
func (t *ShellExecTool) SetSecurity(s SecurityChecker)
type SkillFactoryTool ¶
type SkillFactoryTool struct {
// contains filtered or unexported fields
}
func NewSkillFactory ¶
func NewSkillFactory(loader *skills.Loader) *SkillFactoryTool
func (*SkillFactoryTool) Description ¶
func (t *SkillFactoryTool) Description() string
func (*SkillFactoryTool) Execute ¶
func (t *SkillFactoryTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*SkillFactoryTool) Name ¶
func (t *SkillFactoryTool) Name() string
func (*SkillFactoryTool) Parameters ¶
func (t *SkillFactoryTool) Parameters() json.RawMessage
type SpawnAgentTool ¶
type SpawnAgentTool struct {
// contains filtered or unexported fields
}
func NewSpawnAgent ¶
func NewSpawnAgent(spawner SubagentSpawner) *SpawnAgentTool
func (*SpawnAgentTool) Description ¶
func (t *SpawnAgentTool) Description() string
func (*SpawnAgentTool) Execute ¶
func (t *SpawnAgentTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*SpawnAgentTool) Name ¶
func (t *SpawnAgentTool) Name() string
func (*SpawnAgentTool) Parameters ¶
func (t *SpawnAgentTool) Parameters() json.RawMessage
type SubagentSpawner ¶
type SubagentSpawner interface {
Spawn(ctx context.Context, description, channel, chatID string) (string, error)
StopAll() int
Stop(taskID string) error
List() []TaskInfo
Count() int
}
SubagentSpawner is the interface for spawning background tasks. This avoids a circular dependency with the agent package.
type TaskInfo ¶
type TaskInfo struct {
ID string `json:"id"`
Description string `json:"description"`
StartedAt time.Time `json:"started_at"`
Running bool `json:"running"`
}
TaskInfo is a summary of a background task.
type Tool ¶
type Tool interface {
Name() string
Description() string
Parameters() json.RawMessage
Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
}
type ToolResult ¶
type WebReadTool ¶
type WebReadTool struct {
// contains filtered or unexported fields
}
func NewWebRead ¶
func NewWebRead() *WebReadTool
func (*WebReadTool) Description ¶
func (t *WebReadTool) Description() string
func (*WebReadTool) Execute ¶
func (t *WebReadTool) Execute(ctx context.Context, params json.RawMessage) (ToolResult, error)
func (*WebReadTool) Name ¶
func (t *WebReadTool) Name() string
func (*WebReadTool) Parameters ¶
func (t *WebReadTool) Parameters() json.RawMessage