yao/sui
Max a1e745ec90 chore(tests): update model versions in Anthropic tests and add Test command to SUI
- Updated testConnectorID comment and model version in TestAnthropicStreamRetry to reflect the latest model (Claude Haiku 4.5).
- Added Test command to the SUI command set with associated flags for improved testing capabilities.
2026-04-24 08:45:19 +08:00
..
api feat(doc): add yao doc CLI commands and YAML documentation for all packages 2026-04-23 21:37:43 +08:00
core feat(middleware): add support for markdown content negotiation and rendering 2026-04-02 18:55:36 +08:00
docs Enhance API Guards and Documentation 2026-01-04 16:40:23 +08:00
libsui Enhance script resolution logic and update asset metadata 2026-02-09 18:32:24 +08:00
storages Enhance guard handling and template configuration merging 2026-02-15 16:34:31 +08:00
test chore(tests): update model versions in Anthropic tests and add Test command to SUI 2026-04-24 08:45:19 +08:00
README.md Update Documentation for SUI Structure and Locale Handling 2026-01-03 15:06:32 +08:00

SUI - Simple User Interface

SUI is a full-stack web development framework that allows you to create web applications using HTML, CSS, and TypeScript/JavaScript without complex build tools.

Features

  • Page as Component: Every page is a component, unifying the development model
  • Template Syntax: Intuitive data binding, conditionals, and loops
  • Backend Scripts: Server-side logic with TypeScript
  • Scoped Styles: Automatic CSS scoping per component
  • i18n Support: Built-in internationalization
  • Agent SUI: Special configuration for AI Agent applications

Quick Start

Directory Structure

/templates/<template_name>/
├── __document.html         # Global document template
├── __data.json             # Global data (accessible via $global)
├── __assets/               # Static assets (reference via @assets/)
├── __locales/              # Locale files
└── pages/                  # All pages go here
    └── <page>/             # Route = folder name (can be nested)
        ├── <page>.html     # HTML template (filename must match folder)
        ├── <page>.css      # Styles
        ├── <page>.ts       # Frontend script
        ├── <page>.json     # Data configuration
        ├── <page>.config   # Page configuration
        ├── <page>.backend.ts  # Backend script
        └── __locales/      # Page-level locale files

Basic Page

/home/home.html:

<div class="home">
  <h1>{{ title }}</h1>
  <p s:if="{{ showMessage }}">{{ message }}</p>
</div>

/home/home.json:

{
  "title": "Welcome",
  "showMessage": true,
  "message": "Hello, World!"
}

Commands

# Build templates
yao sui build <sui> [template]

# Watch for changes
yao sui watch <sui> [template]

# Build Agent SUI
yao sui build agent

# Watch Agent SUI
yao sui watch agent

Documentation

Agent SUI

Agent SUI is designed for AI Agent applications with automatic page loading from assistants:

<app>/
├── agent/
│   └── template/              # Agent SUI template (shared)
│       ├── __document.html
│       ├── __data.json
│       ├── __assets/
│       └── pages/             # Global pages (401, 404, etc.)
│           └── <page>/
└── assistants/
    └── <name>/
        └── pages/             # Assistant pages → /agents/<name>/<route>
            └── <page>/

Build with: yao sui build agent

See Agent SUI Documentation for details.

License

This project is part of the Yao App Engine and follows the Yao Open Source License.