code

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatExecutionResultForLLM

func FormatExecutionResultForLLM(results []ExecutionResult) string

Types

type BashExecutor

type BashExecutor struct{}

func (*BashExecutor) Execute

func (be *BashExecutor) Execute(code string) ExecutionResult

type CodeBlock

type CodeBlock struct {
	ID          string
	Language    string
	Code        string
	Description string
}

func ParseCodeBlocks

func ParseCodeBlocks(input string) []CodeBlock

type ExecutionResult

type ExecutionResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Block    CodeBlock
}

func ExecuteCodeBlock

func ExecuteCodeBlock(block CodeBlock) ExecutionResult

func InterpretCodeBlocks

func InterpretCodeBlocks(input string) []ExecutionResult

type Executor

type Executor interface {
	Execute(code string) ExecutionResult
}

type OsascriptExecutor

type OsascriptExecutor struct{}

func (*OsascriptExecutor) Execute

func (oe *OsascriptExecutor) Execute(code string) ExecutionResult

type PowerShellExecutor

type PowerShellExecutor struct{}

func (*PowerShellExecutor) Execute

func (pe *PowerShellExecutor) Execute(code string) ExecutionResult

type PythonExecutor

type PythonExecutor struct{}

func (*PythonExecutor) Execute

func (pe *PythonExecutor) Execute(code string) ExecutionResult

type Repository

type Repository interface {
	SaveCodeBlock(block CodeBlock) error
	LoadCodeBlock(id string) (CodeBlock, error)

	LoadCodeBlocks() ([]CodeBlock, error)

	Close() error
}

func NewSQLiteRepository

func NewSQLiteRepository(dbPath string) (Repository, error)

Jump to

Keyboard shortcuts

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