feat(sagi): custom pets — Codex pet bundles, images, featured downloads

The mascot can wear a pet. Right-click it for Hide pet, Size (48-250
px), Choose pet (Sagi, featured, your own - deletable), Upload your
own..., Import .codex-pet bundle..., Find more on codex-pets.net and
Pet settings.... The worn pet and its size are viewer prefs
(agenthub.pet, agenthub.pet.size); the pets live on the server under
<data dir>/pets/<id>/ (server/lib/pets.js, /api/pets).

A Codex pet is the .codex-pet.zip format: pet.json + a 1536x1872
spritesheet.webp, 8x9 frames of 192x208, one row per state.
PetSprite.tsx plays the row of the mascot's mood; an uploaded image
bobs. Only the two bundle files are read, sizes are checked from the
zip directory before inflating, the sheet's WebP header must match,
uploads are raster only (no SVG), ids are made by the server, every
write is same-origin.

The four featured pets (Goku, Bac Ho, Border Collie, 11) are
codex-pets.net uploads with no redistribution licence, so none is
bundled: a pick downloads it from codex-pets.net by a fixed id.
This commit is contained in:
2026-10-03 16:25:42 +07:00
parent 8098f446b6
commit ed1bf20e6b
18 changed files with 1615 additions and 55 deletions
+15 -1
View File
@@ -8,7 +8,21 @@
"title": "Sagi companion",
"description": "A floating mascot that reacts to your live sessions.",
"enable": "Show Sagi",
"enableDesc": "Display the corner companion across the dashboard (⌘B to open)"
"enableDesc": "Display the corner companion across the dashboard (⌘B to open)",
"pet": {
"title": "Pet",
"hide": "Hide pet",
"size": "Size",
"choose": "Choose pet",
"featuredBy": "By {{by}} on codex-pets.net — downloaded into this install on first pick",
"download": "Download",
"delete": "Delete {{name}}",
"upload": "Upload your own…",
"import": "Import .codex-pet bundle…",
"browse": "Find more on codex-pets.net",
"settings": "Pet settings…"
},
"petHint": "Right-click the mascot to choose its pet — Sagi, a featured or imported Codex pet, or your own image — and its size."
},
"pricing": {
"vendor": {
+15 -1
View File
@@ -8,7 +8,21 @@
"title": "Bạn đồng hành Sagi",
"description": "Linh vật nổi phản ứng với các phiên trực tiếp của bạn.",
"enable": "Hiện Sagi",
"enableDesc": "Hiển thị bạn đồng hành ở góc trên toàn bảng điều khiển (⌘B để mở)"
"enableDesc": "Hiển thị bạn đồng hành ở góc trên toàn bảng điều khiển (⌘B để mở)",
"pet": {
"title": "Pet",
"hide": "Ẩn pet",
"size": "Kích thước",
"choose": "Chọn pet",
"featuredBy": "Của {{by}} trên codex-pets.net — tải về máy này ở lần chọn đầu",
"download": "Tải về",
"delete": "Xoá {{name}}",
"upload": "Tải ảnh của bạn lên…",
"import": "Nhập bundle .codex-pet…",
"browse": "Tìm thêm trên codex-pets.net",
"settings": "Cài đặt pet…"
},
"petHint": "Nhấp chuột phải vào mascot để chọn pet — Sagi, pet Codex có sẵn hoặc tự nhập, hay ảnh của bạn — và kích thước."
},
"pricing": {
"vendor": {