Documentation
¶
Overview ¶
Package bash provides tools for executing shell commands.
Package bash provides tools for executing shell commands.
Package bash provides tools for executing shell commands.
Package bash provides tools for executing shell commands.
Index ¶
- type Request
- type SleepTool
- func (t *SleepTool) Info(_ context.Context) (*schema.ToolInfo, error)
- func (t *SleepTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)
- func (t *SleepTool) IsConcurrentSafe() bool
- func (t *SleepTool) PreflightValidate(input *compose.ToolInput) error
- func (t *SleepTool) Preview(input *compose.ToolInput) domain.ToolDisplay
- type TaskInfo
- type TaskListTool
- func (t *TaskListTool) Info(_ context.Context) (*schema.ToolInfo, error)
- func (t *TaskListTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)
- func (t *TaskListTool) IsConcurrentSafe() bool
- func (t *TaskListTool) PreflightValidate(input *compose.ToolInput) error
- func (t *TaskListTool) Preview(input *compose.ToolInput) domain.ToolDisplay
- type TaskManager
- func (m *TaskManager) Drain() []domain.TaskResult
- func (m *TaskManager) HasPending() bool
- func (m *TaskManager) HasRunning() bool
- func (m *TaskManager) List() []TaskInfo
- func (m *TaskManager) NotifyChan() <-chan struct{}
- func (m *TaskManager) Register(id string, proc *executor.StreamingCmd, logPath string, ...) error
- func (m *TaskManager) Stop(id string) error
- func (m *TaskManager) StopAll()
- type TaskStopAllTool
- func (t *TaskStopAllTool) Info(_ context.Context) (*schema.ToolInfo, error)
- func (t *TaskStopAllTool) InvokableRun(ctx context.Context, _ string, _ ...einotool.Option) (string, error)
- func (t *TaskStopAllTool) IsConcurrentSafe() bool
- func (t *TaskStopAllTool) PreflightValidate(input *compose.ToolInput) error
- func (t *TaskStopAllTool) Preview(input *compose.ToolInput) domain.ToolDisplay
- type TaskStopTool
- func (t *TaskStopTool) Info(_ context.Context) (*schema.ToolInfo, error)
- func (t *TaskStopTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)
- func (t *TaskStopTool) IsConcurrentSafe() bool
- func (t *TaskStopTool) PreflightValidate(input *compose.ToolInput) error
- func (t *TaskStopTool) Preview(input *compose.ToolInput) domain.ToolDisplay
- type Tool
- func (t *Tool) Info(_ context.Context) (*schema.ToolInfo, error)
- func (t *Tool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)
- func (t *Tool) IsConcurrentSafe() bool
- func (t *Tool) PreflightValidate(input *compose.ToolInput) error
- func (t *Tool) Preview(input *compose.ToolInput) domain.ToolDisplay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SleepTool ¶
type SleepTool struct {
// contains filtered or unexported fields
}
SleepTool provides a way for the LLM to wait for a specific duration or for background tasks to complete.
func NewSleepTool ¶
func NewSleepTool(notifier completionNotifier) *SleepTool
NewSleepTool creates a new SleepTool with the provided notifier.
func (*SleepTool) InvokableRun ¶
func (*SleepTool) IsConcurrentSafe ¶
IsConcurrentSafe returns true as sleep is safe to run concurrently.
func (*SleepTool) PreflightValidate ¶
type TaskInfo ¶
type TaskInfo struct {
ID string `json:"id"`
Description string `json:"description"`
Command string `json:"command"`
SecondsSinceActivity int `json:"seconds_since_activity"`
}
TaskInfo contains public information about a background task.
type TaskListTool ¶
type TaskListTool struct {
// contains filtered or unexported fields
}
TaskListTool is a tool for listing active background tasks.
func NewTaskListTool ¶
func NewTaskListTool(manager taskLister) *TaskListTool
NewTaskListTool creates a new TaskListTool.
func (*TaskListTool) InvokableRun ¶
func (*TaskListTool) IsConcurrentSafe ¶
func (t *TaskListTool) IsConcurrentSafe() bool
IsConcurrentSafe indicates if the task list tool can be run concurrently.
func (*TaskListTool) PreflightValidate ¶
func (t *TaskListTool) PreflightValidate(input *compose.ToolInput) error
func (*TaskListTool) Preview ¶
func (t *TaskListTool) Preview(input *compose.ToolInput) domain.ToolDisplay
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager manages background processes promoted from BashTool.
func NewTaskManager ¶
func NewTaskManager(fs fileSystem) *TaskManager
NewTaskManager creates a new task manager.
func (*TaskManager) Drain ¶
func (m *TaskManager) Drain() []domain.TaskResult
Drain returns and clears the pending notification queue.
func (*TaskManager) HasPending ¶
func (m *TaskManager) HasPending() bool
HasPending returns true if there are pending notifications in the queue.
func (*TaskManager) HasRunning ¶
func (m *TaskManager) HasRunning() bool
HasRunning returns true if there are still active background tasks.
func (*TaskManager) List ¶
func (m *TaskManager) List() []TaskInfo
List returns a summary of all active tasks.
func (*TaskManager) NotifyChan ¶
func (m *TaskManager) NotifyChan() <-chan struct{}
NotifyChan returns a signal channel that closes when any background task completes.
func (*TaskManager) Register ¶
func (m *TaskManager) Register(id string, proc *executor.StreamingCmd, logPath string, cancel context.CancelFunc, description, command string, cwd string) error
Register takes control of an already running process and tracks it in the background.
func (*TaskManager) Stop ¶
func (m *TaskManager) Stop(id string) error
Stop terminates a background task by ID.
func (*TaskManager) StopAll ¶
func (m *TaskManager) StopAll()
StopAll terminates all active background tasks.
type TaskStopAllTool ¶
type TaskStopAllTool struct {
// contains filtered or unexported fields
}
TaskStopAllTool is a tool for terminating all background tasks.
func NewTaskStopAllTool ¶
func NewTaskStopAllTool(manager taskStopAller) *TaskStopAllTool
NewTaskStopAllTool creates a new TaskStopAllTool.
func (*TaskStopAllTool) InvokableRun ¶
func (*TaskStopAllTool) IsConcurrentSafe ¶
func (t *TaskStopAllTool) IsConcurrentSafe() bool
IsConcurrentSafe indicates if the tool can be run concurrently.
func (*TaskStopAllTool) PreflightValidate ¶
func (t *TaskStopAllTool) PreflightValidate(input *compose.ToolInput) error
func (*TaskStopAllTool) Preview ¶
func (t *TaskStopAllTool) Preview(input *compose.ToolInput) domain.ToolDisplay
type TaskStopTool ¶
type TaskStopTool struct {
// contains filtered or unexported fields
}
TaskStopTool is a tool for terminating background tasks.
func NewTaskStopTool ¶
func NewTaskStopTool(manager taskStopper) *TaskStopTool
NewTaskStopTool creates a new TaskStopTool.
func (*TaskStopTool) InvokableRun ¶
func (*TaskStopTool) IsConcurrentSafe ¶
func (t *TaskStopTool) IsConcurrentSafe() bool
IsConcurrentSafe indicates if the task stop tool can be run concurrently.
func (*TaskStopTool) PreflightValidate ¶
func (t *TaskStopTool) PreflightValidate(input *compose.ToolInput) error
func (*TaskStopTool) Preview ¶
func (t *TaskStopTool) Preview(input *compose.ToolInput) domain.ToolDisplay
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is a tool that allows executing shell commands with background task support.
func NewTool ¶
func NewTool(fs fileSystem, commandExecutor commandExecutor, pathResolver pathResolver, taskManager backgroundRegistrar) *Tool
NewTool creates a new Tool with injected dependencies.
func (*Tool) InvokableRun ¶
func (*Tool) IsConcurrentSafe ¶
IsConcurrentSafe indicates if the bash tool can be run concurrently.