bash

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 16 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Command         string `json:"command"`
	Description     string `json:"description"`
	Timeout         int    `json:"timeout"`
	RunInBackground bool   `json:"run_in_background"`
}

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) Info

func (t *SleepTool) Info(_ context.Context) (*schema.ToolInfo, error)

func (*SleepTool) InvokableRun

func (t *SleepTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)

func (*SleepTool) IsConcurrentSafe

func (t *SleepTool) IsConcurrentSafe() bool

IsConcurrentSafe returns true as sleep is safe to run concurrently.

func (*SleepTool) PreflightValidate

func (t *SleepTool) PreflightValidate(input *compose.ToolInput) error

func (*SleepTool) Preview

func (t *SleepTool) Preview(input *compose.ToolInput) domain.ToolDisplay

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) Info

func (*TaskListTool) InvokableRun

func (t *TaskListTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)

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) Info

func (*TaskStopAllTool) InvokableRun

func (t *TaskStopAllTool) InvokableRun(ctx context.Context, _ string, _ ...einotool.Option) (string, error)

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) Info

func (*TaskStopTool) InvokableRun

func (t *TaskStopTool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)

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) Info

func (t *Tool) Info(_ context.Context) (*schema.ToolInfo, error)

func (*Tool) InvokableRun

func (t *Tool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)

func (*Tool) IsConcurrentSafe

func (t *Tool) IsConcurrentSafe() bool

IsConcurrentSafe indicates if the bash tool can be run concurrently.

func (*Tool) PreflightValidate

func (t *Tool) PreflightValidate(input *compose.ToolInput) error

func (*Tool) Preview

func (t *Tool) Preview(input *compose.ToolInput) domain.ToolDisplay

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL