feat(crafting): lib-core.crafting v0.3.0 — property-constraint slots + non-consumed tools + multi-output (ADR-0055); vagrant-skeleton debug-drive hook for headless scenario testing

This commit is contained in:
calic
2026-07-28 10:35:57 +00:00
parent c3290058c1
commit 08413e9c29

View File

@@ -1287,4 +1287,18 @@ function init(ctx) M.init(ctx) end
function update(ctx, dt) M.update(ctx, dt) end function update(ctx, dt) M.update(ctx, dt) end
function render(ctx) M.draw(ctx) end function render(ctx) M.draw(ctx) end
-- Debug-drive hook (headless/agent testing): when SPOREL_DEBUG_DRIVE is set,
-- expose the module state + the crafting/inventory/composition lib instances as
-- a global so lua.eval scenarios can reach the backpack, world items, and the
-- crafting API. `state` is a live table reference — its handles get populated in
-- M.init, so reads after init see the real entities. No-op in normal runs.
if os.getenv("SPOREL_DEBUG_DRIVE") then
_G.__vagrant = {
state = state,
crafting = crafting,
inventory = inventory,
composition = composition,
}
end
return M return M