API / @aihu/ui

@aihu/ui

Authoring & UI

aihu styled-recipe registry — copy-paste .aihu recipes distributed as source via `aihu add` (no runtime bundle).

version
0.1.0
exports
5
values
0
types
5
01

Registry

interface
interface Registry {
  items: RegistryItem[]
}

The top-level `registry.json` artifact — the index `aihu add` reads.

02

RegistryFile

interface
interface RegistryFile {
  /** Path relative to the package root (e.g. `registry/button/button.aihu`). */
  path: string
  /**
   * Inlined source. UNSET in the v1 local index (R3 — index-only); reserved for
   * the hosted-registry path where the index also serves source.
   */
  source?: string
  /** What role the file plays. */
  type: 'component' | 'style' | 'lib' | 'block'
}

One file belonging to a registry item.

03

RegistryItem

interface
interface RegistryItem {
  /** Recipe name (e.g. `button`). */
  name: string
  /** Item kind. */
  type: RegistryItemType
  /** Human-readable description for `aihu list`. */
  description?: string
  /** The files copied by `aihu add`. */
  files: RegistryFile[]
  /** npm package dependencies (e.g. `['@aihu/primitives']`) — NOT other recipes (R5). */
  dependencies?: string[]
  /** Other recipes in THIS registry that must be pulled transitively. */
  registryDependencies?: string[]
  /** Declared variant axes — validated against the recipe `@style` selectors. */
  variants?: VariantMap
  /** Free-form metadata. */
  meta?: Record<string, unknown>
}

A single catalog entry — one styled recipe (or, post-v1, a block/style/theme/lib).

04

RegistryItemType

type
type RegistryItemType = 'ui' | 'block' | 'style' | 'theme' | 'lib'

The kind of registry item.

05

VariantMap

type
type VariantMap = Record<string, string[]>

A declared variant axis → its allowed string values (e.g.