aora-bot README

The project's README from github.com/sam70361/aora-bot. As one markdown file: README.md.

Aora Bot

面向 Web 的程序化角色引擎:一整套由代码生成的角色,配有动画状态、十六种脸型、四种画风和 SVG HUD,以及基于它们的 UI 组件。

控制台 | 文档 | 场景 | 表情馆 | English

npm CI License: MIT

六个 Aora Bot 角色:球球、草莓、猫、星星、机器人和云宝,在开心、兴奋、害羞、惊讶、好奇、思考、入睡、生气、庆祝与大笑之间不停切换


这是什么

Aora Bot 的卡通角色完全由代码绘制,不用精灵图,也不用 Lottie 文件。每个角色的身体是一条轮廓线,耳朵、叶子、天线这类部件单独绘制;每个表情是几个数字描述的曲线笔画,由弹簧驱动过渡;每一帧动画都由 requestAnimationFrame 循环直接写入 SVG 属性。

阵容共有 71 个角色,从圆滚滚的团子、年糕,到水果、甜点、小动物、物件、人物和煤球。下图是全体成员开心的样子,每个角色都用自己的脸型和颜色,排在第一位的是奶白色的小圆球「球球」:

全部 71 个阵容成员排成网格,个个笑着,下方标注成员 id,第一个是球球

此外还有 7 个节日与季节主题:万圣节、圣诞节、春节、中秋节、复活节、夏日和情人节,共 122 个主题角色。每个主题都是单独的入口(@aora-bot/engine/themes/<id>),用到时才加载,不会增加主包体积。全部主题见主题展。

7 个主题各一行,每行 6 个主题角色,个个笑着,下方标注角色 id

每个角色都由几项相互独立的设置组合而成:角色本身、画风(vector、pixel、kaomoji 或 ascii)及其变体、墨色、脸型和动画状态。这些都可以在控制台里直接试。

球球的所有画风:十六种 vector 变体,以及 pixel、kaomoji、ascii 各自的全部变体,同步动起来
球球的所有画风:vector(solid、outline、glass、sticker、paper、soft、riso、pencil、marker、crayon、watercolor、neon、chalk、origami、relief、gothic)、pixel(crisp、dot、block)和 kaomoji(plain、bubble)。

引擎之上是一组 React 组件,覆盖产品里常用的角色功能:根据任意 id 给每个用户分配固定的角色,形状与颜色选择器,支持图片裁切的头像编辑器,群组头像,聊天里的活动提示,供 AI 智能体使用的数字情绪协议,在角色外圈显示进度、计时、波形和 KPI 的 HUD,以及让上百个角色共用少量动画的舞台。引导流程、受限状态场景、模板发布、占用列表和角色编排放在另一个包里,基于这些组件构建。

默认脸型是 cute(圆点眼、小嘴和腮红)。此外还有 eyes、线条脸 line(鼻子和嘴与眼睛同墨色、同线宽)和 13 种手绘脸,共 16 种,用 face 选择,见五官。

快速开始

pnpm add @aora-bot/react
import { CharacterMark } from '@aora-bot/react';
import '@aora-bot/react/styles.css';

<CharacterMark shape="mochi" state="happy" sizePx={96} />;

需要 React 19。产品组件(引导页、场景、模板对话框、占用列表、角色编排)是可选的,需要单独安装:

pnpm add @aora-bot/surfaces @aora-bot/react
import { RestrictedScene } from '@aora-bot/surfaces';
import '@aora-bot/react/styles.css';
import '@aora-bot/surfaces/styles.css'; // 放在 react 样式之后

不用 React 时,一个 script 标签就能把角色放进任意网页:

<script type="module" src="https://cdn.jsdelivr.net/npm/@aora-bot/element"></script>
<aora-bot character="mochi" state="happy" size="96"></aora-bot>

只需要头像图片时,把头像接口的地址写进 <img> 即可,同一个 id 始终对应同一个角色:

<img src="https://aora-bot.vercel.app/avatar/alice.svg" width="64" height="64" alt="alice" />

CDN 引入和头像接口目前在中国大陆无法访问;通过 npm 安装、随项目一起打包则不受影响。面向大陆用户的访问方案正在规划中。

包

包 作用
@aora-bot/engine 核心引擎:形状与画风、五官拟合、姿态投影、弹簧积分器、状态机、腰带、HUD 表盘、粒子、情绪协议与仲裁器。不依赖 React,/static 和 /agent 入口也不依赖 DOM。
@aora-bot/element <aora-bot> Web Component,不依赖 React;另有内置引擎的单文件 CDN 版本,一个 script 标签即可引入。
@aora-bot/react React 组件:CharacterMark、CharacterStageProvider、头像与群组头像、选择器、头像编辑器、活动徽标、HUD 底盘、智能体状态、精灵图、庆祝特效和多语言。
@aora-bot/surfaces 基于 @aora-bot/react 的产品组件:引导页、场景、模板对话框与发布、占用列表、角色编排。引擎和 React 包作为 peer 依赖。

