scriptruntime

package
v0.7.49 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scriptruntime executes sandboxed embedded scripts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlwaysErrors added in v0.7.5

func AlwaysErrors(script string) bool

AlwaysErrors reports whether script can only fail: before doing anything else, it calls error(...). Constant locals, such as the message the call raises, may come first. A compiler that cannot do a task with the tools it has writes such a stub, which must never be promoted.

func RunLua

func RunLua(ctx context.Context, script string, opts Options) (string, error)

RunLua executes a Lua script with a sandboxed global environment.

func ValidateLua

func ValidateLua(script string) error

ValidateLua parses a Lua script without executing it.

Types

type Environment

type Environment struct {
	AgentID   string
	SessionID string
	TaskID    string
	JobID     string
	// Trigger is the channel message that started a workflow run, as the
	// Lua global trigger; nil outside workflow runs.
	Trigger map[string]any
}

Environment exposes runtime context to embedded scripts.

type Options

type Options struct {
	ToolClient  agent.ToolClient
	Environment Environment
	Logf        func(format string, args ...any)
}

Options configures a sandboxed Lua script execution.

Jump to

Keyboard shortcuts

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