builtin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeRunner

type CodeRunner struct {
	*base.BaseTool
	// contains filtered or unexported fields
}

CodeRunner provides code execution capabilities with sandbox constraints. WARNING: This tool executes code on the host system. Use with caution and ensure proper sandboxing.

func NewCodeRunner

func NewCodeRunner() *CodeRunner

NewCodeRunner creates a new CodeRunner tool.

func NewCodeRunnerWithOptions

func NewCodeRunnerWithOptions(enablePython, enableJS bool, timeout time.Duration, maxOutputSize int) *CodeRunner

NewCodeRunnerWithOptions creates a new CodeRunner with custom options.

func (*CodeRunner) AddDangerousPattern

func (t *CodeRunner) AddDangerousPattern(pattern string)

AddDangerousPattern adds a custom dangerous pattern to validate against.

func (*CodeRunner) EnableJS

func (t *CodeRunner) EnableJS(enabled bool)

EnableJS enables or disables JavaScript execution.

func (*CodeRunner) EnablePython

func (t *CodeRunner) EnablePython(enabled bool)

EnablePython enables or disables Python execution.

func (*CodeRunner) Execute

func (t *CodeRunner) Execute(ctx context.Context, params map[string]interface{}) (core.Result, error)

Execute performs the code execution operation.

func (*CodeRunner) GetSupportedLanguages

func (t *CodeRunner) GetSupportedLanguages() []string

GetSupportedLanguages returns the list of supported languages.

func (*CodeRunner) IsJSEnabled

func (t *CodeRunner) IsJSEnabled() bool

IsJSEnabled returns whether JavaScript execution is enabled.

func (*CodeRunner) IsPythonEnabled

func (t *CodeRunner) IsPythonEnabled() bool

IsPythonEnabled returns whether Python execution is enabled.

func (*CodeRunner) SetMaxOutputSize

func (t *CodeRunner) SetMaxOutputSize(size int)

SetMaxOutputSize sets the maximum output size.

func (*CodeRunner) SetTimeout

func (t *CodeRunner) SetTimeout(timeout time.Duration)

SetTimeout sets the execution timeout.

Jump to

Keyboard shortcuts

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