canvas_backend.c (1882 lines) becomes canvas_window/input/draw/texture/
text/os/audio.c plus canvas_internal.h, one file per banner section the
monolith had already grown. Pure code motion: the node call-sequence
gate records an identical 413-call trace before and after.
The canvas branches in Makefile, mk/common.mk, and examples/Makefile no
longer append the backend file on top of the src/ find sweep — that
would have compiled every canvas TU twice. docs: BACKENDS.md path and
empty-TU wording, FEATURE_MATRIX.md stale 'approximated' note.
A cartridge that comes out thin (inbe's pet screen: an egg widget,
locale text, Paragraphs) was silently missing everything k2b cannot
lower. The builder now tracks dropped call kinds per file and prints
one stderr line: 'k2b: <file>: N call kinds not in KRB: Paragraph x2
draw_egg x1 ...' - pet_screen.kry reports seven, which is the honest
content of the gap.
kry_json + kry_http are provider-neutral stdlib pieces; a z.ai GLM
client (endpoint, model, key handling, wire format) is harness logic and
moved to krait (native_ai.c). inbe and other apps no longer link a
specific commercial LLM vendor.
- kry_json: dependency-free recursive-descent parser (objects/arrays/
strings with \u escapes + surrogate pairs, numbers, bools) and a
compact KryJsonBuf emitter. Depth-capped against hostile input.
- kry_http: async libcurl-easy client (HAS_LIBCURL) on the existing
KryThread worker pattern — POST-JSON/GET, poll for state, body owned
by the request. Stub when curl is absent. file:// counts as success
(HTTP code 0), which the hermetic tests use.
- kry_zai: z.ai GLM chat-completions client (OpenAI-compatible) on the
two above. Coding-Plan endpoint default, glm-4.6, ZAI_API_KEY/
ZAI_BASE_URL/ZAI_MODEL env with an in-process override; thinking
disabled for fast answers. Live test gated on ZAI_API_KEY.
- mk/vendor.mk: KRYON_CURL_TRANSITIVE_LDLIBS (brotli/zstd) the vendored
static curl needs at final link.
One raylib-style API in notification.h (SendNotification,
SendNotificationEx with tag/id/priority, CancelNotification,
CancelAllNotifications, permission probing, SetNotificationAppName),
three real backends in src/notification/notification.c:
- Android: pure JNI through the native activity -- channels on API 26+,
legacy Builder priorities on 21-25, areNotificationsEnabled /
POST_NOTIFICATIONS runtime request on 24+/33+. No Java-side code
required, so any kryon app gets notifications unchanged.
- Web: the browser Notification API via EM_JS, with an id registry so
cancel works.
- Desktop Linux: org.freedesktop.Notifications over GDBus
(KRYON_NOTIFICATION_GDBUS + gio-2.0; mk/vendor.mk exports the probe
flags). urgency + desktop-entry hints from the priority and app name.
- Everything else: honest stub (supported=0).
Verified: desktop path end-to-end against a live xfce Notifyd
(supported=1 send=1), stub branch syntax-clean, full kryon test suite
green.
The platform-mapping sed used $ regex anchors, which make expands as
variables -- KRYON_BUILD_PLATFORM came out empty and consumers got
build/-x86_64/bin/k2c. Rewrite with tr + anchor-free sed.
The LEGACY_K2C/K2IR/K2B/KT/KRYON_CMD rules copied the per-platform
build/<platform>-<arch>/bin tools to the old top-level build/bin paths.
inbe and uku hardcoded those legacy paths, which is the only reason the
aliases existed.
- mk/vendor.mk now exports the canonical tool paths (KRYON_TOOLS_BIN,
K2C) using the same platform/arch mapping kryon itself uses, so
consumers include one file instead of hardcoding paths.
- New phony 'k2c' target builds the compiler by name; consumers call
'make -C k2c'.
- Legacy alias variables and rules deleted.
Box2D was a hard dependency of libkryon.a: physics_world.c and the
Body2D/Area2D/CollisionShape2D nodes include <box2d/box2d.h>, so every
consumer had to build and link box2d even for UI-only apps.
Add a KRYON_WITH_PHYSICS toggle (default 1, current behavior):
- mk/vendor.mk exposes KRYON_PHYSICS_SRCS, KRYON_PHYSICS_CPPFLAGS, and
KRYON_PHYSICS_DEPS (empty when off) so apps can opt out in one place.
- The kryon Makefile filters the four physics sources out of SRCS and drops
the box2d include/build/link when KRYON_WITH_PHYSICS=0.
- scene_builtins.c gates the Body2D/Area2D/CollisionShape2D registration and
the physics stepper install behind #if KRYON_WITH_PHYSICS; the stepper
pointer in scene_tree.c stays NULL and is already NULL-checked, so a
physics-off lib ticks scenes safely.
The public headers were already box2d-free (b2WorldId/b2BodyId are stored as
opaque raw ints), so no header changes are needed. UI-only apps build with
KRYON_WITH_PHYSICS=0 to drop box2d entirely.
The vendored raylib copy could ship leftover .o/.a files that shadow a
recompile, causing symbol/link mismatches (the CUSTOM_CFLAGS rename drop).
Delete any prebuilt objects right after copying the sources, before the
prepare script and sub-make run, for native, web, and both Windows targets.
Some build environments cause the nested raylib sub-make to drop the
CUSTOM_CFLAGS rename header, leaving unrenamed symbols in libraylib.a
(GetCodepoint, TextSplit, LoadUTF8, etc.) that collide with kryon's
forwarders at link time. The root cause is an environment-specific
interaction between the nested make and the compiler that I could not
fully pin down despite extensive investigation (the flags are correct,
manual compiles with identical flags rename correctly, but the make-driven
compile does not).
The fix: a post-build check in KRYON_RAYLIB_DESKTOP_RULE (mk/raylib.mk)
that verifies the rename took effect and, if not, recompiles rtext.o
directly with the rename header and replaces it in the archive. Proven
correct in isolation — the recompiled rtext.o has correctly-renamed
symbols and ar rcs replaces the member cleanly.
Vendor Box2D v3.1.1 (erincatto/box2d) as a submodule; wired into
mk/vendor.mk (CMake static archive, samples/tests/benchmarks off) and
CPPFLAGS_BASE (-Ivendor/box2d/include). libkryon.a now depends on it.
Runtime:
- include/scene_tree.h: KryScene carries an opaque b2WorldId + physics_enabled;
KryScenePhysicsCreate/Destroy build/tear down the world; KryScenePhysicsTick
steps it via a function pointer installed by physics_world.c (keeps
scene_tree.c free of a box2d.h dependency)
- src/scene/physics_world.c: owns the only #include <box2d/box2d.h>; world
creation/step, body+shape creation helpers, transform sync
- src/scene/node_body2d.c: static/kinematic/dynamic body; creates b2Body on
ready, syncs transform on physics_process, debug-draws an outline
- src/scene/node_collision_shape2d.c: box/circle shape attached to the nearest
Body2D ancestor on ready
- src/scene/node_area2d.c: trigger volume (sensor) node
- include/node2d_props.h: Body2DProps/CollisionShape2DProps/Area2DProps +
allocators
- src/scene/scene_physics_internal.h: private bridge for Box2D-typed helpers
Example: examples/22_physics.kry (a dynamic box falling onto a static ground).
Replace the bare recent-projects welcome screen with a centered start
page: a New Project action that scaffolds project.kryon + a hello-world
main.kry into a chosen folder, a Recent Projects list, and an Examples
grid with one card per examples/*.kry. The sidebar is hidden when no
project is open so the start page fills the canvas; opening a .kry
selects its screen and shows the preview column.
Update examples to the current kc syntax: drop the removed `var` keyword
from all declarations (they already use `name: type = value`) and replace
the custom `set_theme` verb in 03_theme.kry with `native SetCurrentTheme`
so the generated C compiles. All 17 examples now transpile and build.
Fix the preview inspect overlay registering zero widgets. draw_preview_pane
restored the editor camera via SetUIInspectFrame(NULL) through SetUIFrame,
which wiped the widget list that DrawAppScreen had just populated. Restore
the camera directly instead, so the 17 preview widgets survive and
DrawUIInspectOverlay can outline them and click-to-source works.
Build with -fPIE in mk/common.mk so the static lib links into PIE
executables on PIE-default Linux toolchains.