Documentation
¶
Index ¶
- Constants
- Variables
- func GetBuiltinTools(ctx context.Context, category string, params map[string]interface{}) ([]tool.BaseTool, error)
- type BackgroundTask
- type BackgroundTaskManager
- func (tm *BackgroundTaskManager) GetTask(id string) (*BackgroundTask, bool)
- func (tm *BackgroundTaskManager) GetTaskOutput(id string, follow bool) (<-chan string, error)
- func (tm *BackgroundTaskManager) KillTask(id string) error
- func (tm *BackgroundTaskManager) ListTasks() []*BackgroundTask
- func (tm *BackgroundTaskManager) RemoveTask(id string) error
- func (tm *BackgroundTaskManager) StartTask(command, workdir string) (*BackgroundTask, error)
- type GetToolsFunc
- type RunBackgroundCommandArgs
- type RunBackgroundCommandTool
- type RunTerminalCommandArgs
- type RunTerminalCommandTool
- type SmartCmdTool
- type TaskStatus
Constants ¶
View Source
const DEFAULT_CMD_TIMEOUT = 5
Variables ¶
View Source
var ExemptAutoApprovalTools = []string{"cmd_bg", "smart_cmd"}
Functions ¶
Types ¶
type BackgroundTask ¶
type BackgroundTask struct {
ID string
Command string
WorkingDir string
StartTime time.Time
EndTime *time.Time
Status TaskStatus
Output strings.Builder
Stderr strings.Builder
ExitCode *int
Process *exec.Cmd
CancelFunc context.CancelFunc
// contains filtered or unexported fields
}
func (*BackgroundTask) GetDuration ¶
func (t *BackgroundTask) GetDuration() string
func (*BackgroundTask) GetOutputString ¶
func (t *BackgroundTask) GetOutputString() string
type BackgroundTaskManager ¶
type BackgroundTaskManager struct {
// contains filtered or unexported fields
}
func NewBackgroundTaskManager ¶
func NewBackgroundTaskManager() *BackgroundTaskManager
func (*BackgroundTaskManager) GetTask ¶
func (tm *BackgroundTaskManager) GetTask(id string) (*BackgroundTask, bool)
func (*BackgroundTaskManager) GetTaskOutput ¶
func (tm *BackgroundTaskManager) GetTaskOutput(id string, follow bool) (<-chan string, error)
func (*BackgroundTaskManager) KillTask ¶
func (tm *BackgroundTaskManager) KillTask(id string) error
func (*BackgroundTaskManager) ListTasks ¶
func (tm *BackgroundTaskManager) ListTasks() []*BackgroundTask
func (*BackgroundTaskManager) RemoveTask ¶
func (tm *BackgroundTaskManager) RemoveTask(id string) error
func (*BackgroundTaskManager) StartTask ¶
func (tm *BackgroundTaskManager) StartTask(command, workdir string) (*BackgroundTask, error)
type RunBackgroundCommandTool ¶
type RunBackgroundCommandTool struct {
TaskManager *BackgroundTaskManager
}
func (*RunBackgroundCommandTool) InvokableRun ¶
type RunTerminalCommandArgs ¶
type RunTerminalCommandTool ¶
type RunTerminalCommandTool struct {
WorkingDir string `json:"workDir"`
Timeout time.Duration `json:"timeout"`
AllowedCommands []string
TaskManager *BackgroundTaskManager
}
func (*RunTerminalCommandTool) InvokableRun ¶
func (t *RunTerminalCommandTool) InvokableRun(ctx context.Context, argumentsInJSON string, opts ...tool.Option) (string, error)
InvokableRun executes the tool and returns the command output.
type SmartCmdTool ¶
type SmartCmdTool struct {
// contains filtered or unexported fields
}
SmartCmdTool wraps cmd tool with intelligent permission control
func NewSmartCmdTool ¶
func NewSmartCmdTool(baseTool *RunTerminalCommandTool) *SmartCmdTool
func (*SmartCmdTool) InvokableRun ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusRunning TaskStatus = "running" TaskStatusSuccess TaskStatus = "success" TaskStatusFailed TaskStatus = "failed" TaskStatusKilled TaskStatus = "killed" )
Click to show internal directories.
Click to hide internal directories.