Skip to content
Cette page a été générée et traduite avec l'aide de l'IA. Si vous remarquez des inexactitudes, n'hésitez pas à contribuer. Modifier sur GitHub

Host Functions ​

Host functions are l'API surface expose by PRX to WASM plugins. They provide controlled access to host capabilities like HTTP requests, file operations, et agent state.

Available Host Functions ​

HTTP ​

FunctionDescriptionPermission
http_request(method, url, headers, body)Make an HTTP requestnet.http
http_get(url)Shorthand for GET requestnet.http
http_post(url, body)Shorthand for POST requestnet.http

Filesystem ​

FunctionDescriptionPermission
fs_read(path)Read a filefs.read
fs_write(path, data)Write a filefs.write
fs_list(path)List directory contentsfs.read

Agent State ​

FunctionDescriptionPermission
memory_get(key)Read depuis ungent memoryagent.memory.read
memory_set(key, value)Write to agent memoryagent.memory.write
config_get(key)Read plugin configurationagent.config

Logging ​

FunctionDescriptionPermission
log_info(msg)Log at info levelAlways allowed
log_warn(msg)Log at warn levelAlways allowed
log_error(msg)Log at error levelAlways allowed

Permission Manifest ​

Chaque plugin declares required permissions in its manifest:

toml
[permissions]
net.http = ["api.example.com"]
fs.read = ["/data/*"]
agent.memory.read = true

Voir aussi Pages ​

Released under the Apache-2.0 License.