Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion examples/craft-basics/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "craft-basics"
version = "0.1.0"
# Rewritten by `cargo run -p pexe -- build examples/craft-basics`.
module_hash = "57631b51fb9a921588d391211f94c0bd8f777aff0a16755bc2dfefb52d6ff5b0"
module_hash = "44d6fd33861e3ab021c0362a348243226cfa94345c912676102115a4864cd084"

[[classes]]
name = "Log"
Expand Down Expand Up @@ -80,3 +80,33 @@ hidden = true
name = "MineStoneWithStonePick"
emoji = "🪨"
description = "Mine stone using a stone pick (consumes durability)."

[[actions]]
name = "RekeyLog"
emoji = "🔑"
description = "Take exclusive possession of a received log by rotating its key."

[[actions]]
name = "RekeyWood"
emoji = "🔑"
description = "Take exclusive possession of a received wood by rotating its key."

[[actions]]
name = "RekeyStick"
emoji = "🔑"
description = "Take exclusive possession of a received stick by rotating its key."

[[actions]]
name = "RekeyStone"
emoji = "🔑"
description = "Take exclusive possession of a received stone by rotating its key."

[[actions]]
name = "RekeyWoodPick"
emoji = "🔑"
description = "Take exclusive possession of a received wood pick by rotating its key."

[[actions]]
name = "RekeyStonePick"
emoji = "🔑"
description = "Take exclusive possession of a received stone pick by rotating its key."
47 changes: 47 additions & 0 deletions examples/craft-basics/plugin.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,50 @@ fn MineStoneWithStonePick(action) {
var pick = action.subaction("UseStonePick");
var stone = action.output("Stone");
}

// ── rekeys ───────────────────────────────────────────────────────────────────
// Rotating `key` moves an object's commitment and its nullifier, so a holder
// who was sent an object can spend the sender's copy out from under them.
// Nothing else about the state changes, and the stable identifier carries
// across, so the object stays the same object under new custody.
//
// These are also part of this plugin's extension surface -- which is every
// [[actions]] entry in the manifest, hidden ones included (hidden only skips
// catalog listings). A dependent plugin's script reaches any of those with a
// qualified subaction call; lowercase helpers like rekey() are inlined at
// compile time and are not callable, so the manifest IS the public API.

fn rekey(action, obj) {
var key = action.random();
obj.update("key", key);
}

fn RekeyLog(action) {
var log = action.mutate("Log");
rekey(action, log);
}

fn RekeyWood(action) {
var wood = action.mutate("Wood");
rekey(action, wood);
}

fn RekeyStick(action) {
var stick = action.mutate("Stick");
rekey(action, stick);
}

fn RekeyStone(action) {
var stone = action.mutate("Stone");
rekey(action, stone);
}

fn RekeyWoodPick(action) {
var pick = action.mutate("WoodPick");
rekey(action, pick);
}

fn RekeyStonePick(action) {
var pick = action.mutate("StonePick");
rekey(action, pick);
}
267 changes: 266 additions & 1 deletion examples/craft-rocket/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "craft-rocket"
version = "0.1.0"
# Rewritten by `cargo run -p pexe -- build examples/craft-rocket`.
module_hash = "f838acbb5b8a196174ec1adb15b2dc19f60faa5ef76ab0ab60b6ee010f0f964f"
module_hash = "ce8779af93a5a494f717ba26e7280b97a6b402d84ffb17f2d716d1624aeab5ca"

# ── raw resources ────────────────────────────────────────────────────────────

Expand Down Expand Up @@ -737,3 +737,268 @@ description = "Final assembly: engine + casing + payload + 2 resin → 1 rocket.
name = "CraftRocketCat"
emoji = "🚀"
description = "Catalysed rocket — reaction-chamber + catalyst, deterministic."

[[actions]]
name = "RekeyIron"
emoji = "🔑"
description = "Take exclusive possession of a received iron by rotating its key."

[[actions]]
name = "RekeyCopper"
emoji = "🔑"
description = "Take exclusive possession of a received copper by rotating its key."

[[actions]]
name = "RekeyOil"
emoji = "🔑"
description = "Take exclusive possession of a received oil by rotating its key."

[[actions]]
name = "RekeySulfur"
emoji = "🔑"
description = "Take exclusive possession of a received sulfur by rotating its key."

[[actions]]
name = "RekeyWater"
emoji = "🔑"
description = "Take exclusive possession of a received water by rotating its key."

[[actions]]
name = "RekeyCane"
emoji = "🔑"
description = "Take exclusive possession of a received cane by rotating its key."

[[actions]]
name = "RekeyHemp"
emoji = "🔑"
description = "Take exclusive possession of a received hemp by rotating its key."

[[actions]]
name = "RekeyIngot"
emoji = "🔑"
description = "Take exclusive possession of a received ingot by rotating its key."

[[actions]]
name = "RekeyPlate"
emoji = "🔑"
description = "Take exclusive possession of a received plate by rotating its key."

[[actions]]
name = "RekeyPulp"
emoji = "🔑"
description = "Take exclusive possession of a received pulp by rotating its key."

[[actions]]
name = "RekeyFiber"
emoji = "🔑"
description = "Take exclusive possession of a received fiber by rotating its key."

[[actions]]
name = "RekeyAcid"
emoji = "🔑"
description = "Take exclusive possession of a received acid by rotating its key."

[[actions]]
name = "RekeyTar"
emoji = "🔑"
description = "Take exclusive possession of a received tar by rotating its key."

