npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@prometheusavatar/core

v0.11.1

Published

Give your AI agent an embodied avatar — Live2D rendering, TTS, lip-sync, and emotion analysis in one SDK

Downloads

77

Readme

@prometheusavatar/core

Give your AI agent an embodied avatar — Live2D rendering, TTS, lip-sync, and emotion analysis in one SDK.

Quick Start

npm install @prometheusavatar/core
import { createAvatar } from '@prometheusavatar/core';

const avatar = await createAvatar({
  container: document.getElementById('avatar')!,
  modelUrl: '/models/haru/haru.model3.json',
});

// Avatar speaks with auto-detected emotion + lip-sync
await avatar.speak('Hello! How are you today? 😊');

API Reference

createAvatar(options): Promise<PrometheusAvatar>

Factory function to create and initialize an avatar.

| Option | Type | Default | Description | |--------|------|---------|-------------| | container | HTMLElement | required | DOM element to render into | | modelUrl | string | required | URL to Live2D model JSON | | width | number | 800 | Canvas width | | height | number | 600 | Canvas height | | backgroundColor | number | 0x00000000 | Canvas background (hex) | | ttsEngine | ITTSEngine | WebSpeechTTS | Custom TTS engine | | debug | boolean | false | Enable debug logging |

PrometheusAvatar

Methods

avatar.speak(text: string): Promise<void>     // Speak with auto emotion + lip-sync
avatar.setEmotion(emotion: Emotion): void      // Manually set emotion
avatar.processText(text: string): EmotionResult // Process LLM stream (no TTS)
avatar.loadModel(modelUrl: string): Promise<void> // Switch avatar model
avatar.stop(): void                            // Stop speech + lip-sync
avatar.resize(width, height): void             // Resize canvas
avatar.getEmotion(): Emotion                   // Get current emotion
avatar.destroy(): void                         // Cleanup resources

Events

avatar.on('speech:start', ({ text }) => { ... });
avatar.on('speech:end', ({ text }) => { ... });
avatar.on('emotion:change', ({ result, previous }) => { ... });
avatar.on('lipsync:frame', ({ frame }) => { ... });
avatar.on('model:loaded', ({ modelUrl }) => { ... });
avatar.on('model:error', ({ error, modelUrl }) => { ... });

Emotions

'neutral' | 'happy' | 'sad' | 'angry' | 'surprised' | 'thinking'

Custom TTS Engine

Implement ITTSEngine to use any TTS provider:

import type { ITTSEngine } from '@prometheusavatar/core';

class MyTTSEngine implements ITTSEngine {
  async speak(text: string): Promise<void> { /* ... */ }
  stop(): void { /* ... */ }
  onAudioData?: (data: Float32Array) => void;
  onEnd?: () => void;
}

const avatar = await createAvatar({
  container: el,
  modelUrl: url,
  ttsEngine: new MyTTSEngine(),
});

What's New in v0.11 — Pro Image Generation

AssetCreator.createImage() — AAA-grade image generation backed by OpenAI GPT Image 2 (gpt-image-1) with automatic Gemini 3 Pro Image fallback. Game-store skin preview card tier output (Genshin / Overwatch / WoW quality). BYOK-friendly for zero-marginal-cost.

import { AssetCreator } from '@prometheusavatar/core';

const creator = new AssetCreator();

// Simple
const img = await creator.createImage({
  prompt: 'Anime shrine maiden with sakura petals, cel-shaded, Genshin Impact shop preview tier',
  style: 'anime',
});

// AAA Skin Preview Card (recommend ≥100-word prompts with explicit AAA benchmark named)
const skin = await creator.createImage({
  prompt: `3D cel-shaded engine render, anime shrine maiden character, slight elevated 3/4 hero pose,
glossy game-art materials, clean dark studio backdrop with subtle radial gradient, pink/peach gradient
lighting, NOT flat 2D illustration. Genshin Impact / Overwatch shop preview tier. Production-ready
AAA skin preview card.`,
  style: 'anime',
  taskType: 'aaa_skin',
  size: '1024x1536',
  quality: 'high',
  apiKey: process.env.OPENAI_API_KEY, // BYOK = zero platform cost
  upload: true,                       // upload to Supabase + return publicUrl
});

console.log(skin.publicUrl, skin.platformCostUsd);

AssetCreator.createImage(options): Promise<CreateImageResult>

| Option | Type | Default | Description | |--------|------|---------|-------------| | prompt | string | required | Recommend ≥100 words with explicit AAA benchmark named for best quality. | | style | ImageStyle | none | anime / cel-shade / cyberpunk / kawaii / fantasy / cartoon / realistic / photorealistic / pixar | | taskType | ImageTaskType | 'character' | Routes to optimal provider. aaa_skin / poster / ui_mock / game_ui → OpenAI · thumbnail / batch_variants → Gemini Flash. | | size | '1024x1024'\|'1024x1536'\|'1536x1024'\|'auto' | '1024x1024' | 1024x1536 for vertical (XHS / 9:16). 1536x1024 for landscape (X / LinkedIn / 16:9). | | quality | 'low'\|'medium'\|'high'\|'auto' | 'high' | $0.02 low → $0.07-0.19 high (gpt-image-1 pricing). | | numVariants | number | 1 | 1-4 variants. | | referenceImages | string[] | none | Data URLs or HTTPS URLs · character consistency chain across multiple calls. | | provider | 'openai'\|'gemini'\|'gemini-flash' | auto | Override · default routes per taskType. | | apiKey | string | env | BYOK — your OpenAI or Gemini key · platform billing skipped. | | upload | boolean | false | Upload to Supabase Storage and return publicUrl. |

Returns CreateImageResult:

{
  provider: 'openai' | 'gemini' | 'gemini-flash';
  taskId: string;
  imageUrl: string;       // data URL OR https URL
  publicUrl?: string;     // when upload: true
  variants?: string[];
  width: number;
  height: number;
  durationSec: number;
  platformCostUsd?: number;
}

Forge UI live at prometheus.mythslabs.ai/marketplace/create — visual 7-style picker reference.

Architecture

PrometheusAvatar (orchestrator)
├── Live2DRenderer  — PIXI.js + Live2D Cubism SDK
├── WebSpeechTTS    — pluggable TTS (Web Speech API default)
├── LipSyncEngine   — audio → mouth shape mapping
└── EmotionAnalyzer — text → emotion detection

License

MIT — Myths Labs