wieslawsoltes/LeanUI
About
Lean 4 formally verified UI framework, compiler, 54-tool MCP & ACP v2 agentic platform, and 2D/3D visual docking IDE for Views and ViewModels.
Languages & RuntimesWhat you can do
- Formal Lean 4 Verification - Real Lean 4 kernel in browser WebAssembly (zero backend) + native lake bridge, 14+ built-in theorems, decidable proofs (by decide) across Physics, Schemas, CoW Blocks, DCS Loops & WebGPU Workgroups, custom lean_type/lean_def/lean_theorem/lean_tactic/lean_axiom_atom nodes, and 5-mode Proof Visualizer. - Ch. 03
- Reporting, Provable Forms & Office OpenXML - Node-based banded reports with inline SVG charts, multi-step provable wizard forms, reusable sub-programs, and genuine zero-dependency Word (.docx), Excel (.xlsx with live formulas), PowerPoint (.pptx) & Vector PDF document builders. - Guide, Ref 19
- Office Ribbon, Rich Text, Media DSP & 2D/3D - Microsoft Word/Excel-compatible Ribbon controls (Backstage, QAT, Contextual Tabs, Galleries), node-graph Rich Text documents & fragments, low-level PCM Audio & RGBA Frame Video DSP pipelines, 2D DrawingContext & 3D WebGL assemblies, plus Atomic Math & verified 2D Physics Engine. - Tutorial 3, Controls & Media
- Clean Architecture: Domain, ORM, DI/IoC & Mocks - Visual Domain Entities, ORM/SQL mappings, Service Contracts & Classes, IoC Containers with circular & captive-dependency verification (DI001–DI004), reusable di_module sub-programs, and live Stub/Fake/Spy/Fault Mock services. - Guide, Ref 14
Measured star growth
- in 24h
- +24
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalLeanUI
Formally verified visual application framework, Lean 4 compiler, 5-target CodeGen engine, 54-tool MCP & ACP v2 agentic platform, and 2D/3D visual docking IDE for large-scale Views, ViewModels, Graphics, Shaders, Data, and Industrial Control Systems.
LeanUI lets teams visually compose complete applications from 208 typed node kinds (63 Tier 0 Atomic Primitives + 145 O(1) Copy-on-Write Cloneable Complex Blocks), design products visually in bidirectional 🎨 Design Mode with Real Figma Export (runnable Figma Plugin + REST JSON + DTCG Tokens), mathematically prove state invariants, GPU workgroup bounds, matrix/ODE solver bounds, control loop safety, WCAG accessibility, relational integrity, and control templates in Lean 4 (100% client-side in WebAssembly or via native Lake), inspect architectures in 10,000+ Scale App Flow, CAD Exploded 3D, and 3D Isometric Orbit Timelines, collaborate with AI agents over MCP (57 tools) & ACP v2, and compile cleanly to 5 maintained CodeGen targets: Lean 4 (.lean), Standalone HTML (.html), React + TypeScript (.tsx), Uno Platform 7 (C# / .NET 10), and FerroUI (Rust) — plus 6 GPU shader formats (WGSL, WebGL 2 GLSL ES 3.00, Vulkan GLSL 450, DirectX 12 HLSL SM 6.0, Apple Metal MSL 2.4, SPIR-V ASM).
- Try LeanUI Studio Live (Zero-Server Lean 4 WASM): https://wieslawsoltes.github.io/LeanUI/
- How LeanUI Works (7-Part Architecture & Capabilities Series):
docs/how-it-works/01-how-leanui-works.md - Read the Full 68-Page Visual Documentation Portal: https://wieslawsoltes.github.io/LeanUI/docs/
- Mandatory Architecture & Contribution Rules (Rules 1–8):
CONTRIBUTING.md - Detailed Implementation & Roadmap Matrix:
STATUS.md
Features Overview
| Capability | Highlights | Guide |
|---|---|---|
| Formal Lean 4 Verification | Real Lean 4 kernel in browser WebAssembly (zero backend) + native lake bridge, 14+ built-in theorems, decidable proofs (by decide) across Physics, Schemas, CoW Blocks, DCS Loops & WebGPU Workgroups, custom lean_type/lean_def/lean_theorem/lean_tactic/lean_axiom_atom nodes, and 5-mode Proof Visualizer. |
Ch. 03 |
| Universal Atomic Graph Editor (184 Kinds) | Infinite -∞..+∞ typed node-wire canvas with 53 Tier 0 Atomic Primitives and 131 Atomic-Backed Complex Blocks, universal O(1) Copy-on-Write cloning & on-the-fly editing (10,000+ scale), Main + Contextual Sub-Palettes, Visual Logic & Tactic Editor (ƒ), 5 auto-layouts, and obstacle-avoiding wire routing. |
Ch. 02, Tutorial 5 |
| WGSL-First Shaders & UI Pipeline | Full @vertex, @fragment (pixel), and @compute GPU shader graph coupled with Math, Physics, and ViewModel state; attach ui_shader_effect (frosted_glass, holographic_border, sdf_glow, etc.) to any UI control; live WebGPU/WebGL 2 surfaces & 256-particle Verlet/N-Body Compute Lab; transpiles canonical WGSL → WebGL 2, Vulkan GLSL, HLSL SM 6.0, Metal MSL & SPIR-V. |
Tutorial 7, Ref 23 |
| Industrial DCS / SCADA / ISA-101 HMI | High-performance 16-op zero-GC signal processing, Open-Loop (MAN) & Closed-Loop (AUTO / CAS Cascade) PID controllers with bumpless transfer & anti-windup, 6 continuous plant simulators, 4-level ISA-101 multi-mimic vector P&IDs (L1–L4), ISA-18.2 alarm lifecycle, SIL1–SIL3 SIS interlocks, and Swinging-Door Trending (SDT) Historian + CSV export (10k scans < 150ms). |
Tutorial 6, Ref 22 |
| Custom Data Sources & Visual Schemas | Design relational SQL & document NoSQL schemas visually from atomic fields, FKs, indexes & seeds; run live CRUD locally/virtually in DbWorkbench; generate 12+ dialect DB init scripts (PostgreSQL, SQLite, MySQL, SQL Server, MongoDB, Firestore, DynamoDB, etc.) and register custom driver plugins via DataSourceRegistry. |
Tutorial 4, Ref 20 |
| Reporting, Provable Forms & Office OpenXML | Node-based banded reports with inline SVG charts, multi-step provable wizard forms, reusable sub-programs, and genuine zero-dependency Word (.docx), Excel (.xlsx with live formulas), PowerPoint (.pptx) & Vector PDF document builders. |
Guide, Ref 19 |
| Office Ribbon, Rich Text, Media DSP & 2D/3D | Microsoft Word/Excel-compatible Ribbon controls (Backstage, QAT, Contextual Tabs, Galleries), node-graph Rich Text documents & fragments, low-level PCM Audio & RGBA Frame Video DSP pipelines, 2D DrawingContext & 3D WebGL assemblies, plus Atomic Math & verified 2D Physics Engine. |
Tutorial 3, Controls & Media |
| Clean Architecture: Domain, ORM, DI/IoC & Mocks | Visual Domain Entities, ORM/SQL mappings, Service Contracts & Classes, IoC Containers with circular & captive-dependency verification (DI001–DI004), reusable di_module sub-programs, and live Stub/Fake/Spy/Fault Mock services. |
Guide, Ref 14 |
| Control Templates, Live Previews & 3D Inspection | WCAG AA/AAA contrast-verified style tokens, Light/Dark & i18n Resource Dictionaries, node-based control_templates, inline canvas previews (app_preview, template_preview), 4-layer CAD Exploded Assemblies (❖ Explode), and 3D Isometric Orbit Timelines (🧊 3D Orbit) with ViewCube & 3DFORBIT. |
Ch. 08, Ch. 10 |
| 10,000+ Scale Flow, Scratchpad & Debugger | Macro App Flow (⬡ Flow) with 10k-module clustering & heatmaps, Scratchpad Live Testing (✎ Scratchpad), Multi-View Board (⊞ Multi), Clickable Prototype Runner (▶ Proto), Time-Travel Debugger (⏱ Timeline), and 44 Presets + 29 Solution / 16 Project / 49 Item Templates. |
Flow, Scratchpad, Ch. 05 |
| 5-Target CodeGen, CLI, 54-Tool MCP & ACP v2 | Unified emitters for Lean 4, Standalone HTML, React TSX, Uno Platform 7 (C#) & FerroUI (Rust), SVG/PNG/PDF diagram exporter, @leanui/cli, 54-tool MCP (2025-03-26) server, 16 GenUI chat widgets, and ACP Latest (v2) agent harness. |
Ch. 07, Agents Guide |
Quick Start
# 1. Install monorepo dependencies (Node.js 20+ & npm 10+)
npm install
# 2. Fetch client-side Lean 4 WASM Init assets (~47 MiB compressed, gitignored)
npm run fetch:lean-wasm
# 3. Build all workspace packages, Studio & 59-page static Docs portal
npm run build
# 4. Run full unit, verifier, 5-target CodeGen, CLI, MCP (54-tool) & ACP v2 tests
npm test
# 5. Start LeanUI Studio (http://localhost:5173 + live /docs, /mcp, /acp & /agent endpoints)
npm run dev
Optional Server, Native Lean & .NET Commands
# Standalone MCP server (STDIO or Streamable HTTP on :4178)
npm run mcp:stdio
npm run mcp:http
# Standalone ACP v2 Agent Server (STDIO or Remote HTTP+SSE on :4179)
npm run acp:stdio
npm run acp:http
# Build static Docs portal only (output: apps/studio/dist/docs — 59 pages, 178 SVGs)
npm run build:docs
# Regenerate examples & verify with native Lean 4 (requires elan / Lean v4.14.0)
npm run generate:examples
npm run verify:lean
npm run codegen:lean
# Build & test .NET LeanUI integration packages
npm run test:dotnet
Documentation (68 Pages · 198 Live Annotated SVGs)
Browse the interactive Hosted Documentation Portal (Cmd+K searchable, Light/Dark synced, 100% live annotated visual coverage) or explore docs/README.md:
| Track | Guide | What You'll Learn |
|---|---|---|
| How It Works | How LeanUI Works (7-Part Architecture Series) | Deep-dive series covering how LeanUI works end-to-end, 16-package monorepo architecture, 196-node CoW engine, 128 verifier rules + Lean 4 WASM, 5-target CodeGen + WebGPU/SIMD, Studio internals & 10 real-world domains |
| Start Here | Overview & Curriculum Map | Complete 9-track curriculum map across all 68 pages and 46 presets |
| Start Here | Quick Start & Studio Tour | Open in browser or locally in 2 minutes + full Studio tour |
| Tutorials | Tutorials 1–8 (Hands-On Visual Guides) | First Verified App, Task Tracker, Atomic Math & Physics, Custom DBs & Schemas, Universal CoW Cloning, Industrial DCS/SCADA/HMI, WGSL Shaders & Matrix/Dynamic Systems GPU |
| Node Catalog | Node Catalog Hub (196 Kinds · 14 Chapters) | Category-split per-node reference (docs/nodes/01–14) with Tier 0/1/2 stratification |
| Technical Refs | References 03–23 | Lean 4 Proofs, DI/ORM, 2D/3D, Rich Docs, Media DSP, Ribbon, Reporting/Forms/Office, Custom DBs, Universal Atomic CoW, DCS/SCADA/HMI & WebGPU Shaders |
| Contributing | Mandatory Architectural Rules (Rules 1–8) | Atomic-first stratification, 100% palette & CoW parity, 5-target CodeGen & 100% visual docs |
Monorepo Architecture
LeanUI/
├── LICENSE # MIT License
├── CONTRIBUTING.md # Mandatory Architectural & Documentation Rules (Rules 1–8)
├── .github/workflows/pages.yml # Zero-server GitHub Pages CI (Studio + Docs + Lean 4 WASM)
├── scripts/build-docs.mjs # Zero-dependency 59-page static Docs portal & SVG generator
├── docs/ # 59 documentation pages (Tutorials 1–7, Refs, Nodes Ch. 1–13)
├── apps/
│ └── studio/ # @leanui/studio — Vite + TypeScript 2D/3D visual docking IDE
├── packages/
│ ├── core/ # @leanui/core — 184-node graph model, CoW registry, Physics, DCS, WGSL Shaders, 44 presets
│ ├── verifier/ # @leanui/verifier — Static & bounded verifier (TYPE/INV/DATA/DI/GFX/DOC/MED/RIB/RPT/PHY/CDS/COW/DCS/SHD)
│ ├── codegen-common/ # @leanui/codegen-common — Shared emitters, ZIP/PDF builders & plugin registry
│ ├── codegen-lean/ # @leanui/codegen-lean — Lean 4 spec, decidable theorem & Lakefile emitter
│ ├── codegen-html/ # @leanui/codegen-html — Standalone HTML & connected prototype emitter
│ ├── codegen-react/ # @leanui/codegen-react — React + TypeScript TSX & Vite project emitter
│ ├── codegen-uno-reactor/ # @leanui/codegen-uno-reactor — Uno Platform 7 (C# / .NET 10 / XAML) emitter
│ ├── codegen-ferroui/ # @leanui/codegen-ferroui — FerroUI (Rust / rsx! / wgpu) emitter
│ ├── codegen-diagrams/ # @leanui/codegen-diagrams — Annotated Light/Dark SVG & PDF diagram renderer
│ ├── codegen/ # @leanui/codegen — Umbrella multi-target CodeGen package
│ ├── lean-wasm/ # @leanui/lean-wasm — Client-side Lean 4 WebAssembly kernel (Web Worker)
│ ├── lean-server/ # @leanui/lean-server — Optional native Lean 4 bridge (`lake env lean --json`)
│ ├── mcp-server/ # @leanui/mcp-server — Full-IDE MCP 2025-03-26 server (54 tools, 7 resources, 6 prompts)
│ ├── agent-harness/ # @leanui/agent-harness — Multi-provider Coding Agent Harness & ACP v2 Server/Client
│ └── cli/ # @leanui/cli — CLI compiler, verifier & solution scaffolder
├── dotnet/ # .NET / C# LeanUI integration & source generator packages
├── lean/ # Native Lean 4.14.0 Lake project & Lean-native HTML/JS compiler
├── examples/ # Generated standalone HTML, React TSX & Lean-compiled sample apps
└── STATUS.md # Detailed capability status & roadmap matrix
Zero-Server GitHub Pages Deployment
LeanUI Studio and its full 59-page Documentation Portal deploy automatically to GitHub Pages on push to main:
- Client-Side Lean 4 Proving:
coi-serviceworker.jsenablesSharedArrayBufferon static hosts, while.github/workflows/pages.ymlbundles the cached Lean 4 WASM Init runtime (lean-wasm-v1). - Portable Relative Routing: Vite builds with
base: './'so Studio,/docs/, and/examples/work on both custom root domains and/<repo>/project paths.
License
LeanUI is licensed under the MIT License. See LICENSE for the full license text.
Explore related projects
Loading…