Documentation
¶
Overview ¶
Package toolrunner runs argv-based tools for the recon use case. It is the single execution primitive behind the ToolRunner port: a command is always invoked as an argv array via os/exec – NEVER a shell string – with a per-run timeout (the WHOLE process group is killed on deadline, so resolver/helper grandchildren cannot outlive the authorization window) and a hard output-size cap . It performs no scope/authorization logic itself; the caller must have passed the execution guard first.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecRunner ¶
type ExecRunner struct {
// contains filtered or unexported fields
}
ExecRunner implements ports.ToolRunner using os/exec.
func NewExecRunner ¶
func NewExecRunner(timeout time.Duration, maxOut int) *ExecRunner
NewExecRunner returns a runner with the given default timeout and per-stream output cap; non-positive values fall back to the package defaults.
func (*ExecRunner) Run ¶
func (r *ExecRunner) Run(ctx context.Context, spec ports.ToolSpec) (ports.ToolResult, error)
Run executes spec as an argv array, bounded by timeout + output cap. A non-zero exit is reported via ToolResult.ExitCode (not a Go error) so the caller still gets partial output; a missing binary, a timeout, or a cancelled context returns an error alongside whatever output was captured.