script

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareScriptEnvironment

func PrepareScriptEnvironment(workDir string) (string, error)

PrepareScriptEnvironment sets up a secure environment for script execution

func ValidateScript

func ValidateScript(script string) error

ValidateScript performs basic security checks on a script

Types

type Cache

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

Cache handles caching of successful scripts and their test plans

func NewCache

func NewCache() (*Cache, error)

NewCache creates a new cache instance

func (*Cache) Get

func (c *Cache) Get(description string) (llm.ScriptPair, error)

Get retrieves a cached script pair

func (*Cache) Set

func (c *Cache) Set(description string, scripts llm.ScriptPair) error

Set stores a successful script pair

type Executor

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

Executor handles running scripts in a controlled environment

func NewExecutor

func NewExecutor(workDir string) (*Executor, error)

NewExecutor creates a new script executor

func (*Executor) ExecuteTest

func (e *Executor) ExecuteTest(ctx context.Context, script string, test llm.Test) (string, error)

ExecuteTest runs a single test case in a controlled environment

type Pipeline

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

Pipeline handles the script generation and testing process

func NewPipeline

func NewPipeline(llm llm.Provider, maxFixes, maxAttempts int, timeout time.Duration, workDir string, noCache bool) (*Pipeline, error)

NewPipeline creates a new script generation pipeline

func (*Pipeline) GenerateAndTest

func (p *Pipeline) GenerateAndTest(ctx context.Context, description string) (string, error)

GenerateAndTest generates a script from a natural language description and tests it

type ShellConfig

type ShellConfig struct {
	Path    string
	Args    []string
	IsLogin bool
}

ShellConfig holds shell-specific configuration

func DetectShell

func DetectShell() (*ShellConfig, error)

DetectShell determines the user's shell and returns its configuration

type Test

type Test = llm.Test

Test represents a test case for a script

type TestFailure

type TestFailure = llm.TestFailure

TestFailure represents a failed test case

Jump to

Keyboard shortcuts

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