Airsc miễn phí cho tất cả. Nếu nó giúp bạn, hãy ủng hộ $2–$20.

Ủng hộ
SkillAn toànGiao diện & thiết kếCần cài đặt chút

UIX

Deepractice · Deepractice/UIX

UIX cung cấp một giao thức và công cụ chuyển đổi AI-to-UI để chuẩn hóa đầu ra AI thành một định dạng nhất quán cho bất kỳ framework UI nào.

Lớp Giao thức IR từ AI đến UI — Chặng cuối từ AI đến Con người. Bao gồm Kỹ năng Lucid UI để tạo giao diện chuyên nghiệp bằng AI.

10 sao0Giấy phép: MITCập nhật 7 tháng trước0 lượt mở

Xem trước

▍

Bạn có thể làm gì với nó

  • Xây dựng giao diện trò chuyện có thể hiển thị đầu ra AI từ các nhà cung cấp LLM khác nhau một cách nhất quán.
  • Phát triển các thành phần UI tự động thích ứng với các định dạng nội dung do AI tạo ra.
  • Đảm bảo các thiết kế UI do AI agent tạo ra tuân thủ một hệ thống thiết kế thống nhất.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

UIX

<strong>The Last Mile from AI to Human</strong>


AI-to-UI Intermediate Representation (IR) Protocol & Conversion Engine










<strong>English</strong> |
简体中文

What UIX Is (and What It Is Not)

UIX is a protocol layer and conversion engine, not a Chat UI framework.

If you need a full-featured React chat interface, use assistant-ui — it's excellent and battle-tested. UIX solves a different problem: normalizing AI output from any source into a single, stable format.

                      ┌─────────────────────────┐
Vercel AI SDK ──────→ │                         │
AgentX ─────────────→ │   UIX IR                │ ──→ assistant-ui
AG-UI (CopilotKit) ─→ │   (unified format)      │ ──→ your own renderer
A2UI (Google) ──────→ │                         │ ──→ any UI framework
                      └─────────────────────────┘

Think of UIX as Babel for AI output — Babel normalizes JavaScript across engines; UIX normalizes AI output across providers.


The Problem

AI backends all speak different formats:

SourceMessage FormatTool Call FormatStreaming Protocol
Vercel AI SDKUIMessage.parts[]ToolInvocationPartData Stream
AgentXConversation.blocks[]ToolBlockWebSocket events
AG-UI (CopilotKit)AG-UI eventsToolCallStart/EndSSE events
A2UI (Google)Declarative UI payloadComponent-basedgRPC stream

If you build a chat UI, you're locked into one format. Switch backends? Rewrite your UI layer.

UIX IR eliminates this coupling. Your UI only knows LucidConversation and LucidBlock — adapters handle the rest.


Architecture

┌─────────────────────────────────────────────────────────────────┐
│  AI Backends (upstream)                                         │
│  Vercel AI SDK · AgentX · AG-UI · A2UI · LangChain · ...        │
└──────────────────────────┬──────────────────────────────────────┘
                           │
                    UIX Adapters (ACL)
                    Pure functions, zero side effects
                           │
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│  UIX IR  (@uix-ai/core)                                         │
│  LucidConversation → LucidBlock[]                               │
│  7 block types: text · tool · thinking · image · file · error · │
│  source                                                         │
│  JSON Schema + TypeScript types + type guards                   │
└──────────────────────────┬──────────────────────────────────────┘
                           │
               ┌───────────┴───────────┐
               ▼                       ▼
┌──────────────────────┐  ┌──────────────────────────────────────┐
│  assistant-ui        │  │  UIX Reference Renderer              │
│  (recommended)       │  │  @uix-ai/stream (StreamMarkdown)     │
│  Full chat UI runtime│  │  @uix-ai/agent (ChatBubble, etc.)    │
│  via ExternalStore   │  │  Lightweight, zero-runtime           │
└──────────────────────┘  └──────────────────────────────────────┘

Why Adapters Instead of Direct Integration?

In DDD terms, each AI backend is a separate Bounded Context. UIX adapters are the Anti-Corruption Layer (ACL) — the downstream consumer (UI) protects itself from upstream format changes.

  • Upstream (AgentX, Vercel, etc.) owns its own types — no pressure to change
  • Downstream (UI) only depends on UIX IR — immune to backend switches
  • Adapters are pure functions: fromX(input) → LucidConversation[]

UIX IR Specification

Core Types

interface LucidConversation {
  id: string
  role: 'user' | 'assistant' | 'system'
  status: 'streaming' | 'completed' | 'error'
  blocks: LucidBlock[]
  timestamp: number
}

interface LucidBlock<T extends BlockType> {
  id: string
  type: T  // 'text' | 'tool' | 'thinking' | 'image' | 'file' | 'error' | 'source'
  status: 'streaming' | 'completed' | 'error'
  content: ContentByType<T>  // conditional type, inferred from T
}

Block Types

TypeDescriptionContent
textText content (supports streaming){ text: string }
toolTool/function call{ name, input, output, status } — 9-state lifecycle
thinkingAI reasoning process{ reasoning: string }
imageImage content{ url, alt, width, height }
fileFile attachment{ name, type, url, size }
errorError message{ code, message, details }
sourceSource citation{ sourceId, title, url, excerpt }

Tool Lifecycle (9 states)

pending → streaming → ready → running → success
                                ↓
                        approval-required → approved → success
                                         → denied
                                ↓
                               error

Packages

Core (the value)

PackageDescriptionStatus
@uix-ai/coreUIX IR types, JSON Schema, type guards✅ v0.0.2

Adapters (the bridge)

PackageConverts FromStatus
@uix-ai/adapter-vercelVercel AI SDK 4.x / 6.x✅ v0.0.2
@uix-ai/adapter-aguiAG-UI protocol (CopilotKit)🚧 Alpha
@uix-ai/adapter-a2uiA2UI protocol (Google)🧪 Experimental
@uix-ai/adapter-agentxAgentX Presentation🔜 Planned

Reference Renderers (optional)

These are not the core value of UIX. They are lightweight reference implementations. For production chat UI, we recommend assistant-ui.

PackageDescriptionStatus
@uix-ai/streamStreaming Markdown renderer (Streamdown + Shiki
Xem mã nguồn trên GitHub