Documentation
¶
Index ¶
- type BackgroundProcess
- type Config
- type Result
- type Tool
- func (t *Tool) Cleanup()
- func (t *Tool) GetBackgroundStatus(id string) (*BackgroundProcess, error)
- func (t *Tool) ListBackground() []*BackgroundProcess
- func (t *Tool) Run(ctx context.Context, command string, timeout time.Duration) (*Result, error)
- func (t *Tool) RunWithPTY(ctx context.Context, command string, timeout time.Duration) (*Result, error)
- func (t *Tool) StartBackground(command string) (string, error)
- func (t *Tool) StopBackground(id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundProcess ¶
type BackgroundProcess struct {
ID string
Command string
Cmd *exec.Cmd
Output *syncBuffer
StartTime time.Time
Done bool
ExitCode int
Error string
}
BackgroundProcess represents a running background command
type Config ¶
type Config struct {
DefaultTimeout time.Duration
AllowBackground bool
WorkDir string
EnvFilter []string // environment variables to exclude
EnvWhitelist []string // if set, ONLY these vars are allowed
Refs *security.RefStore // secret reference token resolver
}
Config holds exec tool configuration
type Result ¶
type Result struct {
ExitCode int `json:"exitCode"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
TimedOut bool `json:"timedOut,omitempty"`
}
Result represents command execution result
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool provides shell command execution
func (*Tool) GetBackgroundStatus ¶
func (t *Tool) GetBackgroundStatus(id string) (*BackgroundProcess, error)
GetBackgroundStatus returns the status of a background process
func (*Tool) ListBackground ¶
func (t *Tool) ListBackground() []*BackgroundProcess
ListBackground returns all background processes
func (*Tool) RunWithPTY ¶
func (t *Tool) RunWithPTY(ctx context.Context, command string, timeout time.Duration) (*Result, error)
RunWithPTY executes a command with PTY support
func (*Tool) StartBackground ¶
StartBackground starts a command in the background
func (*Tool) StopBackground ¶
StopBackground stops a background process
Click to show internal directories.
Click to hide internal directories.