exectool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Description

func Description(cfg config.Config) string

Description honestly lists the sandbox environment so the agent knows the available capabilities and limits (FR-016).

Types

type ExecRequest

type ExecRequest struct {
	Code     string `json:"code" jsonschema:"Python source to execute (required)"`
	TimeoutS int    `json:"timeout_s,omitempty" jsonschema:"wall-clock timeout in seconds (default 30, clamped to [1,300])"`
	Stdin    string `json:"stdin,omitempty" jsonschema:"data piped to the program's stdin (max 1 MiB)"`
}

ExecRequest is the public input schema of the exec tool.

type ExecResult

type ExecResult struct {
	Stdout     string `json:"stdout"`
	Stderr     string `json:"stderr"`
	ExitCode   int    `json:"exit_code"`
	DurationMS int64  `json:"duration_ms"`
	Truncated  bool   `json:"truncated"`
	TimedOut   bool   `json:"timed_out"`
}

ExecResult is the public output schema of the exec tool. The field set is a versioned contract (constitution III) and is identical across all transports.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements the exec tool. Runs are serialized within the instance (constitution VIII): only one execution proceeds at a time.

func New

func New(cfg config.Config, iso isolator.Isolator, log *zap.Logger) *Handler

func (*Handler) Handle

Handle is the MCP tool handler. Invalid input returns an error (tool-call error); a non-zero exit or a timeout is a successful result with the corresponding fields set.

Jump to

Keyboard shortcuts

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