Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalDecision ¶ added in v0.3.0
type ApprovalDecision int
ApprovalDecision represents user's approval decision
const ( ApprovalDeny ApprovalDecision = iota ApprovalAllow ApprovalAllowAll )
func (ApprovalDecision) String ¶ added in v0.3.0
func (ad ApprovalDecision) String() string
String returns string representation of approval decision
type ApprovalSession ¶ added in v0.3.0
type ApprovalSession struct {
// contains filtered or unexported fields
}
ApprovalSession tracks approval decisions for a session
func NewApprovalSession ¶ added in v0.3.0
func NewApprovalSession() *ApprovalSession
NewApprovalSession creates a new approval session
func (*ApprovalSession) IsApprovalSkipped ¶ added in v0.3.0
func (as *ApprovalSession) IsApprovalSkipped() bool
IsApprovalSkipped returns whether approval is being skipped for the session
func (*ApprovalSession) PromptForApproval ¶ added in v0.3.0
func (as *ApprovalSession) PromptForApproval(command string) (ApprovalDecision, error)
PromptForApproval prompts the user for command execution approval
func (*ApprovalSession) SetSkipApproval ¶ added in v0.3.0
func (as *ApprovalSession) SetSkipApproval(skip bool)
SetSkipApproval sets the skip approval flag
type BashTool ¶
type BashTool struct {
// contains filtered or unexported fields
}
BashTool represents the Bash tool that LLMs can invoke
func NewBashTool ¶
func NewBashTool(manager *LLMToolsManager) *BashTool
NewBashTool creates a new Bash tool
type LLMToolsManager ¶
type LLMToolsManager struct {
// contains filtered or unexported fields
}
LLMToolsManager provides tools that LLMs can invoke
func NewLLMToolsManager ¶
func NewLLMToolsManager(cfg *config.Config) *LLMToolsManager
NewLLMToolsManager creates a new LLM tools manager
func (*LLMToolsManager) GetAvailableTools ¶
func (manager *LLMToolsManager) GetAvailableTools() []ToolDefinition
GetAvailableTools returns the list of available tools for LLMs
func (*LLMToolsManager) InvokeTool ¶
func (manager *LLMToolsManager) InvokeTool(toolName string, parameters map[string]interface{}) (string, error)
InvokeTool invokes a tool by name with given parameters
type ToolDefinition ¶
type ToolDefinition struct { Name string `json:"name"` Description string `json:"description"` Parameters map[string]interface{} `json:"parameters"` }
ToolDefinition represents a tool definition for LLMs
type ToolEngine ¶
type ToolEngine struct {
// contains filtered or unexported fields
}
ToolEngine manages tool execution with security controls
func NewToolEngine ¶
func NewToolEngine(cfg *config.Config) *ToolEngine
NewToolEngine creates a new tool engine
func (*ToolEngine) ExecuteBash ¶
func (te *ToolEngine) ExecuteBash(command string) (*ToolResult, error)
ExecuteBash executes a bash command with security validation
func (*ToolEngine) GetApprovalSession ¶ added in v0.3.0
func (te *ToolEngine) GetApprovalSession() *ApprovalSession
GetApprovalSession returns the approval session
func (*ToolEngine) ListAllowedCommands ¶
func (te *ToolEngine) ListAllowedCommands() []string
ListAllowedCommands returns the list of whitelisted commands
func (*ToolEngine) ValidateCommand ¶
func (te *ToolEngine) ValidateCommand(command string) error
ValidateCommand checks if a command would be allowed without executing it