pub enum Action {
CodexOpen {
slug: String,
},
CommerceBuy {
item: String,
price_ref: Value,
},
Navigate {
to: String,
},
Notify {
text: String,
level: Option<String>,
},
PresenceEmit {
event: String,
data: Value,
},
SetState {
placement: Option<String>,
patch: Value,
},
GiveItem {
item: u16,
count: u32,
},
Despawn {
position: [f32; 3],
},
Spawn {
builtin: String,
position: [f32; 3],
scale: f32,
color: [f32; 3],
name: String,
animate: String,
anim_speed: f32,
anim_amp: f32,
},
}Expand description
A declarative effect a behavior asks the host to perform (module → host). The host — never the module — carries it out, so the sandbox never touches IO.
Variants§
CodexOpen
Open a canonical Codex entry panel.
CommerceBuy
Buy an item. price_ref is a reference, never authoritative — the server
sets the real price (matches server-side pricing). Replies purchase_result.
Veilwalk to a Locator.
Notify
A transient UI toast.
PresenceEmit
Relay an interaction to co-present travelers.
SetState
Mutate visible placement state (colour, visibility, transform).
GiveItem
Put an item in the visitor’s inventory. item is a material/item number
(the NNNN of a StructuredId). Emitted by declarative interactions.
Despawn
Remove a placed object from the world (mesh + collider) at position — a
declarative despawn. The browser hides the nearest rendered instance.
Spawn
Conjure a new object into the world: a builtin mesh (cube/sphere/…)
at position, uniformly scaled, colored, optionally named — a named
spawn is addressable by later set_state (move/tint) calls. The browser
caps runaway spawners; behaviors conjure decor, not geometry floods.