Work with AI Agents, 16-Widget GenUI & ACP v2#
LeanUI includes an integrated Agent & MCP Mission Control (🤖 AI/M…) right inside the IDE dock. You can ask an AI agent to scaffold entire multi-project apps, wire ViewModels and Views, write Lean 4 proofs, audit accessibility, organize messy graphs, and render live interactive GenUI cards directly inside the chat thread.
1. Choosing Your Agent Provider & Model#
Open the 🤖 AI/M… panel on the right dock and click the Model / Provider picker in the bottom composer:
| Mode | Best For | Requirements |
|---|---|---|
Built-In Architect (leanui_builtin) | Instant offline scaffolding, organizing, fixing & proving | Zero API keys — works immediately locally |
API Key LLMs (Gemini, OpenAI / Codex, Claude) | Full multi-turn tool calling over all 54 MCP tools | Paste your API key (or set env var) |
Local Subscription CLIs (Claude Code, Codex CLI, Gemini CLI) | Using your existing local CLI OAuth login with LeanUI's MCP server auto-attached | Signed-in local CLI + npm run dev |
| ACP v2 (Local STDIO / Remote HTTP+SSE) | Connecting external Agent Client Protocol v2 agents (Zed/JetBrains/custom servers) | Local ACP command or Remote HTTP URL + optional Bearer token |
Live Model Discovery: Clicking the Model Picker fetches the latest available models directly from your active provider (
● Live API,● Live ACP, or● CLI) and remembers your chosen model, mode, reasoning effort, and approval policy.
2. Safety Modes, Reasoning Effort & Approval Policies#
Right inside the composer bar, tune how autonomous the agent should be:
- Agent Mode:
Full— Autonomous end-to-end build, wire, verify, and prove.Builder/Architect— Guided creation & structural refactoring.Plan— Proposes a step-by-step plan without modifying your workspace.Verifier/Debug— Audits invariants, runs traces, and repairs diagnostics.Read Only— Answers questions and inspects your Solution safely with zero edits.
- Reasoning Effort:
off·minimal·low·medium·high·max(wired natively to Gemini thinking budget, OpenAI/Codexreasoning_effort, Claude extended thinking, and ACP v2 config options). - Approval Policy:
auto(safe edits auto-approved),ask_destructive(prompts before deletes/overwrites),ask(confirm every write with Allow Once / Allow Session / Deny), orfull_auto.
3. Fast Chat Productivity: / Commands & @ Mentions#
- Type
/in the composer for instant power shortcuts:/viewmodel— Scaffold states, computeds, actions, FSMs & invariants in 1 atomic call./view— Build a complete nested View tree bound to your ViewModel./proof— Author Lean 4inductivetypes,defs, theorems, and proof rules + run Lean 4 check./organize— Organize projects/folders, check reference DAGs, and clean broken links./fix— Auto-repair WCAG contrast errors, missing accessible labels, and invalid links./preview//verify//prove— Render live GenUI preview, verify graph, or trigger real Lean 4 proof./guidelines— Browse LeanUI's recommended architecture rules inline./models//full//plan//clear— Quick session controls.
- Type
@to reference any module or project in your active Solution directly (e.g.,"Bind @TaskManager to @SessionStore and add a progress bar").
4. Interactive GenUI Cards (16 Reusable Widgets)#
Instead of walls of raw JSON, the agent responds with interactive GenUI cards rendered using Studio's own live engines:
- Live Previews & Mini-Apps:
live_preview,genui_spec_app(with 1-click Import into Solution),control_template_showcase. - Architecture & Navigation:
solution_map(click any module chip to open its tab),kpi_dashboard,diff_summary,guidelines_browser. - Logic, State & Data:
viewmodel_workbench(click actions live in chat),fsm_simulator(step transitions interactively),data_explorer,trace_debugger. - Proofs, Design & Code:
proof_matrix,wcag_palette(live AA/AAA ratios),code_inspector(syntax-highlighted Lean 4 / HTML / TSX),action_checklist, andinteractive_form.
5. ACP v2 Session Management (Fork, Resume & Replay)#
When using ACP Latest (v2) (Local STDIO or Remote HTTP+SSE), Studio's ACP tab gives you full session lifecycle control:
- List & Load past sessions with full message replay (
session/list,session/load). - Fork a session (
session/fork) to explore an alternative UI design without losing your current conversation. - Resume / Close sessions (
session/resume,session/close) and live-toggle boolean options likeauto_prove_lean.
Going Deeper#
- For the complete list of all 54 MCP tools, CLI flags, and external IDE configs (Claude Desktop, Cursor, Zed, JetBrains), see CodeGen, CLI, MCP & ACP v2 Reference.
- For best practices on structuring multi-project Solutions for humans and AI agents, see Architecture & Large-Scale Guidelines.