[[actions]]
name = "RekeyFuel"
emoji = "🔑"
description = "Take exclusive possession of a received fuel by rotating its key."

[[actions]]
name = "RekeyGas"
emoji = "🔑"
description = "Take exclusive possession of a received gas by rotating its key."

[[actions]]
name = "RekeySlag"
emoji = "🔑"
description = "Take exclusive possession of a received slag by rotating its key."

[[actions]]
name = "RekeyFlux"
emoji = "🔑"
description = "Take exclusive possession of a received flux by rotating its key."

[[actions]]
name = "RekeySludge"
emoji = "🔑"
description = "Take exclusive possession of a received sludge by rotating its key."

[[actions]]
name = "RekeyMold"
emoji = "🔑"
description = "Take exclusive possession of a received mold by rotating its key."

[[actions]]
name = "RekeyCatalyst"
emoji = "🔑"
description = "Take exclusive possession of a received catalyst by rotating its key."

[[actions]]
name = "RekeyBinder"
emoji = "🔑"
description = "Take exclusive possession of a received binder by rotating its key."

[[actions]]
name = "RekeyLye"
emoji = "🔑"
description = "Take exclusive possession of a received lye by rotating its key."

[[actions]]
name = "RekeyDrillBit"
emoji = "🔑"
description = "Take exclusive possession of a received drill bit by rotating its key."

[[actions]]
name = "RekeySolderingIron"
emoji = "🔑"
description = "Take exclusive possession of a received soldering iron by rotating its key."

[[actions]]
name = "RekeyPressureValve"
emoji = "🔑"
description = "Take exclusive possession of a received pressure valve by rotating its key."

[[actions]]
name = "RekeySteel"
emoji = "🔑"
description = "Take exclusive possession of a received steel by rotating its key."

[[actions]]
name = "RekeyWire"
emoji = "🔑"
description = "Take exclusive possession of a received wire by rotating its key."

[[actions]]
name = "RekeyCloth"
emoji = "🔑"
description = "Take exclusive possession of a received cloth by rotating its key."

[[actions]]
name = "RekeyBoard"
emoji = "🔑"
description = "Take exclusive possession of a received board by rotating its key."

[[actions]]
name = "RekeyWax"
emoji = "🔑"
description = "Take exclusive possession of a received wax by rotating its key."

[[actions]]
name = "RekeyGrease"
emoji = "🔑"
description = "Take exclusive possession of a received grease by rotating its key."

[[actions]]
name = "RekeySolvent"
emoji = "🔑"
description = "Take exclusive possession of a received solvent by rotating its key."

[[actions]]
name = "RekeyCoating"
emoji = "🔑"
description = "Take exclusive possession of a received coating by rotating its key."

[[actions]]
name = "RekeyRubber"
emoji = "🔑"
description = "Take exclusive possession of a received rubber by rotating its key."

[[actions]]
name = "RekeyExtract"
emoji = "🔑"
description = "Take exclusive possession of a received extract by rotating its key."

[[actions]]
name = "RekeyGear"
emoji = "🔑"
description = "Take exclusive possession of a received gear by rotating its key."

[[actions]]
name = "RekeyCoil"
emoji = "🔑"
description = "Take exclusive possession of a received coil by rotating its key."

[[actions]]
name = "RekeyBearing"
emoji = "🔑"
description = "Take exclusive possession of a received bearing by rotating its key."

[[actions]]
name = "RekeyCircuit"
emoji = "🔑"
description = "Take exclusive possession of a received circuit by rotating its key."

[[actions]]
name = "RekeyCanvas"
emoji = "🔑"
description = "Take exclusive possession of a received canvas by rotating its key."

[[actions]]
name = "RekeyPanel"
emoji = "🔑"
description = "Take exclusive possession of a received panel by rotating its key."

[[actions]]
name = "RekeyPistons"
emoji = "🔑"
description = "Take exclusive possession of a received pistons by rotating its key."

[[actions]]
name = "RekeyResin"
emoji = "🔑"
description = "Take exclusive possession of a received resin by rotating its key."

[[actions]]
name = "RekeyEngine"
emoji = "🔑"
description = "Take exclusive possession of a received engine by rotating its key."

[[actions]]
name = "RekeyCasing"
emoji = "🔑"
description = "Take exclusive possession of a received casing by rotating its key."

[[actions]]
name = "RekeyPayload"
emoji = "🔑"
description = "Take exclusive possession of a received payload by rotating its key."

[[actions]]
name = "RekeyRocket"
emoji = "🔑"
description = "Take exclusive possession of a received rocket by rotating its key."

[[actions]]
name = "RekeyMachineI"
emoji = "🔑"
description = "Take exclusive possession of a received machine I by rotating its key."

[[actions]]
name = "RekeyMachineII"
emoji = "🔑"
description = "Take exclusive possession of a received machine II by rotating its key."

[[actions]]
name = "RekeyBlastFurnace"
emoji = "🔑"
description = "Take exclusive possession of a received blast furnace by rotating its key."

[[actions]]
name = "RekeyCircuitFab"
emoji = "🔑"
description = "Take exclusive possession of a received circuit fab by rotating its key."

[[actions]]
name = "RekeyCrackingUnit"
emoji = "🔑"
description = "Take exclusive possession of a received cracking unit by rotating its key."

[[actions]]
name = "RekeyReactionChamber"
emoji = "🔑"
description = "Take exclusive possession of a received reaction chamber by rotating its key."
Loading