The encoder walked a value by calling itself through map(), and a
patch pass walked the tree again the same way. Inside a kernel,
where a script runs on a 16 KiB stack, that ran out after three
levels: each map() level costs a native frame plus two JS frames,
where a plain loop costs one.
Walk from an explicit list of what is left to encode, and let the
byte chunks patch themselves once their offsets are known, so the
second pass is gone.
Lay the groundwork for a GTK/Adwaita frontend by extracting
shared infrastructure into a LumaCore Swift package. Agent
sources and LumaBundleCompiler move to top-level locations
so both the Xcode project and SPM can reference them.
New structure:
- Package.swift: root manifest with LumaCore lib + compiler
- Sources/LumaCore/: engine, persistence, models, and
platform-abstracted token store
- Sources/LumaBundleCompiler/: moved from LumaBundleCompiler/
- Agent/: moved from Luma/Agent/
- LumaGtk/: skeleton GTK app package