From 08413e9c29ca371b9514de51c07cfda6066d323e Mon Sep 17 00:00:00 2001 From: calic Date: Tue, 28 Jul 2026 10:35:57 +0000 Subject: [PATCH] =?UTF-8?q?feat(crafting):=20lib-core.crafting=20v0.3.0=20?= =?UTF-8?q?=E2=80=94=20property-constraint=20slots=20+=20non-consumed=20to?= =?UTF-8?q?ols=20+=20multi-output=20(ADR-0055);=20vagrant-skeleton=20debug?= =?UTF-8?q?-drive=20hook=20for=20headless=20scenario=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index cd43e69..990dc69 100644 --- a/init.lua +++ b/init.lua @@ -1287,4 +1287,18 @@ function init(ctx) M.init(ctx) end function update(ctx, dt) M.update(ctx, dt) 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