Skip to content

Constannnnnt/Anya

Anya UI

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-ui
import { 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);

The spec format

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).

Entry points

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.

Repository layout

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.

Compatibility

  • Node >=20
  • ESM only
  • TypeScript 5.7+

Contributing & ops

  • Workspace setup, lint/test/build commands: see CONTRIBUTING.md.
  • Security policy: SECURITY.md.
  • Versioning: changesets — pnpm changeset, then pnpm version-packages.

License

MIT — see LICENSE.

About

Generative user interfaces that adapt based on user interactions and preferences

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors