Runtime Primitives
Primitives are functions callable from insideexecute_code (PyRepl) as runtime.<namespace>.<name>(...). They let tools access agent-level capabilities without breaking the tool boundary.
Concepts
Built-in: SelfRef Pack
The framework ships with one built-in pack —selfref — providing 6 primitives:
Creating a Custom Pack
1. Define a Backend
2. Define Primitives
3. Build the Pack
4. Install in PyRepl
Discoverability
The model discovers primitives through built-in meta-primitives:PrimitiveCallContext
Every primitive handler receives a context object:ctx.event_emitter to stream progress from long-running primitives.
→ API Reference: Runtime