API reference (Rhai — deprecated)
The Rhai frontend is deprecated and will be removed in a future release. New scenarios should use the JavaScript/TypeScript frontend — see Writing scenarios and the JS API reference. This page documents the Rhai vocabulary for existing scenarios; Rhai frontend explains why and how to migrate.
The complete Rhai scenario vocabulary, generated from the engine (so it never drifts from the code) — organized by the thing you’re working with:
- Scenario structure — defining and isolating tests:
scenario,setup,teardown,skip. - Flow and timing —
await_until,wait,parallel,default_timeout. - Agents — create SIP endpoints and drive calls: register, dial, accept, transfer, DTMF, audio.
- Peer — the remote party of the active call.
- Call state — the
State::*phases foragent.state. - AudioSpec — audio sources for
send_audio(tone,file,silent).
- CallQuality
- Assertions and matchers — the fluent
assert(x).<matcher>(…), used insideawait_until. - HTTP —
http(…)requests and the response. - HTTP mock server —
mock_server(…), routes and responders for webhook-driven flows.- Mock request — the recorded request a responder/assertion sees.
- Environment —
env,load_env— credentials stay out of scripts. - Utilities —
log,uuid.
For editors and agents, the whole Rhai API is also available as Rhai type definitions (.d.rhai). In practice this is a reference you read, not tooling you get: the only Rhai language server is an unreleased experiment that no editor plugin ships, so there is no type-checking and no inline error reporting — one of the reasons the frontend is being retired in favour of JS/TS.