engine

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package engine routes a command to drop/host/container and executes it, independent of any transport (MCP, CLI). Output is written to the caller's io.Writers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, req Request) (int, error)

Run routes req.Command and executes it.

err is non-nil only on host-execution infrastructure failure. All other outcomes (drop, container-not-configured, validation failure, container runner error) write a message to req.Stderr and return err == nil with a non-zero exit code.

Types

type ContainerRunner

type ContainerRunner interface {
	RunContainer(ctx context.Context, serviceName string, argv []string, env []string, stdout, stderr io.Writer) (int, error)
}

ContainerRunner executes an argv inside the sandbox container.

type Request

type Request struct {
	Command                 string
	AllowPatterns           []string
	DropPatterns            []string
	ContainerRunner         ContainerRunner
	ContainerEnvPassthrough []string
	Stdout                  io.Writer
	Stderr                  io.Writer
}

Request carries everything Run needs for a single command.

Jump to

Keyboard shortcuts

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