Skip to content
Axiom/SDK
SDK / The IDL

The IDL

The surface is one file, idl/axiom.idl in the Axiom repository. The host's dispatch, the import list a mod is checked against, the C header a mod compiles against, the other language bindings and the capability reference are all generated from it, so none of them can drift from another. A mod author reads it and never writes it.

A capability

A capability is a question about a game, answered by a pack, or a primitive about a process, answered by the backend. A mod calls both the same way and cannot tell which is which.

AXIOM.IDLentity.transform@1, as written
capability entity.transform@1 {
    audience: mod
    requires entity.query@1

    fn transform(id: EntityId) -> Result<Transform>;
    bulk fn transforms(ids: [EntityId]) -> [Result<Transform>];
    fn position(id: EntityId) -> Result<Vec3>;
    bulk fn positions(ids: [EntityId]) -> [Result<Vec3>];
    writes fn set_position(id: EntityId, position: Vec3) -> Result<>;
    fn writable() -> bool;

    event moved { entity: EntityId, from: Vec3, to: Vec3 }

    error StaleHandle;
    error ReadOnly;
}

The name carries its major. A change that would break a mod built against @1 is a new capability, @2, and a mod names the one it was built for.

What a capability can say

Line
Means
audience: mod
Any mod may import it. The default.
audience: pack
Only packs may use it. It is left out of the header and the import list, so a mod cannot import it at all.
grant: required
Never granted automatically. The person has to allow it for that mod.
requires other@1
A capability that only makes sense beside another, such as project needing camera.
struct Name { ... }
A type the capability owns. Shared types such as Vec3 live in a types block at the top.
fn name(...) -> T;
A call.
bulk fn
The array form of a call, for anything a mod would otherwise call in a loop.
writes fn
A call that changes something, rather than reads it.
event name { ... }
Something the host tells the mod happened.
error Name;
A failure a Result can carry. Its place in the list is its status number.

Why no call takes an address

Packs only, and the reason is the sandbox rather than a policy. A call that took or returned a game address would hand a mod a place in the process, and the host cannot check what a mod does with one. So the generator refuses a mod-visible call that names an address or a pointer, and the calls that do, such as memory.read and symbols, are for packs.

A mod that wants to hook a function names it, and hook@1 resolves the name through the pack. Two mods on one function is then ordinary rather than a collision, because the core owns the detour.

What comes out

Generated
For
surface.h
The freestanding C header a mod compiles against. See the guest ABI.
surface.imports
The import list, with each call's lowered signature. The host checks every mod against it; it is the enforcement, not a description of it.
surface.md
The reference, which these pages are built from the same source as.
surface.hpp, surface.rs, surface.lua
C++, Rust and Lua bindings. Not yet following the lowering the C header does.

The generator also refuses a shape the lowering cannot carry. It found two as soon as it checked: a table's column names, which became the [str] lowering, and a list of rows each holding a list of cells, which became ui.overlay@1.set taking its cells flat with a column count.