[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107662":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":37,"discoverSource":38},107662,"open-bot-avatar","DominikScholz\u002Fopen-bot-avatar","DominikScholz","A JSON spec and renderer for interactive agent avatars","https:\u002F\u002Fdominikscholz.github.io\u002Fopen-bot-avatar\u002F",null,"TypeScript",819,71,2,1,0,13,154,673,157,99.57,"MIT License",false,"main",true,[27,28,29,30,31,32],"agents","animation","avatar","bot","json","svg","2026-11-23 16:36:10","2026-11-23 19:49:46","\u003Cp>\u003Cimg src=\"assets\u002Fbanner.png\" width=\"100%\" alt=\"Open Bot Avatar: colorful object avatars with eyes, such as a ghost, a controller, a sprout, a cat and a mug\">\u003C\u002Fp>\n\nA JSON spec and renderer for interactive agent avatars.\n\n- Spec: one SVG path and where the eyes sit ([contract](docs\u002Favatar-contract.md)).\n- Renderer: the `open-bot-avatar` package, no dependencies.\n- [Editor](https:\u002F\u002Fdominikscholz.github.io\u002Fopen-bot-avatar\u002F): pick, color, generate and import avatars.\n\nOpen source, MIT licensed. [Docs](https:\u002F\u002Fdominikscholz.github.io\u002Fopen-bot-avatar\u002F#\u002Fdocs).\n\n## Make an avatar\n\nIn the [editor](https:\u002F\u002Fdominikscholz.github.io\u002Fopen-bot-avatar\u002F), describe it under Generate, send the prompt to any chat model or agent, and paste the JSON it returns into Import. The prompt is [system-prompt.md](skills\u002Fgenerate-avatar\u002Freferences\u002Fsystem-prompt.md); agents with skills can use the [generate-avatar skill](skills\u002Fgenerate-avatar\u002FSKILL.md).\n\nTo add one to the gallery, open a pull request with its JSON in [`gallery\u002F`](gallery).\n\n## Definition\n\nOne SVG path in a `0 0 100 100` box, and the eyes.\n\n```json\n{\n  \"version\": 1,\n  \"id\": \"box\",\n  \"name\": \"Box\",\n  \"body\": { \"path\": \"M20 20 H80 V80 H20 Z\" },\n  \"eyes\": { \"x\": 50, \"y\": 46, \"spacing\": 15, \"scale\": 1 }\n}\n```\n\n`x`, `y`: the eyes' center; `spacing`: the distance between them; `scale`: their size. Check definitions you didn't write with `validateAvatar`, which returns `{ ok: true, value }` or `{ ok: false, errors }`. The rules are in the [contract](docs\u002Favatar-contract.md).\n\n## How it renders\n\nThe volume is inferred from the outline as stacked cross-sections. Live avatars project them and paint each frame to one canvas; stills are projected into one SVG. A CSS 3D scene with one SVG per cross-section is available as `renderer: \"scene\"`.\n\n## Install\n\n```sh\npnpm add open-bot-avatar\n```\n\n## Mount an avatar\n\n`mountAvatar` fills a square element.\n\n```ts\nimport { getExample } from \"open-bot-avatar\";\nimport { mountAvatar } from \"open-bot-avatar\u002Fdom\";\n\nconst avatar = mountAvatar(document.querySelector(\"#bot\")!, {\n  definition: getExample(\"mug\")!,\n  color: \"#ff6a1a\",\n  followPointer: true,\n});\n\navatar.update({ mood: \"happy\" }); \u002F\u002F any subset of the options\navatar.destroy();\n```\n\n| Option | |\n| --- | --- |\n| `definition` | The avatar. Required. |\n| `color`, `eyeColor` | `#rgb` or `#rrggbb`. Default: `#ff6a1a`, `#151515`. |\n| `mood` | `\"idle\"` (default), `\"thinking\"` or `\"happy\"`. |\n| `followPointer` | Look at the mouse or finger. Default: `false`. |\n| `lookAt` | A fixed look direction, `{ x, y }` from -1 to 1. Wins over the pointer. |\n| `holdGaze` | Keep looking where it looks now. Default: `false`. |\n| `view` | Extra rotation, `{ yaw, pitch }` in radians. |\n| `depth` | Volume, 0 (flat) to 14. Default: 6. |\n| `reducedMotion` | `true`, `false` or `\"system\"` (default). |\n| `still` | One static SVG, no animation. Default: `false`. |\n| `label` | Accessible name. Default: the definition's name; `\"\"` for decorative. |\n\n## SVG\n\n`renderAvatarSvg` returns an SVG string; `avatarFrame` returns the same frame as data, for drawing it yourself. Neither needs a DOM.\n\n```ts\nimport { avatarFrame, renderAvatarSvg, validateAvatar } from \"open-bot-avatar\";\n\nconst result = validateAvatar(JSON.parse(json));\nif (result.ok) {\n  const svg = renderAvatarSvg(result.value, { color: \"#1fbf68\", size: 256 });\n  const frame = avatarFrame(result.value, { color: \"#1fbf68\" });\n}\n```\n\nBoth also take `time` (seconds), `motion` (the mood) and `gaze`.\n\n## React\n\nThere's no React package; copy this component. Other frameworks work the same way.\n\n```tsx\nimport { useEffect, useRef } from \"react\";\nimport { mountAvatar, type AvatarOptions, type MountedAvatar } from \"open-bot-avatar\u002Fdom\";\n\nexport function BotAvatar({ size = 96, ...options }: AvatarOptions & { size?: number }) {\n  const host = useRef\u003CHTMLDivElement>(null);\n  const avatar = useRef\u003CMountedAvatar | null>(null);\n  useEffect(() => {\n    avatar.current = mountAvatar(host.current!, options);\n    return () => avatar.current?.destroy();\n  }, []);\n  useEffect(() => avatar.current?.update(options));\n  return \u003Cdiv ref={host} style={{ width: size, aspectRatio: \"1\" }} \u002F>;\n}\n```\n\n## Repository layout\n\n```text\npackages\u002Fcore\u002F   npm package: engine and browser mount\napps\u002Fsite\u002F       editor and documentation (Vite + React)\ngallery\u002F         community avatar definitions\nskills\u002F          design prompt and generation skill\ndocs\u002F            definition contract\n```\n\n## Development\n\n```sh\npnpm install\npnpm dev          # the site, with the package from source\npnpm test         # Vitest: engine, DOM mount, editor and gallery checks\npnpm typecheck\npnpm build        # the package to dist\u002F, the site to apps\u002Fsite\u002Fdist\u002F\npnpm check        # typecheck, tests and build, in sequence\nnode packages\u002Fcore\u002Fscripts\u002Favatar-validate.ts --strict my-avatar.json --svg my-avatar.svg\n```\n\nNeeds Node 22.18+ and pnpm.\n\n## License\n\n[MIT](LICENSE)\n","Open Bot Avatar 是一个开源的交互式代理头像规范与渲染库，定义了基于 SVG 路径和眼部位姿的轻量级 JSON 头像格式，并提供零依赖的 TypeScript 渲染器。核心功能包括：支持 3D 感观投影（通过分层截面推断体积）、鼠标跟随凝视、情绪状态切换（idle\u002Fthinking\u002Fhappy）、动态着色及无障碍标签；渲染输出可为实时 Canvas 动画或静态 SVG。适用于需要可编程、可定制、低开销视觉反馈的 AI 代理界面，如聊天机器人、教育助手、开发者工具中的智能体可视化等轻量前端集成场景。","2026-11-24 04:32:34","CREATED_QUERY"]