@kodax-ai/botui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -6
- package/core/identity.js +46 -0
- package/{themes/solids → core}/motion.js +114 -114
- package/core/registry.js +26 -18
- package/docs/usage.md +202 -0
- package/element.js +5 -0
- package/index.d.ts +2 -0
- package/index.js +11 -9
- package/package.json +33 -2
- package/themes/caret/README.md +43 -0
- package/themes/caret/avatar.js +10 -0
- package/themes/caret/engine.js +143 -0
- package/themes/caret/index.d.ts +24 -0
- package/themes/caret/index.js +35 -0
- package/themes/critter/README.md +43 -0
- package/themes/critter/avatar.js +12 -0
- package/themes/critter/engine.js +113 -0
- package/themes/critter/index.d.ts +28 -0
- package/themes/critter/index.js +35 -0
- package/themes/doodle/README.md +43 -0
- package/themes/doodle/avatar.js +10 -0
- package/themes/doodle/engine.js +149 -0
- package/themes/doodle/index.d.ts +24 -0
- package/themes/doodle/index.js +36 -0
- package/themes/dots/README.md +42 -0
- package/themes/dots/avatar.js +15 -0
- package/themes/dots/engine.js +179 -0
- package/themes/dots/index.d.ts +24 -0
- package/themes/dots/index.js +35 -0
- package/themes/kaomoji/README.md +42 -0
- package/themes/kaomoji/avatar.js +10 -0
- package/themes/kaomoji/engine.js +110 -0
- package/themes/kaomoji/index.d.ts +24 -0
- package/themes/kaomoji/index.js +35 -0
- package/themes/liquid/README.md +47 -0
- package/themes/liquid/avatar.js +10 -0
- package/themes/liquid/engine.js +161 -0
- package/themes/liquid/index.d.ts +24 -0
- package/themes/liquid/index.js +35 -0
- package/themes/matrix/README.md +4 -2
- package/themes/matrix/avatar.js +24 -19
- package/themes/matrix/engine.js +61 -25
- package/themes/matrix/index.d.ts +2 -1
- package/themes/matrix/index.js +9 -15
- package/themes/orb/README.md +44 -0
- package/themes/orb/avatar.js +10 -0
- package/themes/orb/engine.js +130 -0
- package/themes/orb/index.d.ts +24 -0
- package/themes/orb/index.js +36 -0
- package/themes/solids/README.md +1 -1
- package/themes/solids/avatar.js +6 -24
- package/themes/solids/face.js +52 -56
- package/themes/solids/index.js +34 -28
package/themes/matrix/engine.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The matrix theme's model: a 5x5 dot screen on a coloured tile.
|
|
2
2
|
//
|
|
3
3
|
// It acts out the same states and gestures as the solids. The pose and gesture
|
|
4
|
-
// tables are
|
|
4
|
+
// tables are shared by every theme (core/motion.js); this file draws them flat.
|
|
5
5
|
// Turning slides the face across the screen and, past about a quarter turn,
|
|
6
6
|
// flips the tile like a card. Expressions are dot patterns. Signal states, and
|
|
7
7
|
// the matrix's own thinking, streaming and finished, play on the screen. Marks,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// attributes, so the same Bot and the same inputs always give the same frames.
|
|
15
15
|
// First drawn by RSIBot (ui/bot-avatar/engine.js), moved here on 2026-11-28.
|
|
16
16
|
|
|
17
|
-
import {REST, POSES, GESTURES, FIDGETS} from '
|
|
17
|
+
import {REST, POSES, GESTURES, FIDGETS} from '../../core/motion.js';
|
|
18
18
|
import {resolveState} from '../../core/states.js';
|
|
19
19
|
import {TAU, ease, clamp, bump, hash, random} from '../../core/core.js';
|
|
20
20
|
|
|
@@ -54,6 +54,13 @@ const OUTLINES = {
|
|
|
54
54
|
hex: () => polygonPath(6, 41, 7),
|
|
55
55
|
};
|
|
56
56
|
export const matrixShapes = Object.freeze(Object.keys(OUTLINES));
|
|
57
|
+
/** The tile outlines, in the same form as the solids' SHAPES. */
|
|
58
|
+
export const SHAPES = [
|
|
59
|
+
{name: 'squircle', zh: '圆角方', group: 'tile'},
|
|
60
|
+
{name: 'circle', zh: '圆', group: 'tile'},
|
|
61
|
+
{name: 'hex', zh: '六边形', group: 'tile'},
|
|
62
|
+
];
|
|
63
|
+
export const GROUPS = {tile: '屏幕外形'};
|
|
57
64
|
export const matrixShapeForId = identity => matrixShapes[hash(identity + '/shape') % matrixShapes.length];
|
|
58
65
|
|
|
59
66
|
/**
|
|
@@ -175,9 +182,11 @@ const ZERO = {yaw: 0, pitch: 0, roll: 0, sy: 0, lift: 0, scale: 0, gx: 0, gy: 0}
|
|
|
175
182
|
// Small turns barely narrow the tile; real turn-arounds pass through edge-on to the back.
|
|
176
183
|
const turnOf = angle => { const a = abs(angle); return sign(angle) * (a < KNEE ? a * SOFT : KNEE * SOFT + (a - KNEE) * (Math.PI - KNEE * SOFT) / (Math.PI - KNEE)); };
|
|
177
184
|
|
|
178
|
-
class Matrix {
|
|
185
|
+
export class Matrix {
|
|
186
|
+
/** The shapes the model can draw; a theme with other bodies sets its own. */
|
|
187
|
+
static shapes = matrixShapes;
|
|
179
188
|
constructor({identity = 'bot', hue, chroma, light, dots, edge, shape, eyes = 'tall', state = 'idle', progress = null, size = 36, emphasized = false}) {
|
|
180
|
-
if (!
|
|
189
|
+
if (!this.constructor.shapes.includes(shape)) throw new TypeError('Unknown shape: ' + shape);
|
|
181
190
|
if (!Number.isFinite(hue)) throw new TypeError('Matrix hue must be a number');
|
|
182
191
|
if (!EYE[eyes]) throw new TypeError('Unknown eye style: ' + eyes);
|
|
183
192
|
Object.assign(this, {identity, tone: {hue, chroma, light, dots, edge}, shape, eyes, size, emphasized: !!emphasized, progress});
|
|
@@ -193,12 +202,12 @@ class Matrix {
|
|
|
193
202
|
this.aura = {orbit: 0, mark: 0, stars: 0, emph: 0}; this.markName = 'ask';
|
|
194
203
|
this.hover = false; this.press = false; this.dragging = false;
|
|
195
204
|
this.level = new Float32Array(25);
|
|
196
|
-
const ink = paint(this.tone), node = (layer, tag, attrs = {}) => ({layer, tag, attrs});
|
|
205
|
+
const ink = paint(this.tone), node = (layer, tag, attrs = {}, parent = null) => ({layer, tag, attrs, parent});
|
|
197
206
|
// Nodes in drawing order. `tile` nodes move with the tile; the rest are placed in the frame.
|
|
198
207
|
this.layout = [
|
|
199
208
|
node('back', 'circle', {cx: 50, cy: 50, fill: 'none', display: 'none'}),
|
|
200
|
-
|
|
201
|
-
...
|
|
209
|
+
...this.tileLayout(ink, node),
|
|
210
|
+
...this.faceLayout(ink, node),
|
|
202
211
|
...Array.from({length: 3}, () => node('front', 'circle', {display: 'none'})),
|
|
203
212
|
...Array.from({length: 3}, () => node('front', 'path', {d: GLYPHS.star, display: 'none'})),
|
|
204
213
|
node('front', 'circle', {r: 12.5, display: 'none'}),
|
|
@@ -320,7 +329,7 @@ class Matrix {
|
|
|
320
329
|
const pressed = this.press && !this.dragging;
|
|
321
330
|
this.forced = !!(this.override || this.dizzy > 0 || acted || pressed);
|
|
322
331
|
const expr = this.override?.name || (this.dizzy > 0 && 'dizzy') || acted || (pressed && 'squint') || (this.hover && want.expr === 'neutral' ? 'wide' : want.expr);
|
|
323
|
-
if (expr !== this.shown && p.open < 0.2) this.shown = expr;
|
|
332
|
+
if (expr !== this.shown && (this.morphs || p.open < 0.2)) this.shown = expr;
|
|
324
333
|
if ((this.blinkIn -= dt) < 0) { this.blinkFor = want.still ? 0 : 0.13; this.blinkIn = this.rng() < 0.2 ? 0.3 : 2 + this.rng() * 3.5; }
|
|
325
334
|
this.blinkFor = max(0, this.blinkFor - dt);
|
|
326
335
|
p.open = ease(p.open, expr !== this.shown || this.blinkFor > 0 ? 0 : 1, dt, 32);
|
|
@@ -356,17 +365,19 @@ class Matrix {
|
|
|
356
365
|
return this.render(null);
|
|
357
366
|
}
|
|
358
367
|
|
|
359
|
-
// ----
|
|
360
|
-
/**
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
// ---- the body and the face: a theme built on this one can draw others ----
|
|
369
|
+
/** Nodes for the body, drawn first on the tile layer. `node(layer, tag, attrs, parent)` may nest a node in an earlier one. */
|
|
370
|
+
tileLayout(ink, node) {
|
|
371
|
+
return [node('tile', 'path', {d: OUTLINES[this.shape](), fill: ink.body, stroke: ink.edge, 'stroke-width': 1.6})];
|
|
372
|
+
}
|
|
373
|
+
/** Fill the body nodes from `nodes[n]` on; returns the index after them. */
|
|
374
|
+
drawTile(nodes, n, {ink}) {
|
|
375
|
+
Object.assign(nodes[n++], {fill: ink.body, stroke: ink.edge});
|
|
376
|
+
return n;
|
|
377
|
+
}
|
|
378
|
+
/** The 5x5 screen this frame: a level 0..1 per cell, and which cells are blush. */
|
|
379
|
+
lit(yaw, pitch, facing) {
|
|
380
|
+
const p = this.p;
|
|
370
381
|
const on = new Float32Array(25), blush = new Uint8Array(25);
|
|
371
382
|
const light = (c, r, value) => { if (c >= 0 && c < 5 && r >= 0 && r < 5) on[r * 5 + c] = max(on[r * 5 + c], value); };
|
|
372
383
|
if (facing) {
|
|
@@ -385,18 +396,43 @@ class Matrix {
|
|
|
385
396
|
if (p.blush > 0.05) for (const c of [0, 4]) { const r = 3 + oy, i = r * 5 + c; if (r < 5 && on[i] === 0) { on[i] = 0.85 * p.blush; blush[i] = 1; } }
|
|
386
397
|
}
|
|
387
398
|
}
|
|
399
|
+
return {on, blush};
|
|
400
|
+
}
|
|
401
|
+
/** Nodes for the face, drawn on the tile in this order. */
|
|
402
|
+
faceLayout(ink, node) {
|
|
403
|
+
return Array.from({length: 25}, (_, i) => node('tile', 'circle', {cx: 50 + (i % 5 - 2) * CELL, cy: 50 + (floor(i / 5) - 2) * CELL, fill: ink.dark}));
|
|
404
|
+
}
|
|
405
|
+
/** Fill the face nodes from `nodes[n]` on; returns the index after them. */
|
|
406
|
+
drawFace(nodes, n, {dt, ink, dim, yaw, pitch, facing}) {
|
|
407
|
+
const {on, blush} = this.lit(yaw, pitch, facing);
|
|
408
|
+
// Unlit dots stay visible so it always reads as a screen; lit ones keep a gap between them.
|
|
409
|
+
for (let i = 0; i < 25; i++) {
|
|
410
|
+
this.level[i] = dt === null ? on[i] : ease(this.level[i], on[i], dt, 22);
|
|
411
|
+
Object.assign(nodes[n++], {r: fixed(max(0, 1.9 + 2.6 * this.level[i])), opacity: (0.22 + 0.78 * this.level[i] * dim).toFixed(3), fill: blush[i] ? 'oklch(0.74 0.17 15)' : ink.dark});
|
|
412
|
+
}
|
|
413
|
+
return n;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// ---- drawing ----
|
|
417
|
+
/** The current frame. dt null jumps the dots straight to their levels. */
|
|
418
|
+
render(dt) {
|
|
419
|
+
const p = this.p, g = this.g, ink = paint(this.tone, 0.7 + 0.3 * p.sat), dim = 0.45 + 0.55 * p.sat;
|
|
420
|
+
const yaw = wrap(p.yaw + g.yaw - REST.yaw), pitch = wrap(p.pitch + g.pitch - REST.pitch);
|
|
421
|
+
const fx = cos(turnOf(yaw)), fy = cos(turnOf(pitch)), facing = fx > 0.2 && fy > 0.2;
|
|
422
|
+
// Under a third of the solids' squash and half their lean: a screen is rigid. Slumped poses
|
|
423
|
+
// (blocked, pressed) read from the sinking, the closed eyes and the dimmed dots instead.
|
|
424
|
+
const sy = clamp(1 + (p.sy + g.sy - 1) * 0.3, 0.88, 1.2), sx = 1 + (1 - sy) * 0.3, scale = max(0.1, p.scale * (1 + g.scale)), lift = p.lift + g.lift, roll = (p.roll + g.roll) * 90 / Math.PI;
|
|
425
|
+
// Squash from the bottom edge, turn about the centre.
|
|
426
|
+
const transform = `translate(50 ${fixed(50 + lift)}) rotate(${fixed(roll)}) translate(0 ${TILE}) scale(${sx.toFixed(4)} ${sy.toFixed(4)}) translate(0 ${-TILE}) scale(${(scale * fx).toFixed(4)} ${(scale * fy).toFixed(4)}) translate(-50 -50)`;
|
|
388
427
|
const nodes = this.layout.map(() => ({}));
|
|
389
428
|
let n = 0;
|
|
390
429
|
// Halo on the active Bot.
|
|
391
430
|
const halo = nodes[n++], cy = 50 + lift;
|
|
392
431
|
if (this.aura.emph < 0.02) halo.display = 'none';
|
|
393
432
|
else Object.assign(halo, {display: 'inline', cy: r1(cy), r: r1(TILE * scale + 5 + 1.5 * sin(this.t * 3)), stroke: ink.accent, 'stroke-width': r1(3 * this.aura.emph)});
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
this.level[i] = dt === null ? on[i] : ease(this.level[i], on[i], dt, 22);
|
|
398
|
-
Object.assign(nodes[n++], {r: fixed(max(0, 1.9 + 2.6 * this.level[i])), opacity: (0.22 + 0.78 * this.level[i] * dim).toFixed(3), fill: blush[i] ? 'oklch(0.74 0.17 15)' : ink.dark});
|
|
399
|
-
}
|
|
433
|
+
const scene = {dt, ink, dim, yaw, pitch, facing, lift, cy, scale};
|
|
434
|
+
n = this.drawTile(nodes, n, scene);
|
|
435
|
+
n = this.drawFace(nodes, n, scene);
|
|
400
436
|
// Dots circling the tile; the far half is behind it.
|
|
401
437
|
for (let i = 0; i < 3; i++) {
|
|
402
438
|
const node = nodes[n++], a = this.phase + i * TAU / 3, z = sin(a);
|
package/themes/matrix/index.d.ts
CHANGED
|
@@ -24,7 +24,8 @@ export interface MatrixTone { hue: number; chroma?: number; light?: number; dots
|
|
|
24
24
|
export interface MatrixFrame { transform: string; nodes: Record<string, string | number>[]; }
|
|
25
25
|
export interface MatrixModel {
|
|
26
26
|
readonly state: StateName;
|
|
27
|
-
|
|
27
|
+
/** Nodes to build, in order. `parent` nests a node in an earlier entry (defs, clipPath, gradients); an attr named `text` is the text content. */
|
|
28
|
+
readonly layout: {layer: 'back' | 'tile' | 'front'; tag: string; attrs: Record<string, string | number>; parent?: object | null}[];
|
|
28
29
|
step(dt: number, input?: {look?: {x: number; y: number} | null; hover?: boolean; press?: boolean; dragging?: boolean}): MatrixFrame;
|
|
29
30
|
settle(): MatrixFrame;
|
|
30
31
|
render(dt: number | null): MatrixFrame;
|
package/themes/matrix/index.js
CHANGED
|
@@ -6,27 +6,19 @@
|
|
|
6
6
|
// bot.setState('thinking');
|
|
7
7
|
|
|
8
8
|
import {MatrixAvatar} from './avatar.js';
|
|
9
|
-
import {COLORS} from '
|
|
9
|
+
import {COLORS, EYE_STYLES} from '../../core/identity.js';
|
|
10
10
|
import {STATES} from '../../core/states.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {FACES} from './engine.js';
|
|
11
|
+
import {registerTheme} from '../../core/registry.js';
|
|
12
|
+
import {GESTURES} from '../../core/motion.js';
|
|
13
|
+
import {FACES, SHAPES} from './engine.js';
|
|
14
14
|
|
|
15
15
|
export {MatrixAvatar, identityFrom} from './avatar.js';
|
|
16
|
-
export {COLORS, BIRTH_COLORS, HUES} from '
|
|
16
|
+
export {COLORS, BIRTH_COLORS, HUES, EYE_STYLES} from '../../core/identity.js';
|
|
17
17
|
export {STATES, STATE_GROUPS, ALIASES, resolveState} from '../../core/states.js';
|
|
18
18
|
export {setAttention} from '../../core/core.js';
|
|
19
|
-
export {GESTURES} from '
|
|
20
|
-
export {
|
|
21
|
-
export {createMatrix, matrixShapes, matrixShapeForId, matrixEyes, paint, FACES, SCREENS} from './engine.js';
|
|
19
|
+
export {GESTURES} from '../../core/motion.js';
|
|
20
|
+
export {createMatrix, matrixShapes, matrixShapeForId, matrixEyes, paint, FACES, SCREENS, SHAPES, GROUPS} from './engine.js';
|
|
22
21
|
|
|
23
|
-
/** The tile outlines, in the same form as the solids' SHAPES. */
|
|
24
|
-
export const SHAPES = [
|
|
25
|
-
{name: 'squircle', zh: '圆角方', group: 'tile'},
|
|
26
|
-
{name: 'circle', zh: '圆', group: 'tile'},
|
|
27
|
-
{name: 'hex', zh: '六边形', group: 'tile'},
|
|
28
|
-
];
|
|
29
|
-
export const GROUPS = {tile: '屏幕外形'};
|
|
30
22
|
/** The expressions, by name; on this screen each one is a dot pattern (see FACES). */
|
|
31
23
|
export const EXPRESSIONS = FACES;
|
|
32
24
|
|
|
@@ -38,3 +30,5 @@ export const theme = {
|
|
|
38
30
|
name: 'matrix', zh: '点阵', create: createAvatar,
|
|
39
31
|
catalog: () => ({shapes: SHAPES, colors: Object.keys(COLORS), eyes: Object.keys(EYE_STYLES), states: Object.keys(STATES), gestures: Object.keys(GESTURES), expressions: Object.keys(FACES)}),
|
|
40
32
|
};
|
|
33
|
+
// Importing a theme makes it available to createAvatar({theme}) from the package entry.
|
|
34
|
+
registerTheme(theme);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 光晕 orb
|
|
2
|
+
|
|
3
|
+
方块里三团相邻色相的柔光在缓缓流动,前面是和立体家族一样的眼睛。状态决定光的情绪:工作时转得快,困了慢下来,生气和出错偏暖,难过和害怕偏冷,庆祝时色相散开。说话时有一张嘴,进度时外圈一道环慢慢填满。
|
|
4
|
+
|
|
5
|
+
来自 avatar-lab 的草图方向 AC+(光晕带眼睛),2026-11-28 做成主题。
|
|
6
|
+
|
|
7
|
+
## 用法
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import {createAvatar} from '@kodax-ai/botui/themes/orb'; // 或相对路径 ./themes/orb/index.js
|
|
11
|
+
|
|
12
|
+
const bot = createAvatar({identity: 'research-bot', size: 36});
|
|
13
|
+
sidebar.append(bot.el);
|
|
14
|
+
bot.setState('thinking');
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
从总入口用:先 `import '@kodax-ai/botui/themes/orb'`,再 `createAvatar({theme: 'orb', ...})`。自定义元素:同样先加载主题脚本,再写 `<bot-avatar theme="orb" identity="research-bot"></bot-avatar>`。
|
|
18
|
+
|
|
19
|
+
## 与点阵的关系
|
|
20
|
+
|
|
21
|
+
外形(圆角方、圆、六边形)、颜色、动作、记号、粒子、交互、水印都和 [点阵](../matrix/README.md) 一样,选项和方法也完全相同;同一个 Bot ID 在两个主题里是同一个外形、颜色和眼型。不同的是:
|
|
22
|
+
|
|
23
|
+
| 项 | 光晕 |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 方块 | 底色上三团径向渐变的光(本色、偏亮、偏深的两个邻近色相),沿各自的轨迹绕转,左上一点高光 |
|
|
26
|
+
| 眼睛 | 直接用立体家族的 `eyeShape`:21 种眼神、三种眼型都和立体家族同形 |
|
|
27
|
+
| 情绪(`MOODS`) | 每个状态一组:转速、色相散开程度、亮度、偏向的色相(生气 / 出错偏红,难过 / 害怕偏蓝,喜爱偏粉) |
|
|
28
|
+
| 嘴 | 只在说话的状态出现(输出、听写、哼歌、大笑、打招呼),一张一合 |
|
|
29
|
+
| 信号状态 | 屏幕不放图案,靠光的情绪、眼神和右上角记号表达;进度状态外圈有一道填充环 |
|
|
30
|
+
|
|
31
|
+
渐变和裁剪需要 SVG id,每个光晕实例用一个递增计数生成唯一 id,所以同一页面放多少个都不会串。除此之外模型是纯的:不碰 DOM、不用时钟和 `Math.random`。
|
|
32
|
+
|
|
33
|
+
## 纯模型
|
|
34
|
+
|
|
35
|
+
`createOrb(options)` 与 `createMatrix` 用法相同。节点里有 `defs`、`clipPath`、`radialGradient`、`stop` 和一个裁剪用的 `g`,这些节点带 `parent` 指向它所嵌套的节点。
|
|
36
|
+
|
|
37
|
+
## 文件
|
|
38
|
+
|
|
39
|
+
| 文件 | 内容 |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `index.js` | 入口:`createAvatar`、`theme` 和各种表 |
|
|
42
|
+
| `avatar.js` | `OrbAvatar`:继承点阵的 `MatrixAvatar`,只换模型 |
|
|
43
|
+
| `engine.js` | 光晕:情绪表 `MOODS`、流动的光、眼睛、嘴、进度环 |
|
|
44
|
+
| `playground.html` | 试玩页(共用 `../solids/playground.js`) |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {MatrixAvatar} from '../matrix/avatar.js';
|
|
2
|
+
import {createOrb} from './engine.js';
|
|
3
|
+
|
|
4
|
+
export {identityFrom} from '../matrix/avatar.js';
|
|
5
|
+
|
|
6
|
+
/** The aura avatar: the matrix avatar with drifting light inside and the solids' eyes. Options and methods as MatrixAvatar's. */
|
|
7
|
+
export class OrbAvatar extends MatrixAvatar {
|
|
8
|
+
static className = 'botui-orb';
|
|
9
|
+
createModel(options) { return createOrb(options); }
|
|
10
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// The aura theme's model: a glowing orb with the solids' eyes, on the matrix theme's tile.
|
|
2
|
+
//
|
|
3
|
+
// Inside the tile, three soft blobs of light in neighbouring hues drift around
|
|
4
|
+
// each other. The state sets their mood: they swirl fast while it works, slow
|
|
5
|
+
// down as it gets sleepy, run warm when it is angry, cool when it is sad, and
|
|
6
|
+
// spread apart when it celebrates. In front, two eyes drawn exactly like the
|
|
7
|
+
// solids' (every expression, every eye style), a mouth while it talks, and a
|
|
8
|
+
// ring that fills for progress.
|
|
9
|
+
//
|
|
10
|
+
// Everything else (outline, motion, marks, particles, halo, handling) is the
|
|
11
|
+
// matrix model's. Pure, like it: no DOM, no clock, no Math.random. The one
|
|
12
|
+
// exception is a counter in the gradient ids, so two orbs on a page never share one.
|
|
13
|
+
// Sketched in avatar-lab as direction AC+ (光晕带眼睛), made a theme on 2026-11-28.
|
|
14
|
+
|
|
15
|
+
import {Matrix} from '../matrix/engine.js';
|
|
16
|
+
import {eyeShape} from '../solids/face.js';
|
|
17
|
+
import {EYE_STYLES} from '../../core/identity.js';
|
|
18
|
+
import {TAU, ease, clamp} from '../../core/core.js';
|
|
19
|
+
|
|
20
|
+
const {sin, cos, abs, max, min} = Math;
|
|
21
|
+
const fixed = v => v.toFixed(2);
|
|
22
|
+
const E = 44, RING = 44, BLOBS = 3, HEART = 'oklch(0.6 0.22 15)', BLUSH = 'oklch(0.74 0.17 15)';
|
|
23
|
+
let made = 0;
|
|
24
|
+
|
|
25
|
+
/** The orb's eyes are the solids': dot (圆点), bar (竖条), tall (长条). */
|
|
26
|
+
export const orbEyes = Object.freeze(Object.keys(EYE_STYLES));
|
|
27
|
+
|
|
28
|
+
// How the light moves in each state: speed of the swirl, how far apart the hues are, a hue to lean toward, brightness.
|
|
29
|
+
const CALM = {speed: 0.6, spread: 40, glow: 1};
|
|
30
|
+
const BUSY = {speed: 2.2, spread: 50, glow: 1.1};
|
|
31
|
+
export const MOODS = {
|
|
32
|
+
idle: CALM, listening: {speed: 0.9, spread: 40, glow: 1.15},
|
|
33
|
+
thinking: BUSY, searching: BUSY, reading: BUSY, working: BUSY, coding: BUSY, running: BUSY, computing: BUSY, controlling: BUSY, loading: BUSY, orbit: BUSY, radar: BUSY, progress: BUSY,
|
|
34
|
+
streaming: {speed: 1.6, spread: 45, glow: 1.15}, writing: {speed: 1.4, spread: 45, glow: 1.05}, dictating: {speed: 1.4, spread: 45, glow: 1.1},
|
|
35
|
+
sending: {speed: 1.8, spread: 45, glow: 1.1}, receiving: {speed: 1.8, spread: 45, glow: 1.1}, uploading: {speed: 1.8, spread: 45, glow: 1.1},
|
|
36
|
+
excited: {speed: 2.6, spread: 90, glow: 1.25}, celebrating: {speed: 2.6, spread: 110, glow: 1.25}, laughing: {speed: 2.2, spread: 80, glow: 1.2}, happy: {speed: 1.2, spread: 70, glow: 1.15},
|
|
37
|
+
finished: {speed: 1, spread: 60, glow: 1.2}, approving: {speed: 1, spread: 60, glow: 1.15}, proud: {speed: 0.9, spread: 60, glow: 1.15},
|
|
38
|
+
angry: {speed: 2.4, spread: 25, glow: 1.1, lean: 25}, error: {speed: 1.2, spread: 20, glow: 0.9, lean: 25}, alerting: {speed: 2, spread: 25, glow: 1.2, lean: 45},
|
|
39
|
+
loving: {speed: 0.9, spread: 30, glow: 1.15, lean: 0}, shy: {speed: 0.7, spread: 30, glow: 1, lean: 10},
|
|
40
|
+
sad: {speed: 0.35, spread: 20, glow: 0.8, lean: 250}, scared: {speed: 2.4, spread: 20, glow: 0.85, lean: 260},
|
|
41
|
+
sleeping: {speed: 0.15, spread: 15, glow: 0.65}, drowsy: {speed: 0.3, spread: 20, glow: 0.8}, bored: {speed: 0.25, spread: 15, glow: 0.8},
|
|
42
|
+
blocked: {speed: 0.2, spread: 10, glow: 0.6}, 'powering-down': {speed: 0.1, spread: 5, glow: 0.45},
|
|
43
|
+
};
|
|
44
|
+
// States it talks in: the mouth opens and closes.
|
|
45
|
+
const TALK = {streaming: 9, dictating: 7, humming: 4, laughing: 11, greeting: 6};
|
|
46
|
+
|
|
47
|
+
class Orb extends Matrix {
|
|
48
|
+
tileLayout(ink, node) {
|
|
49
|
+
const id = `botui-orb-${++made}`, [outline] = super.tileLayout(ink, node);
|
|
50
|
+
this.ids = {clip: id + '-clip', blob: i => `${id}-b${i}`};
|
|
51
|
+
this.swirl = this.rng() * 10; this.mood = {...CALM, lean: null, mix: 0};
|
|
52
|
+
const defs = node('tile', 'defs'), clip = node('tile', 'clipPath', {id: this.ids.clip}, defs);
|
|
53
|
+
const shape = node('tile', 'path', {d: outline.attrs.d}, clip);
|
|
54
|
+
const grads = Array.from({length: BLOBS}, (_, i) => {
|
|
55
|
+
const grad = node('tile', 'radialGradient', {id: this.ids.blob(i)}, defs);
|
|
56
|
+
return [grad, node('tile', 'stop', {offset: '0'}, grad), node('tile', 'stop', {offset: '0.55'}, grad), node('tile', 'stop', {offset: '1', 'stop-opacity': 0}, grad)];
|
|
57
|
+
}).flat();
|
|
58
|
+
const inside = node('tile', 'g', {'clip-path': `url(#${this.ids.clip})`});
|
|
59
|
+
return [
|
|
60
|
+
defs, clip, shape, ...grads, outline, inside,
|
|
61
|
+
...Array.from({length: BLOBS}, (_, i) => node('tile', 'circle', {fill: `url(#${this.ids.blob(i)})`}, inside)),
|
|
62
|
+
node('tile', 'ellipse', {fill: '#fff', cx: 38, cy: 30, rx: 11, ry: 6, transform: 'rotate(-30 38 30)'}, inside),
|
|
63
|
+
node('tile', 'path', {fill: 'none', 'stroke-linecap': 'round', 'stroke-width': 3.2, d: ''}),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
drawTile(nodes, n, {dt, ink, dim}) {
|
|
67
|
+
const want = MOODS[this.state] || CALM, mood = this.mood, tone = this.tone;
|
|
68
|
+
// Ease from one mood to the next; the lean hue blends in and out.
|
|
69
|
+
if (dt === null) Object.assign(mood, want, {lean: want.lean ?? null, mix: want.lean == null ? 0 : 1});
|
|
70
|
+
else {
|
|
71
|
+
for (const key of ['speed', 'spread', 'glow']) mood[key] = ease(mood[key], want[key], dt, 3);
|
|
72
|
+
if (want.lean != null) mood.lean = want.lean;
|
|
73
|
+
mood.mix = ease(mood.mix, want.lean == null ? 0 : 1, dt, 3);
|
|
74
|
+
this.swirl += dt * mood.speed;
|
|
75
|
+
}
|
|
76
|
+
n += 3;
|
|
77
|
+
// The three lights: the Bot's hue and two neighbours, one lighter and one deeper.
|
|
78
|
+
const chroma = max(0.02, tone.chroma ?? 0.15) * (0.7 + 0.3 * this.p.sat), base = tone.light ?? 0.74;
|
|
79
|
+
const lean = mood.lean ?? tone.hue, toward = ((lean - tone.hue + 540) % 360) - 180;
|
|
80
|
+
const hues = [0, -mood.spread, mood.spread].map(d => (tone.hue + toward * mood.mix * 0.85 + d + 360) % 360);
|
|
81
|
+
const lights = [min(0.95, base + 0.13), clamp(base - 0.02, 0.3, 0.9), clamp(base - 0.12, 0.25, 0.85)].map(l => clamp(l * (0.82 + 0.18 * mood.glow), 0.2, 0.96));
|
|
82
|
+
for (let i = 0; i < BLOBS; i++) {
|
|
83
|
+
const colour = `oklch(${lights[i].toFixed(3)} ${(chroma * (i ? 1.25 : 0.9) + 0.02).toFixed(3)} ${hues[i].toFixed(1)})`;
|
|
84
|
+
nodes[n++]; Object.assign(nodes[n++], {'stop-color': colour, 'stop-opacity': fixed(min(1, 0.95 * mood.glow))});
|
|
85
|
+
Object.assign(nodes[n++], {'stop-color': colour, 'stop-opacity': fixed(min(1, 0.55 * mood.glow))}); Object.assign(nodes[n++], {'stop-color': colour});
|
|
86
|
+
}
|
|
87
|
+
Object.assign(nodes[n++], {fill: ink.body, stroke: ink.edge});
|
|
88
|
+
n++;
|
|
89
|
+
for (let i = 0; i < BLOBS; i++) {
|
|
90
|
+
const a = this.swirl * (1 + 0.3 * i) + i * TAU / BLOBS, r = 13 + 4 * sin(this.swirl * 0.7 + i * 2);
|
|
91
|
+
Object.assign(nodes[n++], {cx: fixed(50 + r * cos(a)), cy: fixed(50 + r * 0.85 * sin(a)), r: fixed(26 + 3 * sin(this.swirl * 1.3 + i))});
|
|
92
|
+
}
|
|
93
|
+
Object.assign(nodes[n++], {opacity: fixed(0.2 * dim)});
|
|
94
|
+
// The progress ring, from the top, clockwise.
|
|
95
|
+
const ring = nodes[n++], u = this.state === 'progress' ? clamp(this.progress ?? (this.t * 0.22) % 1, 0, 1) : 0;
|
|
96
|
+
if (u <= 0.001) Object.assign(ring, {d: '', opacity: 0});
|
|
97
|
+
else {
|
|
98
|
+
const a = -TAU / 4 + min(u, 0.9999) * TAU, big = u > 0.5 ? 1 : 0;
|
|
99
|
+
Object.assign(ring, {d: `M50,${50 - RING}A${RING},${RING} 0 ${big},1 ${fixed(50 + RING * cos(a))},${fixed(50 + RING * sin(a))}`, stroke: ink.accent, opacity: 1});
|
|
100
|
+
}
|
|
101
|
+
return n;
|
|
102
|
+
}
|
|
103
|
+
faceLayout(ink, node) {
|
|
104
|
+
return [
|
|
105
|
+
...[-1, 1].map(() => node('tile', 'ellipse', {rx: 5.5, ry: 3, fill: BLUSH, opacity: 0})),
|
|
106
|
+
...[-1, 1].map(() => node('tile', 'path', {'stroke-linecap': 'round', 'stroke-linejoin': 'round', fill: 'none', stroke: ink.dark})),
|
|
107
|
+
node('tile', 'ellipse', {fill: ink.dark, rx: 0, ry: 0}),
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
drawFace(nodes, n, {ink, dim, yaw, pitch, facing}) {
|
|
111
|
+
const p = this.p, style = EYE_STYLES[this.eyes] || EYE_STYLES.tall, k = this.size < 40 ? 1.15 : 1;
|
|
112
|
+
const ox = clamp((-sin(yaw) * 1.5 + this.gx * 5) * 7, -9, 9), oy = clamp((pitch * 1.6 + this.gy * 5) * 5, -6, 6), fade = 0.35 + 0.65 * dim;
|
|
113
|
+
for (const side of [-1, 1]) Object.assign(nodes[n++], {cx: fixed(50 + side * 25 + ox), cy: fixed(59 + oy), opacity: fixed(facing ? 0.8 * p.blush : 0)});
|
|
114
|
+
for (const side of [-1, 1]) {
|
|
115
|
+
const node = nodes[n++];
|
|
116
|
+
if (!facing) { Object.assign(node, {d: '', opacity: 0}); continue; }
|
|
117
|
+
const eye = eyeShape(this.shown, side, style, p.open), cx = 50 + side * style.gap * E * k + ox, cy = 47 + oy;
|
|
118
|
+
const d = eye.lines.map(line => line.map(([x, y], i) => (i ? 'L' : 'M') + fixed(cx + x * E * k) + ',' + fixed(cy + y * E * k)).join('') + (eye.fill ? 'Z' : '')).join('');
|
|
119
|
+
const colour = this.shown === 'love' ? HEART : ink.dark;
|
|
120
|
+
Object.assign(node, {d, 'stroke-width': fixed(eye.w * E * k), stroke: colour, fill: eye.fill ? colour : 'none', opacity: fixed(fade)});
|
|
121
|
+
}
|
|
122
|
+
// A mouth only while it talks.
|
|
123
|
+
const talk = !this.forced && facing ? TALK[this.state] : 0, open = talk ? abs(sin(this.t * talk)) * (0.6 + 0.4 * abs(sin(this.t * talk * 0.37))) : 0;
|
|
124
|
+
Object.assign(nodes[n++], {cx: fixed(50 + ox), cy: fixed(62 + oy), rx: fixed(talk ? 4.2 * k : 0), ry: fixed(talk ? 0.8 + 4 * open * k : 0), opacity: fixed(fade)});
|
|
125
|
+
return n;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** An orb model. Options as createMatrix's: identity, hue, chroma, light, dots, edge, shape, eyes, state, progress, size, emphasized. */
|
|
130
|
+
export const createOrb = options => new Orb(options);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Types for '@kodax-ai/botui/themes/orb'.
|
|
2
|
+
|
|
3
|
+
import type {ColorName, EyeStyle, ExpressionName, IdentityPool, Theme} from '../../index.js';
|
|
4
|
+
import type {MatrixAvatar, MatrixOptions, MatrixShape, MatrixModel, MatrixTone} from '../matrix/index.js';
|
|
5
|
+
|
|
6
|
+
export type {Avatar, AvatarOptions, ColorName, EyeStyle, ExpressionName, GestureName, IdentityPool, StateName, StateAlias, StateGroup, Theme} from '../../index.js';
|
|
7
|
+
export type {MatrixOptions as OrbOptions, MatrixShape as OrbShape} from '../matrix/index.js';
|
|
8
|
+
export {setAttention, resolveState, STATES, STATE_GROUPS, ALIASES, COLORS, BIRTH_COLORS, HUES, EYE_STYLES, GESTURES} from '../../index.js';
|
|
9
|
+
export {SHAPES, GROUPS} from '../matrix/index.js';
|
|
10
|
+
|
|
11
|
+
export interface OrbAvatar extends MatrixAvatar {}
|
|
12
|
+
export const OrbAvatar: {new (options?: MatrixOptions): OrbAvatar};
|
|
13
|
+
|
|
14
|
+
export const theme: Theme;
|
|
15
|
+
export function createAvatar(options?: MatrixOptions): OrbAvatar;
|
|
16
|
+
export function identityFrom(identity: string, pool?: IdentityPool): {shape: MatrixShape; color: ColorName; eyes: EyeStyle};
|
|
17
|
+
export const EXPRESSIONS: Record<ExpressionName, Function>;
|
|
18
|
+
|
|
19
|
+
// The pure model: the matrix model with light drifting inside and the solids' eyes.
|
|
20
|
+
export function createOrb(options: MatrixTone & {identity?: string; shape: MatrixShape; eyes?: EyeStyle; state?: string; progress?: number | null; size?: number; emphasized?: boolean}): MatrixModel;
|
|
21
|
+
export const orbShapes: readonly MatrixShape[];
|
|
22
|
+
export const orbEyes: readonly EyeStyle[];
|
|
23
|
+
export const FACES: Record<ExpressionName, Function>;
|
|
24
|
+
export const MOODS: Record<string, {speed: number; spread: number; glow: number; lean?: number}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// BotUI aura theme: a glowing orb with eyes.
|
|
2
|
+
//
|
|
3
|
+
// import {createAvatar} from './themes/orb/index.js';
|
|
4
|
+
// const bot = createAvatar({identity: 'research-bot', size: 36});
|
|
5
|
+
// sidebar.append(bot.el);
|
|
6
|
+
// bot.setState('thinking');
|
|
7
|
+
|
|
8
|
+
import {OrbAvatar} from './avatar.js';
|
|
9
|
+
import {COLORS, EYE_STYLES} from '../../core/identity.js';
|
|
10
|
+
import {STATES} from '../../core/states.js';
|
|
11
|
+
import {registerTheme} from '../../core/registry.js';
|
|
12
|
+
import {GESTURES} from '../../core/motion.js';
|
|
13
|
+
import {EXPRESSIONS as FACES} from '../solids/face.js';
|
|
14
|
+
import {SHAPES} from '../matrix/engine.js';
|
|
15
|
+
|
|
16
|
+
export {OrbAvatar, identityFrom} from './avatar.js';
|
|
17
|
+
export {COLORS, BIRTH_COLORS, HUES, EYE_STYLES} from '../../core/identity.js';
|
|
18
|
+
export {STATES, STATE_GROUPS, ALIASES, resolveState} from '../../core/states.js';
|
|
19
|
+
export {setAttention} from '../../core/core.js';
|
|
20
|
+
export {GESTURES} from '../../core/motion.js';
|
|
21
|
+
export {SHAPES, GROUPS, matrixShapes as orbShapes} from '../matrix/engine.js';
|
|
22
|
+
export {createOrb, orbEyes, MOODS} from './engine.js';
|
|
23
|
+
export {EXPRESSIONS as FACES} from '../solids/face.js';
|
|
24
|
+
/** The expressions, by name: the solids' eyes (see FACES). */
|
|
25
|
+
export const EXPRESSIONS = FACES;
|
|
26
|
+
|
|
27
|
+
/** Create an avatar. Options as MatrixAvatar's. Append `.el` to the page. */
|
|
28
|
+
export function createAvatar(options) { return new OrbAvatar(options); }
|
|
29
|
+
|
|
30
|
+
/** This theme, in the form core/registry.js expects. */
|
|
31
|
+
export const theme = {
|
|
32
|
+
name: 'orb', zh: '光晕', create: createAvatar,
|
|
33
|
+
catalog: () => ({shapes: SHAPES, colors: Object.keys(COLORS), eyes: Object.keys(EYE_STYLES), states: Object.keys(STATES), gestures: Object.keys(GESTURES), expressions: Object.keys(FACES)}),
|
|
34
|
+
};
|
|
35
|
+
// Importing a theme makes it available to createAvatar({theme}) from the package entry.
|
|
36
|
+
registerTheme(theme);
|
package/themes/solids/README.md
CHANGED
|
@@ -91,7 +91,7 @@ bot.setState('thinking');
|
|
|
91
91
|
| `avatar.js` | `SolidAvatar`:选项、交互、物理、渲染 |
|
|
92
92
|
| `geometry.js` | 36 个立体的网格 |
|
|
93
93
|
| `face.js` | 眼型和眼神 |
|
|
94
|
-
|
|
|
94
|
+
| `../../core/motion.js` | 每个状态的姿态、动作、空闲小动作(移到了 `core/`,所有主题共用这一份) |
|
|
95
95
|
| `symbols.js` | `signals: 'morph'` 时身体变成的符号 |
|
|
96
96
|
| `playground.html`、`playground.js` | 试玩页。`playground.js` 加载所在页面目录的 `index.js`,点阵主题共用它 |
|
|
97
97
|
| `sheet.html`、`filmstrip.html` | 全家福和连续帧,核对造型和动作用 |
|
package/themes/solids/avatar.js
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
import {TAU, ease, clamp, smooth, bump, hash, random, pointer, world, join, leave, joined, prefersDark} from '../../core/core.js';
|
|
8
8
|
import {STATES, resolveState} from '../../core/states.js';
|
|
9
9
|
import {solid, SHAPES} from './geometry.js';
|
|
10
|
-
import {
|
|
11
|
-
import {REST, POSES, GESTURES, FIDGETS} from '
|
|
10
|
+
import {EXPRESSIONS, eyeShape} from './face.js';
|
|
11
|
+
import {REST, POSES, GESTURES, FIDGETS} from '../../core/motion.js';
|
|
12
|
+
import {COLORS, HUES, EYE_STYLES, bornLook, pick, WATERMARK, WATERMARK_FROM, CREDIT} from '../../core/identity.js';
|
|
12
13
|
import {SYMBOLS} from './symbols.js';
|
|
13
14
|
|
|
14
15
|
const NS = 'http://www.w3.org/2000/svg';
|
|
@@ -17,21 +18,7 @@ const CY = 50, UNIT = 23, PERSPECTIVE = 0.07, GROUND = 90, RING = 42;
|
|
|
17
18
|
const STAR = 'M0,-1L.26,-.26L1,0L.26,.26L0,1L-.26,.26L-1,0L-.26,-.26Z';
|
|
18
19
|
const HEART = 'M0,1C-1.3,0 -1.1,-1 -.5,-1C-.2,-1 0,-.8 0,-.6C0,-.8 .2,-1 .5,-1C1.1,-1 1.3,0 0,1Z';
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
* Body colours. `chroma`, `base` and `span` default to a saturated mid tone; `eye`
|
|
22
|
-
* overrides the eye colour; `dark` holds what changes on a dark background
|
|
23
|
-
* (without it the colour is simply a little lighter there).
|
|
24
|
-
*/
|
|
25
|
-
export const COLORS = {
|
|
26
|
-
red: {hue: 25}, orange: {hue: 55}, amber: {hue: 85}, lime: {hue: 120}, green: {hue: 150}, teal: {hue: 175},
|
|
27
|
-
cyan: {hue: 200}, sky: {hue: 235}, blue: {hue: 265}, violet: {hue: 290}, magenta: {hue: 330}, pink: {hue: 0, chroma: 0.13, base: 0.68},
|
|
28
|
-
brown: {hue: 60, chroma: 0.06, base: 0.5, dark: {base: 0.58}}, gray: {hue: 260, chroma: 0.012, base: 0.58, dark: {base: 0.67}},
|
|
29
|
-
black: {hue: 260, chroma: 0.012, base: 0.3, span: 0.15, dark: {base: 0.45, span: 0.17, chroma: 0.02}},
|
|
30
|
-
white: {hue: 260, chroma: 0.006, base: 0.83, span: 0.13, eye: 'oklch(0.3 0.03 260)', dark: {}},
|
|
31
|
-
};
|
|
32
|
-
/** The colours a Bot ID can be born with: the twelve saturated ones. */
|
|
33
|
-
export const BIRTH_COLORS = Object.keys(COLORS).slice(0, 12);
|
|
34
|
-
export const HUES = BIRTH_COLORS.map(name => COLORS[name].hue);
|
|
21
|
+
export {COLORS, BIRTH_COLORS, HUES, WATERMARK, WATERMARK_FROM, CREDIT} from '../../core/identity.js';
|
|
35
22
|
|
|
36
23
|
// Glyphs shown beside the head. `d` is stroked, `dot` is a filled circle [x, y, r].
|
|
37
24
|
const MARKS = {
|
|
@@ -63,15 +50,10 @@ function el(name, attrs, parent) {
|
|
|
63
50
|
* limit the choice: {shapes, colors, eyes}, each a list of names.
|
|
64
51
|
*/
|
|
65
52
|
export function identityFrom(identity, pool) {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
return {shape: shapes[h % shapes.length], color: colors[(h >>> 8) % colors.length], eyes: eyes[(h >>> 16) % eyes.length]};
|
|
53
|
+
const shapes = pick(pool?.shapes, known, SHAPES.map(s => s.name));
|
|
54
|
+
return {shape: shapes[hash(identity) % shapes.length], ...bornLook(identity, pool)};
|
|
69
55
|
}
|
|
70
56
|
|
|
71
|
-
// Attribution carried by every avatar: invisibly in the SVG, and as a visible mark from WATERMARK_FROM pixels up.
|
|
72
|
-
export const WATERMARK = 'KodaX-AI', WATERMARK_FROM = 48;
|
|
73
|
-
export const CREDIT = 'BotUI. Copyright (c) 2026 Wei Zhang (icetomoyo) / KodaX-AI. KodaX-AI BotUI License 1.0. https://github.com/icetomoyo/BotUI';
|
|
74
|
-
|
|
75
57
|
export class SolidAvatar {
|
|
76
58
|
/**
|
|
77
59
|
* @param {object} options
|