Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ Notable changes to DeepSeekBot are recorded here. See the

## [Unreleased]

Pixel Avatars can be an elf, dwarf, orc or talking flower with beards, medieval outfits and headwear, and new PersonaBots start from a face seeded across every species.
Pixel Avatars can be an elf, dwarf, orc or talking flower with beards, medieval outfits and headwear, you can draw your own headpiece into a Part Library, and new PersonaBots start from a face seeded across every species.

### Breaking Changes

- The Part Library adds Profile schema Generation 73. Back up before upgrading; reopening an upgraded Profile requires a compatible binary or restoration of the pre-upgrade backup ([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211)).

### Added

- You can draw your own headpiece for a pixel Avatar: pencil, eraser, fill, mirroring across the face, a front layer over the hair and a back layer behind it, undo and redo, and a 1× preview on the real Avatar. Colors can follow the Avatar's hair, skin, eye or outfit color in five tones, or be fixed. Saved parts go into a Part Library in your Profile and can be worn by any PersonaBot. The worn copy turns and speaks with the Window Companion and travels with an exported Bot, and editing a library part saves a new part without changing Avatars that already wear the old one ([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211)).
- Pixel Avatars can be an elf, dwarf, orc or talking flower. Beards always leave the speaking mouth visible. Armor, robe, tunic and cloak outfits are available, and a helmet or hood hides the hair underneath. Flowers have bead eyes, five petal styles and a stem or pot. Choices a species or headwear doesn't show stay saved, with a note, and return when switched back ([#1212](https://github.com/BotHarness/DeepSeekBot/issues/1212), [#1213](https://github.com/BotHarness/DeepSeekBot/issues/1213)).
- A new PersonaBot starts with a random face from every species, part and outfit, based on its name. Existing PersonaBots keep their current face ([#1214](https://github.com/BotHarness/DeepSeekBot/issues/1214)).

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@

## [Unreleased]

像素头像新增精灵、矮人、兽人和会说话的花,以及胡子、中世纪服装和头饰;新建的 PersonaBot 会从全部物种中随机生成初始形象。
像素头像新增精灵、矮人、兽人和会说话的花,以及胡子、中世纪服装和头饰;可以自己画头饰并存入部件库;新建的 PersonaBot 会从全部物种中随机生成初始形象。

### Breaking Changes

- 部件库新增 Profile schema Generation 73。升级前请备份;升级后的 Profile 需要兼容的程序版本才能重新打开,否则请恢复升级前的备份([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211))。

### Added

- 可以为像素头像自己画头饰:铅笔、橡皮、填充、沿脸部中线镜像,前层盖在头发上、后层在头发后面,支持撤销重做,并在真实头像上显示 1× 预览。颜色可以跟随头像的发色、肤色、眼睛或衣服颜色(五档明暗),也可以是固定色。保存的部件进入 Profile 里的部件库,任何 PersonaBot 都能戴上;戴上的副本会在窗口伙伴里随头部转动和说话,并随导出的 Bot 一起带走;修改库里的部件会另存为新部件,不会改变已经戴着旧部件的头像([#1211](https://github.com/BotHarness/DeepSeekBot/issues/1211))。
- 像素头像新增精灵、矮人、兽人和会说话的花。胡子始终露出说话的嘴,新增盔甲、法袍、束腰外衣和斗篷,戴上头盔或兜帽会遮住下面的头发。花有豆豆眼、五种花瓣样式,以及茎叶或花盆。当前物种或头饰不显示的选择会保留并给出提示,换回后恢复([#1212](https://github.com/BotHarness/DeepSeekBot/issues/1212)、[#1213](https://github.com/BotHarness/DeepSeekBot/issues/1213))。
- 新建的 PersonaBot 会按名字从全部物种、部件和服装中随机生成初始形象,已有的 PersonaBot 保持原来的样子([#1214](https://github.com/BotHarness/DeepSeekBot/issues/1214))。

Expand Down
4 changes: 3 additions & 1 deletion docs/architecture/botharness-architecture.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,16 @@ First selection and Client/Host restart establish a Host-consistent future-messa

Each Bot has one updating Activity card and parallel typewriter message cards, with defaults of 3 collapsed layers and at most 20 unexpired retained cards, adjustable through shared settings. Hover/focus expands a stable list, pauses roaming/expiry, continues visible typing and counts new arrivals until leaving; previews, scrolling and basic bubble avoidance preserve reading. No automatic +N fold or companion selection cap is imposed; Humans drag, pause walking or remove companions. Archive retains a static marked companion; deletion removes selection. Existing motion, freshness, static-image and missing-version fallback contracts apply. First validate one real Host→Client pixel companion Activity/DM interaction/recovery slice with Human feedback, then extend multiple Bots, groups and all visibility modes. A compatible text-paced closed/half-open/open BotPixel mouth follows separately. Independent desktop windows, fork distribution and full-body animation stay outside this target.

### 5.4 · Avatar Species and Custom Parts (accepted design, not yet implemented)
### 5.4 · Avatar Species and Custom Parts (partly implemented)

[ADR-0148](../adr/0148-avatar-species-and-custom-parts-extend-one-pixel-rig.md) extends the pixel Avatar Family without a new rig. An Avatar Species (human, elf, goblin, dwarf, orc, cat, dog, fox, rabbit, bear, flower) is a base on the pixel bust skeleton: silhouette, ears, nose or muzzle, suggested body colors and accepted parts; motion, anchors, the speech mouth and the transparent companion silhouette stay shared. Hair splits into separately colored pieces and a through-hair headpiece slot adds front and back layers. Choices a species cannot show stay saved and hidden instead of being replaced.

Custom Parts are bounded pixel grids whose cells reference appearance colors or fixed colors with a tone step, so they recolor with the Appearance. BotPixel owns their type, validation, rendering and pure drawing algorithms; the PersonaBot owning module stores an embedded copy in the Avatar Appearance, and a Host-owned Part Library in the DSH Profile holds reusable parts by content-hash identity and origin. Exported PersonaBots carry their parts; single parts move as PNGs with embedded data. Eyes, brows and mouth are not drawable, so blink and speech frames stay rig-owned.

New PersonaBots record a full-domain name-seed version; PersonaBots without it keep the human-only seed. Recipes using species, new slots or Custom Parts raise the asset/schema version and fall back to the saved snapshot on older Clients; existing recipes render unchanged. The first slice proves goblin, split side hair and one drawn headpiece from editor to Part Library to a Window Companion and through export/import.

Implemented so far: goblin, elf, dwarf, orc and flower species, split side hair, beards, medieval outfits and headwear, the full-domain seed (#1210, #1212–#1214), and the first Custom Part path (#1211). A drawn headpiece is an asset version 3 recipe. The Part Library is the `avatar-part-library` module's `avatar_part_library` table (schema generation 73), keyed by the part's content hash and holding name, origins and parent. The `partLibraryList` and `partLibraryAdd` bridge methods expose it to the Client editor (pencil, eraser, 4-connected fill, centerline mirror, front and back layers, undo and redo, and a 1× preview). The appearance embeds a copy of the part, so it travels in `.botharness/bot.json` and Bot Zips. Animal species, imported parts, PNG part files and further drawing tools are still to come.
Comment thread
DoodleBears marked this conversation as resolved.
Resolved

## 6 · Persistence, export, and restore boundaries

```mermaid
Expand Down
4 changes: 3 additions & 1 deletion docs/architecture/botharness-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,16 @@ Tool detail Capability 默认拒绝所有 Consumer。部署 Human 在 `botharnes

每 Bot 一张当前活动卡加独立并行逐字消息卡,默认折叠 3 层、最多保留 20 张未到期卡;全局设置可调整。hover/focus 展开稳定列表,暂停漫游与到期,已显示文字继续播放,新增内容只计数、退出后有界合并;长文预览、列表滚动,基本气泡避让。无自动 +N 折叠或钉选数量上限,Human 通过拖动、暂停漫游、移除调整。归档保留静态伙伴与标记、删除清选择;reduced motion、freshness、上传图片静态 media 和版本快照降级沿既有 Avatar 合同。先完成真实 Host→Client 的一个像素伙伴 Activity/DM 与操作/恢复切片,Human 验证后扩展多个 Bot、群聊与三档范围;闭合/半开/张开文字节奏嘴型作为随后 BotPixel 兼容扩展。独立桌面窗口、fork 分发与全身动作不属于此目标。

### 5.4 · 形象物种与自绘部件(已接受设计,待实现)
### 5.4 · 形象物种与自绘部件(部分已实现)

[ADR-0148](../adr/0148-avatar-species-and-custom-parts-extend-one-pixel-rig.md) 在不新增 rig 的前提下扩展像素 Avatar Family。Avatar Species(人类、精灵、哥布林、矮人、兽人、猫、狗、狐狸、兔子、熊、花)是像素胸像骨架上的基底:轮廓、耳朵、鼻子或吻部、建议身体色与可接受部件;动作、锚点、说话嘴型与伙伴透明轮廓保持共享。头发拆为可分别上色的分片,新增穿过头发的头饰槽(前后两层)。当前物种无法显示的选择保存并隐藏,不被替换。

Custom Part 是有界像素网格,每格引用外形颜色或固定色并带明度档位,因此随外形换色。BotPixel 负责其类型、校验、渲染与纯函数绘制算法;PersonaBot 所属模块把副本嵌入 Avatar Appearance,DSH Profile 中由 Host 管理的 Part Library 以内容哈希身份和来源保存可复用部件。导出的 PersonaBot 携带其部件;单个部件以内嵌数据的 PNG 流转。眼睛、眉毛和嘴不可自绘,眨眼与说话帧仍由 rig 负责。

新 PersonaBot 记录全域名字种子版本;没有该记录的 PersonaBot 保持仅人类的种子。使用物种、新槽位或 Custom Part 的 recipe 提升 asset/schema 版本,旧 Client 显示保存的快照;既有 recipe 渲染不变。首个切片验证哥布林、左右侧发分片与一个自绘头饰,从编辑器到 Part Library、再到 Window Companion,并经过导出/导入。

目前已实现:哥布林、精灵、矮人、兽人和花物种,左右侧发分片,胡子,中世纪服装与头饰,全域种子(#1210、#1212–#1214),以及第一条 Custom Part 路径(#1211)。自绘头饰的 recipe 是 asset version 3。Part Library 是 `avatar-part-library` 模块的 `avatar_part_library` 表(schema generation 73),以部件内容哈希为键,并保存名称、来源和父部件。Client 编辑器通过 `partLibraryList` 和 `partLibraryAdd` 两个桥接方法使用它;编辑器提供铅笔、橡皮、四连通填充、中线镜像、前后两层、撤销重做和 1× 预览。外形嵌入部件副本,因此部件会随 `.botharness/bot.json` 和 Bot Zip 一起带走。动物物种、导入部件、PNG 部件文件和更多绘制工具尚未实现。

## 6 · 持久化、导出与恢复边界

```mermaid
Expand Down
4 changes: 4 additions & 0 deletions docs/architecture/diagrams/02-modules.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ flowchart TB

subgraph Modules["BotHarness deep modules"]
Bots["PersonaBot<br/>identity · lifecycle · Session ownership"]
PartLibrary["Avatar Part Library<br/>content-hash parts · origins · parent"]
Memory["Optional Memory Service<br/>repositories · Git commits · events"]
Msg["Messaging<br/>events · channels · inbox · triggers<br/>grants · outbox"]
Assignments["Assignments<br/>directory · capacity · requests · reports"]
Expand All @@ -13,19 +14,22 @@ flowchart TB

Root --> DB
Root --> Bots
Root --> PartLibrary
Root -. optional Provider .-> Memory
Root --> Msg
Root --> Assignments
Root --> Portable
Root --> Views
DB --> Bots
DB --> PartLibrary
DB --> Msg
DB --> Assignments
DB --> Portable
Bots -. attachment .-> Memory
Bots --> Assignments
Msg --> Assignments
Bots --> Views
PartLibrary --> Views
Msg --> Views
Assignments -. scoped Consumer .-> Memory
Memory --> Views
Expand Down
4 changes: 4 additions & 0 deletions docs/architecture/diagrams/en/02-modules.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ flowchart TB

subgraph Modules["BotHarness deep modules"]
Bots["PersonaBot<br/>identity · lifecycle · Session ownership"]
PartLibrary["Avatar Part Library<br/>content-hash parts · origins · parent"]
Memory["Optional Memory Service<br/>repositories · Git commits · events"]
Msg["Messaging<br/>events · channels · inbox · triggers<br/>grants · outbox"]
Assignments["Assignments<br/>directory · capacity · requests · reports"]
Expand All @@ -13,19 +14,22 @@ flowchart TB

Root --> DB
Root --> Bots
Root --> PartLibrary
Root -. optional Provider .-> Memory
Root --> Msg
Root --> Assignments
Root --> Portable
Root --> Views
DB --> Bots
DB --> PartLibrary
DB --> Msg
DB --> Assignments
DB --> Portable
Bots -. attachment .-> Memory
Bots --> Assignments
Msg --> Assignments
Bots --> Views
PartLibrary --> Views
Msg --> Views
Assignments -. scoped Consumer .-> Memory
Memory --> Views
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/diagrams/rendered/02-modules.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/architecture/diagrams/rendered/02-modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/architecture/diagrams/rendered/en/02-modules.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/architecture/diagrams/rendered/en/02-modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions docs/assets/pr/1211-custom-parts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# #1211 Custom Parts 1: draw a headpiece into the Part Library and wear it

Captured on an isolated DSH instance built from this branch, with `@botharness/pixel-avatar` 0.5.0 (BotHarness/BotPixel#11) built in.

## Drawing

| Front layer: a mirrored gold crown with a gem, drawn with pencil, tones and mirror | Back layer: hair-colored side pieces behind the hair, seen through the dimmed Avatar |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| ![front layer](part-front-en-light.webp) | ![back layer](part-back-en-light.webp) |

## Library and color

| Saved to the Part Library and worn | Changing the hair color recolors the hair-colored back pieces |
| ---------------------------------- | ------------------------------------------------------------- |
| ![saved](part-saved-en-light.webp) | ![recolor](part-recolor-en-light.webp) |

## Window Companion

The speech is simulated. A test script drives the companion's own closed, half-open and open mouth layers; no model reply was involved.

| Speaking companion wearing the drawn part | Close-up (×4, cropped from the screenshot) |
| ----------------------------------------- | -------------------------------------------- |
| ![speaking](part-speaking-en-light.webp) | ![close-up](companion-closeup-en-light.webp) |

## Full flow

![full flow](custom-part-flow.gif)

The same recording as video: [custom-part-flow.mp4](custom-part-flow.mp4)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions packages/client/src/client/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ import {
setBotBanner as setBotBannerViaBridge,
updateBotProfile as updateBotProfileViaBridge,
setBotAppearance as setBotAppearanceViaBridge,
loadPartLibrary as loadPartLibraryViaBridge,
addLibraryPart as addLibraryPartViaBridge,
cancelGroupInvitation,
decideGroupJoin,
removeGroupMember,
Expand Down Expand Up @@ -582,6 +584,14 @@ export interface BridgeActions {
channelId: string,
recipe: import('../../../core/src/bots/avatar-appearance.js').AvatarRecipe,
): Promise<boolean>;
loadPartLibrary(): Promise<
import('../../../core/src/bots/part-library.js').PartLibraryEntry[] | undefined
>;
addLibraryPart(
part: import('../../../core/src/bots/avatar-appearance.js').PixelCustomPart,
name: string,
parent?: string,
): Promise<import('../../../core/src/bots/part-library.js').PartLibraryEntry | undefined>;
inviteGroupBot(channelId: string, botSlug: string): Promise<boolean>;
cancelGroupInvitation(channelId: string, invitationId: string): Promise<boolean>;
decideGroupJoin(channelId: string, requestId: string, accept: boolean): Promise<boolean>;
Expand Down Expand Up @@ -2255,6 +2265,20 @@ export function createActions(
return false;
}
},
async loadPartLibrary() {
try {
return await loadPartLibraryViaBridge(call);
} catch {
return undefined;
}
},
async addLibraryPart(part, name, parent) {
try {
return await addLibraryPartViaBridge(call, part, name, parent);
} catch {
return undefined;
}
},
async updateBotProfile(slug, patch) {
try {
const bot = await updateBotProfileViaBridge(call, slug, patch);
Expand Down
Loading
Loading