Documentation
¶
Overview ¶
Package builtins contains the extracted builtin function implementations for the interpreter. Each file registers its builtins via eval.RegisterBuiltins in an init() function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NativeOSModule ¶
NativeOSModule returns the import-only native/os module exports.
func SanitizePathLocal ¶
SanitizePathLocal resolves user-supplied paths to absolute paths and ensures they remain within the allowed filesystem root. The root is determined by:
- The active sandbox base directory (sandbox.ActiveSandboxBaseDir()), if set
- The current working directory, as a fallback
This prevents interpreter scripts from accessing or modifying files outside the project/sandbox boundary. Symlinks are resolved on both the target path and the root before the jail check, so a symlink inside the allowed root that points outside of it cannot be used to escape the sandbox. If the target path does not exist yet (e.g. write_file creating a new file), symlinks are resolved on the parent directory instead and rejoined with the final path component.
Types ¶
type GeneratorValue ¶
type GeneratorValue struct {
// contains filtered or unexported fields
}
func (*GeneratorValue) Inspect ¶
func (g *GeneratorValue) Inspect() string
func (*GeneratorValue) Type ¶
func (g *GeneratorValue) Type() object.ObjectType
type NativeCommandRunResult ¶
type NativeCommandRunResult struct {
Command string
Args []string
Stdout string
Stderr string
ExitCode int
OK bool
TimedOut bool
Cancelled bool
Truncated bool
Error string
}
func RunNativeCommandForRepl ¶
func RunNativeCommandForRepl(env *object.Environment, command string, args []string) NativeCommandRunResult