Skip to contents

rho.ext is the open extension runtime for Rho. Extensions register handlers, tools, commands, and providers through an explicit API object; they do not patch package globals.

An asynchronous handler chain

library(rho.async)
library(rho.ext)

runtime <- rho_extension_runtime()
api <- rho_extension_api(runtime, source = "README")
rho_on(api, "prompt", function(event, context) {
  rho_task(list(text = toupper(event$text)))
})

results <- rho_dispatch_event(
  runtime,
  list(type = "prompt", text = "compose me")
) |>
  rho_await(timeout = 1000)
results[[1L]]
#> $text
#> [1] "COMPOSE ME"

The dispatcher normalizes plain handler values and tasks. This lets an extension perform I/O, ask for permission, or consult policy without turning the agent loop into a synchronous callback system.

See the rho.ext reference, the upstream rho.agent lifecycle, and the downstream rho.bio.agent application.