feat: 角色视觉体系(头像按角色取)+ 时间注入(loop 每轮当前时间)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

【角色视觉体系(红线:每个角色自己的头像/背景,绝不串用昔涟)】
- persona.go:Persona 加 Visual{avatar, chatBackground{landscape,portrait}} + DefaultAvatar;每个角色各自配。
- cyrene.yaml:昔涟配 avatar(3F-Q-Happy-1) + chatBackground(横/竖屏)。
- PersonaStore 加 Persona(id);PersonaSummary 加 avatar/chatBackground;collectPersonas 按角色取
  Persona(id) 视觉(无视觉→空,前端回退默认占位,绝不串角色)。
- 前端:types PersonaRecord 加 avatar/chatBackground;persona.ts personaAvatar(p)=p?.avatar||默认占位
  (殊无昔涟 fallback);store 加 currentPersona;App 挂载 fetchPersonas 取默认角色;
  TopBar/chat 头像改 personaAvatar(currentPersona)(写死昔涟头像已清除)。

【时间注入(她自然知道现在几点,深夜催睡交给人格/capacity)】
- options.go Options 加 Timezone;loop.go Loop 加 timeLocation/timeZoneName + New 解析 + loadTimezone;
  time.go currentTimeBlock()(当前时间+周几+时区,每轮刷新);memory.go assembleContext 在「工作记忆」
  前注入时间 system(keyed 在 timeLocation!=nil,无时区不注入不破坏测试);wire.go Timezone=a.cfg.Timezone。

go build/vet/test 全绿(gateway/loop/persona);前端 tsc/vite build 75模块绿。红线无写死昔涟头像。
This commit is contained in:
Aska committed 2026-09-07 02:46:40 +08:00
1 parent 950bea9758
commit 7455d09d05
20 files changed
+177 -6

No files matched your search

+21
View File
@@ -53,6 +53,26 @@ type AffectionParams struct {
// Persona is a loaded persona definition. It describes who a character is (the
// identity, personality, speech style, catchphrase, background, values) and
// never restricts what that character can do.
// PersonaVisual carries the persona-owned visual assets (per-role icon/avatar
// and optional chat background). Each persona configures its OWN visuals; the UI
// renders the current persona's resources, so one role never inherits another's.
type PersonaVisual struct {
// Avatar is the persona's avatar image path (e.g. /images/Cyrene_Avatar/...).
Avatar string `yaml:"avatar,omitempty"`
// ChatBackground optionally sets the persona's chat backdrop, per orientation.
ChatBackground ChatBackground `yaml:"chatBackground,omitempty"`
}
// ChatBackground holds per-orientation chat wallpaper paths (landscape/portrait).
type ChatBackground struct {
Landscape string `yaml:"landscape,omitempty"`
Portrait string `yaml:"portrait,omitempty"`
}
// DefaultAvatar is the neutral fallback avatar shown when a persona has no
// avatar configured (so a role never silently borrows another persona's view).
const DefaultAvatar = "/images/User_Avatar/Default_Avatar.png"
type Persona struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
@@ -65,6 +85,7 @@ type Persona struct {
Values []string `yaml:"values"`
Emotion EmotionParams `yaml:"emotion"`
Affection AffectionParams `yaml:"affection"`
Visual PersonaVisual `yaml:"visual,omitempty"`
}
// EmotionConfig converts this persona's own fields into the params consumed by