Home /Modules/sleela-scripting/HOST-API.md

HOST-API.md

sleela-scripting/HOST-API.md · 42 line(s) · markdown

Sleela Script Host API

The host API is the security and interoperability boundary between Sleela Script and the native SLeeLa runtime.

Core functions

FunctionPurposeDefault
print(value)write script outputallowed
config.get(name)read resolved configurationallowed
env.get(name)read an environment variablerestricted
fs.read(path)read an approved filerestricted
fs.write(path,value)write an approved filedenied
process.run(command)launch a processdenied
vm.select(version)select VM 1–11restricted
sleela.object(name)resolve a SLeeLa objectrestricted

The default policy is deliberately conservative.

Capability registration

Hosts register a function under a stable name and assign a capability class. Scripts can invoke only functions registered in the current context.

The capability table should be inherited from the SLeeLa security/runtime policy rather than duplicated in this subsystem.

Configuration

Host functions resolve configuration through the unified configuration root defined by config/CONFIGURATION.md.

A script must never assume that its current working directory is the project configuration directory.

Process execution

process.run is an explicit capability, not a shell escape. A conforming host should apply executable allow-lists, argument boundaries, working-directory rules, environment rules, and resource limits before executing it.