AIRI (LLM powered virtual character)

repository·main·Indexed 13 days ago

https://github.com/moeru-ai/airi

An LLM-powered virtual character ecosystem featuring Stage Pocket, a WebSocket bridge for the @proj-airi/server-sdk; Stage Tamagotchi, a Godot-native 3D rendering runtime for VRM avatars; and a Vue/Vite-based Server Auth UI for managing user authentication and profiles.

Tokens
348.8K
Snippets
1.1K
Records
1.6K
Agent score
99%

What's inside AIRI

  1. Overview of AIRI Server Auth UI

    main

    AIRI Server Auth UI is a Vue/Vite application designed to provide the user-facing authentication interface for the hosted AIRI server. It is deployed independently from the main server/apps/api and handles flows for Better Auth, including:

    • Sign-in and Sign-up
    • Email verification
    • Password resets
    • User profile management
    • Electron OIDC callback relay flows

    When to use it

    • When building user-facing auth pages that interact with server /api/auth/* endpoints.
    • When updating the UX for login, verification, or account profiles.
    • When deploying the authentication surface to Cloudflare Workers Static Assets.

    When NOT to use it

    • Do not use this for main stage app sign-in callback pages that consume OIDC tokens.
    • Do not use this for admin-only operational pages (these belong in the standalone proj-airi admin repository).
  2. Overview of computer-use-mcp

    main
    The computer-use-mcp package is a macOS-specific desktop orchestration service designed to act as the execution substrate for AIRI. While AIRI serves as the control plane (managing the agent shell, approval queues, and audit logs), computer-use-mcp provides the local execution layer. It enables an agent to observe the desktop/browser, run terminal commands, and perform UI interactions (mouse/keyboard) through a unified Model Context Protocol (MCP) tool surface. It is designed for orchestration and repeatable workflows rather than simple coordinate-replay automation.
  3. Overview of @proj-airi/stage-ui-three

    main

    The @proj-airi/stage-ui-three package provides Three.js runtime components, stores, composables, and diagnostics specifically designed for AIRI stage surfaces. It manages the shared Three scene root, handles the lifecycle of VRM models (loading, mounting, reusing, and disposing), and exposes state management for camera, lighting, and environment settings.

    Key Capabilities:

    • Hosts the shared Three scene root.
    • Manages VRM model lifecycle and caching.
    • Exposes a Pinia store (useModelStore) for scene configuration.
    • Provides Three-specific utilities like hit testing and render-target helpers.
    • Includes a trace submodule for runtime diagnostics.
  4. What is Stage Pocket?

    main

    Stage Pocket is a component of the AIRI VTuber ecosystem (inspired by Neuro-sama) that provides a host-backed WebSocket bridge specifically designed for use with @proj-airi/server-sdk.

    Its primary purpose is to enable secure communication between the server and the client while adhering to modern web security constraints, such as ensuring page loading occurs on secure origins (https or app-hosted local origins) to preserve access to secure-context web APIs.

  5. Overview of @proj-airi/pipelines-audio

    main
    The @proj-airi/pipelines-audio package provides shared audio-pipeline orchestration for the AIRI ecosystem. It is designed to manage reusable streaming, playback, text-chunking, and transcript-buffering policies. Crucially, this package is logic-only and does not depend on any application UI.
  6. Overview of @proj-airi/model-driver-mediapipe

    main

    The @proj-airi/model-driver-mediapipe package is a single-person motion capture workshop package. It provides a minimal closed-loop pipeline designed for consumption by stage-web.

    The Data Pipeline: camera frameMediaPipe Tasks VisionPerceptionStatecanvas overlay

    Key Technical Details:

    • Backend Assumptions: It assumes a single person (maxPeople: 1) and operates in VIDEO running mode. Landmarks are normalized (x/y in [0..1]) and rendered onto a canvas overlay.
    • Core Components:
      • PerceptionState: The middle-layer contract defining the data structure.
      • engine.ts: Handles the scheduler, dropped-frame policy, and state merging.
      • backends/mediapipe.ts: Provides the @mediapipe/tasks-vision integration.
      • utils/overlay.ts: Handles the canvas overlay rendering.
  7. Overview of @proj-airi/electron-vueuse

    main

    The @proj-airi/electron-vueuse package provides VueUse-like composables and helpers specifically designed for AIRI Electron applications. It bridges the gap between the Vue renderer process and Electron's main process behaviors.

    Key features include:

    • Renderer Composables: Helpers for common Electron behaviors such as mouse tracking, window bounds, and auto updater.
    • Eventa Integration: Reusable useElectronEventaContext and useElectronEventaInvoke patterns for ergonomic IPC communication.
    • Loop Utilities: Utilities for managing main-process loops, including useLoop and createRendererLoop.
  8. Use @proj-airi/better-ws for reliable WebSocket connections

    main

    @proj-airi/better-ws provides runtime-agnostic WebSocket primitives designed for reliable real-time connections. It manages connection lifecycles, automatic reconnection, and server-side peer management (tracking, broadcasting, and grouping) without imposing a specific message protocol like JSON-RPC or an event system.

    Use this library when you need connection lifecycle management, peer registries, and broadcast primitives, but want to maintain full control over your own message shapes or are building a custom protocol adapter on top.

    import { createClient } from '@proj-airi/better-ws'
    import { createServer } from '@proj-airi/better-ws/server'
    
    // Basic Client
    const client = createClient({
      url: 'ws://localhost:3000/ws',
      reconnect: {
        retries: Number.POSITIVE_INFINITY,
        delay: attempt => Math.min(1000 * 2 ** (attempt - 1), 30_000),
      },
    })
    
    await client.connect()
    client.send('hello')
    
    // Basic Server
    const server = createServer<string>()
    
    server.onMessage(({ server, message }) => {
      server.broadcast(message)
    })
    
    const peer = server.accept({
      id: 'peer-1',
      send(message) {
        console.info('send to runtime', message)
        return true
      },
    })
    
    peer.receive('hello')
  9. Use @proj-airi/plugin-protocol for plugin-module communication

    main

    The @proj-airi/plugin-protocol package provides the shared contract definitions required for communication between plugins and modules in Project AIRI. It is used to ensure that websocket event names and payload types remain consistent across different runtimes (server and plugin).

    Key Capabilities:

    • Defines websocket event names and payload types for orchestration.
    • Exposes Eventa event definitions bound to protocol event names.
    • Provides shared transport and event utility types.

    When to use this package:

    • When you need canonical protocol contracts for plugin-to-host communication.
    • When you need to ensure event name stability and matching payload definitions across different runtimes.

    When NOT to use this package:

    • If you only need high-level runtime client APIs (use the specific SDK packages instead).
    • If you are implementing application-only UI state that does not involve plugin/server transport contracts.
    import type { WebSocketEvent, WebSocketEventOf, WebSocketEvents } from '@proj-airi/plugin-protocol/types'
    
    import { moduleAnnounce, moduleAuthenticate } from '@proj-airi/plugin-protocol/types'