Documentation
¶
Index ¶
Constants ¶
const DefaultGracefulTimeout = 5 * time.Second
DefaultGracefulTimeout is the default duration to wait for a process to stop gracefully before the lifecycle library forces a SIGKILL.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigFile ¶
type ConfigFile struct {
Tools []ProcessConfig `yaml:"tools" json:"tools"`
}
ConfigFile represents the structure of tools.yaml
type ProcessConfig ¶
type ProcessConfig struct {
Name string `yaml:"name" json:"name"`
Command string `yaml:"command" json:"command"`
Args []string `yaml:"args" json:"args"`
Environment map[string]string `yaml:"env" json:"env"`
Description string `yaml:"description" json:"description"`
}
ProcessConfig represents the configuration for an external tool execution.
type RegisteredProcess ¶
RegisteredProcess defines a allowed command execution.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements a ToolRunner that executes local processes. It follows a Strict Registry pattern for security (Allow-Listing).
func NewRunner ¶
func NewRunner(opts ...RunnerOption) *Runner
NewRunner creates a new Process Runner.
type RunnerOption ¶
type RunnerOption func(*Runner)
RunnerOption configures the runner.
func WithBaseDir ¶ added in v0.7.3
func WithBaseDir(dir string) RunnerOption
WithBaseDir sets the working directory for executed processes.
func WithGracefulTimeout ¶ added in v0.7.13
func WithGracefulTimeout(d time.Duration) RunnerOption
WithGracefulTimeout sets the maximum time to wait for a process to shut down gracefully before forcing termination.
func WithInlineExecution ¶
func WithInlineExecution(allow bool) RunnerOption
WithInlineExecution enables ad-hoc execution (Dangerous).
func WithRegistry ¶
func WithRegistry(tools map[string]ProcessConfig) RunnerOption
WithRegistry populates the allow-list from a loaded config.