每个包都有自己的 README:packages/engine、packages/element、packages/react、packages/surfaces。

仓库结构

packages/engine/     从零实现的角色引擎(TypeScript)
packages/element/    不依赖 React 的 Web Component
packages/react/      React 组件层
packages/surfaces/   基于 React 组件层的产品组件
docs/                Rspress 文档站
api/                 头像接口(Vercel Function)
examples/            独立示例,不参与工作区构建

从 Emotion Ball 表情馆到 Aora Bot

本仓库原为 Emotion Ball 表情馆,现已正式升级为 Aora Bot。经典版完整保留在 emotion-ball 分支,沿用原有授权,不再更新,仍可在线体验。

参与贡献

见 CONTRIBUTING.md。

打赏作者

如果 Aora Bot 让你的界面多了一点表情,欢迎请作者喝杯咖啡。

微信支付
微信支付收款码
支付宝
支付宝收款码

更多说明见打赏页面。

联系作者

个人微信二维码
加我微信交流:使用问题、合作或建议都欢迎
QQ 交流群二维码
加入 QQ 交流群:群号 626080597

成为赞助商

Aora Bot 的用户主要是前端、AI 和硬件开发者,也有设计师用它制作头像和吉祥物。赞助商的标志会展示在这里和打赏页面上。

首席赞助
虚位以待
赞助商
虚位以待
赞助商
虚位以待

读者主要是 React 与前端开发者、AI 智能体开发者、硬件创客、设计师和独立开发者。适合的赞助方包括:

添加上方微信,备注「Aora Bot 项目赞助」即可洽谈。

许可证

Aora Bot 以 MIT 许可证开源,范围包括源代码、角色设计(造型、配色、五官、动画状态及相关数据)、文档和示例。个人和公司都可以免费使用、修改和分发,包括商用,只需在分发的副本中保留版权声明和许可声明。此前发布的所有版本也都可以按 MIT 使用。

经典版 Emotion Ball 表情馆不在 MIT 范围内,沿用其分支内的原有授权,见 emotion-ball 分支。

aora-bot (sam70361/aora-bot)

Searching Database…

What is this?Emotion Ball is a facial-expression engine for AI assistants: 32 state-based expressions driven entirely by pure SVG and vanilla JavaScript, with zero frameworks and zero image assets. The AI side just outputs an emotionId and the ball switches to the matching expression.
Is this a standalone app or something I embed into my own project?It is a lightweight embeddable widget library — just HTML, SVG and vanilla JS with no build step — meant to be dropped into chatbots, desktop pets, or floating assistants, not run as a standalone app.
How do I get it running?Include the engine's core script files in order to create a ball instance, or just open index.html directly (ideally through a local server so Google Fonts load correctly).
Do I need a build tool or framework to use it?No — it has zero dependencies and no build step; it's plain HTML, SVG and vanilla JavaScript that can be dropped straight into an Electron floating window.
What happens if the AI sends a bad or unknown emotionId?The engine automatically falls back to the idle expression and fires an 'error' event — unknown IDs, JSON parse failures, or missing fields never leave the ball blank.
Can I run this as a desktop pet in Electron?Yes — the README gives explicit Electron integration settings: a transparent, frameless, always-on-top window with mouse-event passthrough so clicks go through while the ball still reacts to gaze.
What are the license terms?The engine source code and expression data are dual-licensed: free for personal/non-commercial use, with a paid commercial license available. The ball-shaped character visuals (blob/wedge/gem body designs) are for personal study only and will never get a commercial license.
What body shapes does the ball support?Three built-in body shapes — blob (round), wedge (triangle), and gem (diamond) — all share the same eye and animation system, which automatically adapts to each outline.
How are the 32 expressions organized?The emotionId uses a tens-digit prefix grouping: 00-09 are lifecycle states, 10-29 are emotional reactions, 30-49 are agent/task states, and 50+ is reserved for custom expressions, so integrators can hardcode IDs safely since numbers are never reused.
Can I create my own custom expressions?Yes — every expression is a pure data configuration (eye-ring pool + animation primitives + keyframe sequence), and the engine supports runtime registration plus import/export of configs without touching engine code.
Does it stay efficient with many instances on screen?Yes — all instances share a single requestAnimationFrame heartbeat, so adding more balls doesn't increase loop overhead, and thumbnail walls can set autostart:false and toggle rendering with setActive only when visible.
Creator
sam70361
Size
34.5 MB
Stars
675
Updated
CommitNov 08
Age
3mo
Commits · 90 Days