one live document"] ask["💬 You ask
'add a filter to this list'"] propose["🤖 An agent proposes
a revision"] approve["✅ You preview,
accept or reject"] plugin[("🧩 Change set
or feature")] catalogue[("🌍 Shared
others can install")] app --> ask --> propose --> approve --> plugin --> catalogue catalogue -. "install" .-> app classDef step fill:#EEF2FF,stroke:#6366F1,color:#312E81 classDef win fill:#10B981,stroke:#047857,color:#fff class app,ask,propose,approve step class plugin,catalogue win The direction: applications as complex as the professional tools people use every day, in one format, rendered natively, and shaped by the people who use them while they run. Applications Thirteen applications, from everyday apps to professional tools, all in the same format. They are examples (examples/), not part of the library, and each carries the AI assistant in its bottom right corner: ask for a change in plain words, or Point at the part to change first, then review the proposal it becomes. Each is a Lisp program (examples/
connects AI agents, both ways"] channel["🔌 Channel · modules/channel, modules/net
local sockets · processes · WebSocket · one session per peer"] vcs["🛡️ Version control · modules/vcs
allow / ask / deny · proposals · commits · history"] format["📄 Screen format · modules/format
checks the document · evaluates it · reconciles in place"] lisp["λ Lisp language · modules/lisp
builds a program's tree · runs its functions"] render["🎨 Renderer · modules/render
layout · shaped text · input · accessibility · OpenGL"] themes["🧩 Kits and themes · modules/themes
components · design tokens · JSON"] agent --> mcp mcp --> channel studio --> channel channel -- "revision" --> vcs vcs -- "accepted commit" --> format format -- "panels" --> render themes -. "components, tokens" .-> format lisp -. "programs" .-> format classDef peer fill:#FFFFFF,stroke:#CBD5E1,color:#0F172A classDef c_mcp fill:#F3E8FF,stroke:#9333EA,stroke-width:1.5px,color:#3B0764 classDef c_channel fill:#E0F2FE,stroke:#0284C7,stroke-width:1.5px,color:#0C4A6E classDef c_vcs fill:#FEF3C7,stroke:#D97706,stroke-width:1.5px,color:#78350F classDef c_format fill:#D1FAE5,stroke:#059669,stroke-width:1.5px,color:#064E3B classDef c_render fill:#EDE9FE,stroke:#7C3AED,stroke-width:1.5px,color:#4C1D95 class studio,agent peer class mcp c_mcp class channel c_channel class vcs c_vcs class format c_format class themes c_format class lisp c_format class render c_render Written in Lisp. An app is a program in AffrescoUI Lisp (LISP.md, modules/lisp): named definitions (defscreen, defview, defstate, defn, defcommand, defkey, defcustom, add-hook, advice), run by the library's own interpreter. Each definition is versioned on its own, so a diff names the view or function that changed, and a proposal is rebuilt and judged by the tree it builds. The language can't reach files, processes or the network. Its only ways out are the steps a host grants, each checked against who wrote the code that is running. One document, drawn natively. What a program builds is a screen document (SCREEN_FORMAT.md, with a JSON Schema): layout, components, themes, state, bindings, events, timers, services and permissions. It can also be written directly in JSON, for data and tools. Behaviour that usually needs code (wiring a button to a list, validating a form, filtering, drag and drop, shortcuts, navigation, calls to services) is declared, so an agent changes it as safely as a colour. Compact for agents. Edits address nodes by id ({"set": {"#title/text": "Q4"}}, stored as JSON Patch) and re-reads return only what changed: a typical edit is 28 tokens, a re-read after one commit 27 (BENCHMARKS.md). When the person points at a part, the agent reads only the definition that built it. Apps that agents can use. An app's commands are tools: an agent lists them, runs one under its own name and the app's run rules, never the person's, and can undo its runs (VERSION_CONTROL.md). Swappable layers. Modules talk only through the interfaces in modules/core, and affresco::Screen plugs them together. No public header exposes OpenGL or GLFW, and each module links on its own (affrescoui::render, affrescoui::vcs, ...) or all together (affrescoui::affrescoui). Features travel. A part declares the contribution points and contracts it needs, so one application installs another's feature, checked before it lands. A feature can hold Lisp code, which runs with its author's authority, and a person's version of an app is shared as one file (VERSION_CONTROL.md). modules/core/ the interfaces between modules: Executor, Channel, VersionControl, Services, Network modules/render/ windows, panels, layout, shaped text, input, accessibility; OpenGL 4.1 core or ES 3.0 modules/format/ the screen format: rules, checker, {{expressions}}, the runtime that reconciles in place modules/themes/ the kits' components and the themes' design tokens, as JSON built into the library modules/notation/ documents read and written in JSON or in the Lisp notation modules/lisp/ the Lisp language, a Clojure dialect: reader, interpreter, programs built purely into a document modules/data/ an app's records in SQLite, kept apart from its document: models and migrations modules/audio/ sound: voices of files, streams and generators, mixed to the system's output modules/vcs/ version control: commits, proposals, permissions, history modules/channel/ peers and the live protocol over local sockets and processes modules/net/ HTTP(S), server-sent events, WebSocket, remote peers modules/services/ language servers, local programs and folders the host grants modules/intelligence/ the providers an app's assistant asks (APIs or a command line), behind the assistant capability modules/screen/ affresco::Screen, the composition root, and the umbrella header affresco/affresco.hpp modules/automation/ scenarios: scripted input, expectations, golden images modules/imaging/ layered images on copy-on-write tiles modules/scene3d/ 3D scenes, glTF 2.0 in and out modules/export/ panel trees as vector PDF modules/capi/ the C API, affresco/affresco.h mcp/ the MCP server for AI agents apps/server/ the document server: shared, persistent documents over WebSocket apps/host/ the stock host, affrescoui_launcher: it opens an app's folder and asks for what the app uses examples/ the apps (each with a lisp/ and a json/ folder), the Launcher among them, the assistant add-on catalogue/ the apps' versions and features the Launcher's Catalogue lists and installs editors/ a VS Code extension, and a clj-kondo configuration for the Lisp programs web/ the WebAssembly build The layers, the path of a revision and of an event, and the security boundary: ARCHITECTURE.md. Written in Lisp, a Clojure dialect An AffrescoUI app is a program in AffrescoUI Lisp, a sandboxed dialect of Clojure with its own runtime, built into the library (LISP.md has every definition and rule in tables; modules/lisp, RFC 0005, RFC 0006). Its forms, functions and reader forms are Clojure's: of 186 everyday Clojure forms, 163 give Clojure's own value and the other 23 are left out or differ on purpose (everyday.lisp, checked on every test run). It is measured against Clojure's cross-dialect test suite too (CONFORMANCE.md), every difference is written down with what to write instead (differences.md), and clj-kondo lints the programs with its configuration. Every example is written in its idiomatic style (style.md). The program is a folder of small, named definitions. Building it gives the document the engine draws, and its functions run whenever a button is pressed, a key is typed or a bound value changes. From Flow's own code (examples/flow/lisp/flow.lisp): (ns flow.flow) (defn cards-of "A column's cards, in their order." [c] (:cards (column c))) (defn next-order "The order that puts a card at the end of a column." [c] (->> (cards-of c) (map :order) (reduce max -1) inc)) (defn column-of "The column that holds a card, or -1." [ref] (or (first (keep-indexed (fn [c col] (when (some #(= (:ref %) ref) (:cards col)) c)) computed.columns)) -1)) Lisp or JSON: the same app The document a program builds can also be written directly in JSON. The engine reads both: every example ships a lisp/ and a json/ folder, and the Launcher's Settings choose which one opens. The two are the same app. Their first frames match pixel for pixel, they pass the same scenarios, and they share one history, the same diffs and the same permissions. In tests of the same changes made both ways, an AI agent edited Lisp as accurately as JSON, at about the same cost (BENCHMARKS.md). (defview card-view "One card, in bold when it is a bug." [card] `(label#card :text ~card.title :bold ~(= card.tag "bug"))) (defscreen main :window {:title "Board"} (column#cards ~(repeat [card state.cards] (card-view card)))) { "type": "column", "id": "cards", "children": [ { "type": "label", "id": "card", "repeat": { "for": "card", "in": "state.cards" }, "text": "{{card.title}}", "bold": "{{(card.tag == 'bug')}}" } ] } Changed from inside, while it runs A running app can be reprogrammed from inside. In Calamaio, the text editor among the examples, open the scratch buffer (C-x b *scratch* RET), type a new definition of a command and evaluate it with C-M-x: (defcommand kill-line "Says so." :title "Kill Line" :category "Killing" [] (message "redefined")) The next C-k runs the new definition, and C-x C-z takes it back. describe-key, apropos and the describe-* functions inspect the running program. Your own editor can do the same in any Lisp app: start it with --nrepl and connect any nREPL client. The window asks once whether to let that editor evaluate as you; then every definition you evaluate lands as your own revision, in the file your buffer is (LISP.md). ./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --nrepl Only the definition that changed is rebuilt, and the running app is updated where that definition is read. Free, and still under version control Every change is a revision. Each evaluation revises one definition: it is kept in history, shown in diffs and undone like any other change. An agent's code is reviewed. It arrives as a proposal, rebuilt from its source and judged by what it builds. Once accepted, it still runs with the agent's authority, never the person's. Your authority covers only what you typed. Text pasted in or written by someone else runs with less, unless you read it in a question the app itself draws (no document or agent can draw or answer it) and say yes. Hooks and advice can't take your commands down. An agent's hooks and advice run sealed: they can't stop a person's command from working. Why it's different 🎨 Truly native A from-scratch C++23 engine on OpenGL 4.1 core or ES 3.0 (WebGL2 in the browser). No browser engine, no web view. A change updates only what reads it, only what changed is redrawn, text is sharp at every display scale, and an idle window sleeps. 📄 Live documents A whole app in one readable document: layout, components, state, {{expressions}}, events, services. Changes are compact edits by node id, atomic, and reconciled in place. 🛡️ Version control built in Content-addressed commits, proposals as branches with live preview, diff, and an undo of any earlier change that keeps the later ones; allow / ask / deny rules and change budgets. An AI can change your app but can never approve its own changes. 🤖 Agent-ready A two-way MCP server: requests from the app reach the agent, with what you pointed at, and its revisions and replies come back. Agents also run the app's commands as tools, under rules of their own. Works with Claude Code out of the box. 🔌 Any number of peers Clients, agents and scripts connect over local sockets, or over the network through the document server. Identity comes from the connection, never from what a peer claims. 🧩 Changes become plugins Any run of revisions exports as a change set, a small portable file that anyone with the same application can review and install. A whole version of an app shares as one file, installed only after review. How it works %%{init: {"theme": "base", "flowchart": {"curve": "basis", "nodeSpacing": 28, "rankSpacing": 46, "padding": 14}, "themeVariables": {"fontFamily": "Helvetica, Arial, sans-serif", "fontSize": "14px", "lineColor": "#94A3B8", "primaryTextColor": "#0F172A", "edgeLabelBackground": "#FFFFFF"}}}%% flowchart LR subgraph P["Who changes it"] direction TB you[" You
the app's assistant"] ai[" AI agent
Claude Code · MCP"] any[" Scripts & apps
any socket client"] end subgraph V["Version control"] direction TB rules{" Permission rules
deny · ask · allow"} pr[" Proposal
branch · live preview"] no[" Rejected
nothing changes"] end subgraph E["Engine"] direction TB main[(" main
SHA-256 commits")] rt[" Runtime
reconcile in place"] gl[" Renderer
C++23 · OpenGL"] end app([" Your running app
never restarts"]) you & ai & any -- "revision" --> rules rules -- "allow" --> main rules -- "ask" --> pr rules -- "deny" --> no pr -- "you accept" --> main main --> rt --> gl --> app classDef peer fill:#FFFFFF,stroke:#CBD5E1,stroke-width:1px,color:#0F172A classDef gate fill:#FFFBEB,stroke:#D97706,stroke-width:1.5px,color:#78350F classDef wait fill:#FFFFFF,stroke:#D97706,stroke-width:1px,stroke-dasharray:4 3,color:#78350F classDef stop fill:#FFFFFF,stroke:#E11D48,stroke-width:1px,color:#9F1239 classDef core fill:#EEF2FF,stroke:#6366F1,stroke-width:1.5px,color:#1E1B4B classDef out fill:#0F172A,stroke:#0F172A,color:#FFFFFF class you,ai,any peer class rules gate class pr wait class no stop class main,rt,gl core class app out style P fill:#F8FAFC,stroke:#E2E8F0,color:#64748B style V fill:#F8FAFC,stroke:#E2E8F0,color:#64748B style E fill:#F8FAFC,stroke:#E2E8F0,color:#64748B linkStyle 0,1,2 stroke:#94A3B8 linkStyle 3 stroke:#16A34A,stroke-width:2px linkStyle 4 stroke:#D97706,stroke-width:1.5px linkStyle 5 stroke:#E11D48,stroke-width:1.5px linkStyle 6 stroke:#16A34A,stroke-width:2px linkStyle 7,8,9 stroke:#6366F1,stroke-width:2px Anyone can propose a change. The host (affrescoui_launcher) renders a screen and listens for peers on local sockets. You ask through the app's assistant, pointing at what to change if you like; the AI answers through the provider chosen in the Launcher, or an agent connects through the MCP server, which works both ways; any script can connect too. Every change is a revision of compact edits. The permission rules decide: deny refuses, ask sends the change to review, allow applies it. Rules judge what a change does, not how it is written. Flow's rules, for example, let the person's own client change anything, ask before an agent changes behaviour, and protect the status bar from everyone. You review proposals. A proposal is a branch, like a pull request: the agent can refine it while you preview it live. Then Accept, Always allow (don't ask again for that part of the screen) or Reject with a reason. The modes accept edits and plan change how much is asked. Accepted changes become commits on main, with SHA-256 ids, the author and the approver. The runtime updates the running app in place, keeping focus and typing. Any commit can be undone, keeping the changes made after it (where one was built on it, you choose), or restored (VERSION_CONTROL.md). Quick start cmake -S . -B build && cmake --build build ./build/affrescoui_launcher # the Launcher: every app, your own apps, the AI settings In the Launcher's Settings, choose the AI the assistants use: Anthropic, OpenAI, an OpenAI-compatible server (such as Ollama) or your Claude Code login, and a model. Keys stay in the system's keychain. Every app you open then has a working assistant, with no MCP. To connect an AI agent through MCP instead (mcp/README.md): claude mcp add affrescoui -- python3 /path/to/AffrescoUI/mcp/affrescoui_mcp.py claude --dangerously-load-development-channels server:affrescoui # requests are pushed into the session Open Flow and ask "add a Blocked column between In progress and In review" in the board's assistant. Claude changes the running board and the change comes back as a proposal: Accept it and the app updates in place, or Always allow to stop being asked about that part of the screen. ./build/affrescoui_launcher examples/haven/lisp/index.screen.lisp # any application, no C++ ./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --mode acceptEdits # agent changes apply unless a rule asks ./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --plugin my.json # start with a change set applied Requires CMake 3.25 or later and a C++23 compiler; CMake fetches the pinned dependencies (cmake/dependencies.json). CI builds and tests it on Linux, Windows and macOS, where it is developed; web/ builds it for the browser. ctest --test-dir build runs the unit tests, every application's scenarios and the rendering check, which compares each frame with a golden image, pixel for pixel (tests/render/README.md). Use it in your app #include