Skip to main content

Overview

The @proj-airi/stage-ui package provides the core business components, state management stores, and composables shared across AIRI stage applications (stage-web, stage-tamagotchi, stage-pocket).

Installation

This package is marked as private and is intended for use within the AIRI monorepo.

Package Structure

The package is organized into several key areas:
  • Components: Business-specific Vue components
  • Composables: Reusable Vue composition functions
  • Stores: Pinia state management stores
  • Types: TypeScript type definitions
  • Utils: Utility functions
  • Workers: Web Workers for background tasks
  • Tools: Tool integrations

Exports

The package provides multiple export paths for different use cases:

Components

Stage UI includes a comprehensive set of business components:

Component Categories

  • Auth: Authentication and user management
  • Data Pane: Data visualization and management
  • Gadgets: Interactive widgets and tools
  • Graphics: Visual rendering components
  • Layouts: Page and section layouts
  • Markdown: Markdown rendering and editing
  • Menu: Navigation and menu systems
  • Misc: Utility components
  • Modules: Module-specific components
  • Physics: Physics simulation components
  • Scenarios: Use-case-specific components
  • Widgets: Reusable widget components

Usage Example

Composables

Vue composables for common functionality:

Audio Composables

Canvas Utilities

Chat Session

Analytics

Optimistic Updates

Markdown Processing

LLM Marker Parser

Stores

Pinia stores for state management:

AI Store

Audio Store

Character Store

Characters Store

Chat Store

Providers Store

Settings Store

Display Models Store

Types

TypeScript type definitions:

Utils

Utility functions:

TTS Utilities

Workers

Web Workers for background processing:

VAD Worker

Kokoro Worker

Integration with Stage Applications

Stage Web

Stage Tamagotchi

Stage UI integrates with other stage packages:
  • @proj-airi/stage-ui-three: Three.js rendering components
  • @proj-airi/stage-ui-live2d: Live2D character rendering
  • @proj-airi/stage-shared: Shared logic and utilities
  • @proj-airi/ui: Base UI component primitives
  • @proj-airi/audio: Audio processing utilities

Dependencies

Key dependencies include:
  • Vue 3 and Vue Router
  • Pinia for state management
  • VueUse for composition utilities
  • XSAI packages for AI operations
  • transformers.js for ML models
  • DOMPurify for HTML sanitization
  • date-fns for date handling

Best Practices

Prefer composables over options API for better reusability and type safety.
Import stores only when needed to reduce initial bundle size.
Always use TypeScript imports for better IDE support and type checking.
Use Pinia stores for cross-component state rather than prop drilling.
Use Web Workers for CPU-intensive tasks like audio processing and ML inference.

Next Steps

Audio Package

Learn about audio processing utilities

Server SDK

Connect to AIRI server runtime