2.6 KiB
AGENTS.md — bimr-web
Browser app on the BIMR stack — batch-DSL Python over
bimr-wasm's single compile() export. Plan:
task/refactor/2026-08-13/white_web.md.
Build
make serve # Vite HMR dev server at /editor/ (sync-wasm + samples + mp)
make build-web # production build (sync-viewer + wasm + samples)
make build-web-dev # build for /editor/ deployment path
make sync-viewer # rebuild + sync viewer from bimr-viewer-ifcx
make sync-wasm # copy the bimr-wasm pkg into src/wasm (built by make -C ../bimr-wasm pkg)
make sync-samples # copy the subset samples from bimr-engine
make download-mp # fetch MicroPython WASM runtime (jsDelivr, pinned @1.28.0-6)
make test # Playwright app tests (after make build-web)
serve/build-web depend on download-mp (needs network on first use).
Architecture (D8 — whole-source only)
User Python → micropython.wasm → bimr_api.py (string-buffer .bimr emitter)
→ bimrModule = { compile } → compile(dsl) once → IFCX → viewer
bimr_api.pyis a subset-only buffer emitter (Point,Line,Wall,List,Column,Circle,Curve,Divide,Cut,Vector,Extrusion,Frame,Explode,Random,Slab,Level,Building—Columnlifts over aListof Points or aDivide;Extrusiontakes aListof Lines or aCut;Framelifts overExplodepairs) — no per-op WASM calls, no handles, no_h(). Unsupported vocabulary does not exist. It lives insrc/and is inlined into the bundle at build time (?rawimport) — never fetched at runtime (cache-skew incident: a stale cached body made_bimr_resetvanish in Firefox).bimrModuleis exactly{ compile }— no session, no other exports.run()compiles whole-source in both modes (python buffer / bimr doc); there is no session juggling.- The bimr view shows the live buffer (last compiled source).
Viewer
Viewer source is bimr-viewer-ifcx/src/viewer/render.ts — never edit
src/viewer.render.mjs (generated, gitignored). Run make sync-viewer; the
app bundle uses bare imports that Vite resolves from node_modules — no
runtime CDN dependency (offline-capable).
Samples
Subset corpus — canonical source is
bimr-engine/samples/python/ (building.py, grid.py,
cylinders.py; whitelisted in the Makefile). make sync-samples copies them into
public/samples/ to match public/samples/index.json. Never edit
public/samples/*.py directly.
This document should be updated as the codebase evolves.