A minimal generative UI framework. Agents produce markdown with embedded affordances; the framework renders them to interactive DOM and reports user actions back.
Agent → Spec → anya-ui → User → Agent
The agent writes a markdown document. The framework renders it. The user acts. The framework encodes what happened. The agent receives it on the next turn.
anya-ui doesn't know about your agent, your tools, or your backend. It knows one thing: how to turn a spec into interactive DOM and tell you what the user did.
npm install anya-uiimport { mount, encode } from 'anya-ui';
const ui = mount(specString, document.getElementById('app'));
ui.on('action', (feedback) => {
sendToAgent(encode(feedback));
});
// Agent responds with new spec
ui.update(newSpecString);Standard markdown for content. Fenced YAML blocks for interactive affordances.
# Your Tasks
3 items need attention today.
```action
name: mark_done
label: Mark PR #42 done
params:
id: 42
```
```input
name: add_task
submit: Add
fields:
- name: title
type: text
- name: priority
type: select
options: [high, medium, low]
```Four primitives: Content (markdown), Action (named button), Input (named form), Group (layout container).
| Import | Purpose | DOM required? |
|---|---|---|
anya-ui |
Full renderer + protocol | Yes |
anya-ui/protocol |
Parse, encode, prompt builder | No |
anya-ui/measure |
Signal collection + friction scoring | Yes |
Use anya-ui/protocol when you only need to parse specs or encode feedback — useful for server-side tooling, React Native bridges, or custom renderers.
This is a pnpm workspace. The published package lives at packages/anya-ui — see its README for the full API, framework integration examples (React, Web Components), measurement module, and styling.
- Node
>=20 - ESM only
- TypeScript 5.7+
- Workspace setup, lint/test/build commands: see CONTRIBUTING.md.
- Security policy: SECURITY.md.
- Versioning: changesets —
pnpm changeset, thenpnpm version-packages.
MIT — see LICENSE.