executor

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package executor implements tool execution backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Execute runs the tool logic and returns a message.
	Execute(ctx context.Context, req Request) (string, error)
}

Executor executes a tool command.

type Request

type Request struct {
	// ToolName is the tool being executed.
	ToolName string
	// Arguments are tool arguments.
	Arguments map[string]any
	// CorrelationID links related executions.
	CorrelationID string
	// TimeoutMessage is an optional timeout message.
	TimeoutMessage string
}

Request contains tool execution inputs.

type Shell

type Shell struct {
	// Command is the shell command to execute.
	Command string
	// Args are command arguments.
	Args []string
	// Env adds environment variables.
	Env map[string]string
}

Shell executes a command as a tool.

func (Shell) Execute

func (s Shell) Execute(ctx context.Context, req Request) (string, error)

Execute runs the configured shell command.

Jump to

Keyboard shortcuts

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