Skip to content

Commit af63a20

Browse files
committed
refactor!: 移除角色的开场白(tagline)字段 / remove tagline field from personas
- 从数据模型、存储读写、preload 与 mock 类型中删除 tagline / remove tagline from data model, storage, preload and mock types - 角色资料卡不再显示开场白引言,移除对应样式 / remove tagline quote from profile card and its styles - 角色搜索不再匹配开场白,仅按名称与简介过滤 / persona search no longer matches tagline, only filters by name and description - 同步移除 i18n 词条与英文文档中的示例 / remove i18n entries and example from English docs
1 parent 3d9559b commit af63a20

11 files changed

Lines changed: 5 additions & 51 deletions

File tree

‎README.en.md‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,6 @@ The system rules never prescribe identity or style, and personas never touch too
112112
- **One persona per conversation**, chosen when the conversation is created. Unbound conversations, or those whose persona was deleted, fall back to the default persona Deva.
113113
- **Personas do not restrict built-in tools**; every persona can use all of them. Skills and MCP servers can be limited to specific personas to give a persona its own capabilities; without a limit they are available to all.
114114
- **Subagents do not receive the persona**, so persona style does not leak into search and research results.
115-
- Personas are stored as Markdown files that can be edited directly or kept under version control:
116-
117-
```markdown
118-
---
119-
name: Code Reviewer
120-
description: Reviews changes for correctness, maintainability and security risks
121-
tagline: Send me the changes to review
122-
model: deepseek:deepseek-chat
123-
---
124-
You are a senior code reviewer. List issues by severity, each with location, reason and a suggested fix...
125-
```
126115

127116
Built-in personas:
128117

‎apps/desktop/src/main/services/default-personas.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import XIAOMAJIANG from "./xiaomajiang-personas"
44
/**
55
* 默认角色(首启种子 persona)定义——**各角色及其提示词集中在此、彼此独立**。
66
*
7-
* 每条默认角色是一个自包含的 `DefaultPersona` 常量(含身份、主题色、开场白、提示词等),
7+
* 每条默认角色是一个自包含的 `DefaultPersona` 常量(含身份、主题色、提示词等),
88
* 由 `DEFAULT_PERSONAS` 数组收拢;`personas.ts` 的 `ensureSeededPersonas()` 首启时逐条种入
99
* `~/.deva/personas/<id>.md`(按 id 幂等、防「删除后复活」、支持将来只补种新增的那条)。
1010
* 之后改了某条的 `prompt`,已安装用户只要没改过该角色的提示词,升级后就会自动换成新版。
@@ -24,8 +24,6 @@ export interface DefaultPersona {
2424
name: string
2525
/** 专长,一句话。 */
2626
description: string
27-
/** 开场白 / 口头禅。 */
28-
tagline: string
2927
/** 首次种入时是否启用(默认角色皆 true,作为可直接对话的身份)。 */
3028
enabled: boolean
3129
/** 偏好模型 `"providerId:modelId"`;省略 = 跟随全局默认。 */

‎apps/desktop/src/main/services/deva-personas.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const DEVA = {
2222
name: 'Deva',
2323
avatar: "{\"selections\":{\"head\":\"hm1-p-000005\",\"body\":\"hm1-p-000029\",\"bottom\":\"hm1-p-000036\",\"item\":\"hm1-p-000061\",\"glasses\":\"hm1-p-000056\"},\"colors\":{\"stroke\":\"000000\",\"hair\":\"e6567a\",\"skin\":\"ffd9c0\",\"clothes\":\"ffd23f\",\"bottom\":\"000000\"},\"background\":\"8a38f5\"}",
2424
description: '全能型工作助手,善用各类工具解决实际问题,亦能从专业角度答疑解惑。',
25-
tagline: '有什么我能帮上忙的?',
2625
enabled: true,
2726
prompt: PROMPT
2827
}

‎apps/desktop/src/main/services/personas.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ export interface PersonaRecord {
6262
* chat.ts 取角色)恒为空串——否则每轮对话都要把所有头像读盘 + base64 一遍,纯属白做功。
6363
*/
6464
avatarImage: string
65-
/** 开场白 / 口头禅。 */
66-
tagline: string
6765
/** 偏好模型引用 `"providerId:modelId"`;空串 = 跟随主对话默认(见 model-resolve.ts)。 */
6866
model: string
6967
/** .md 正文 = 要追加进系统提示词的内容。 */
@@ -77,7 +75,6 @@ export interface PersonaUpsertInput {
7775
name: string
7876
description?: string
7977
avatar?: string
80-
tagline?: string
8178
model?: string
8279
prompt?: string
8380
/** 可选:一并设置启用态(新建默认关)。 */
@@ -177,7 +174,6 @@ function parsePersona(id: string, raw: string, enabled: boolean, withImage: bool
177174
description: fmString(data, 'description'),
178175
avatar: fmString(data, 'avatar'),
179176
avatarImage: withImage ? readAvatarImage(id) : '',
180-
tagline: fmString(data, 'tagline'),
181177
model: fmString(data, 'model'),
182178
prompt: body.trim(),
183179
enabled
@@ -239,15 +235,13 @@ function composePersonaMd(input: {
239235
name: string
240236
description: string
241237
avatar: string
242-
tagline: string
243238
model: string
244239
prompt: string
245240
}): string {
246241
const lines = ['---', `name: ${fmScalar(input.name)}`]
247242
if (input.description) lines.push(`description: ${fmScalar(input.description)}`)
248243
// avatar 为 JSON 字符串(含引号/大括号),必须经 fmScalar 引号化 + 转义,方能安全存进 YAML 单行。
249244
if (input.avatar) lines.push(`avatar: ${fmScalar(input.avatar)}`)
250-
if (input.tagline) lines.push(`tagline: ${fmScalar(input.tagline)}`)
251245
if (input.model) lines.push(`model: ${fmScalar(input.model)}`)
252246
lines.push('---', '', input.prompt.trim(), '')
253247
return lines.join('\n')
@@ -264,7 +258,6 @@ export function upsertPersona(input: PersonaUpsertInput): PersonaRecord {
264258
name,
265259
description: (input.description ?? '').trim(),
266260
avatar: (input.avatar ?? '').trim(),
267-
tagline: (input.tagline ?? '').trim(),
268261
model: (input.model ?? '').trim(),
269262
prompt: input.prompt ?? ''
270263
})
@@ -288,7 +281,6 @@ export function upsertPersona(input: PersonaUpsertInput): PersonaRecord {
288281
description: (input.description ?? '').trim(),
289282
avatar: (input.avatar ?? '').trim(),
290283
avatarImage: readAvatarImage(id),
291-
tagline: (input.tagline ?? '').trim(),
292284
model: (input.model ?? '').trim(),
293285
prompt: input.prompt ?? '',
294286
enabled: input.enabled === true
@@ -416,7 +408,6 @@ export function ensureSeededPersonas(): void {
416408
description: def.description,
417409
// avatar 省略 → 由 id 确定性生成一枚稳定 Humation 头像(用户可在编辑器改)。
418410
avatar: def.avatar ?? '',
419-
tagline: def.tagline,
420411
model: def.model ?? '',
421412
prompt: def.prompt,
422413
enabled: def.enabled

‎apps/desktop/src/main/services/xiaomajiang-personas.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ const XIAOMAJIANG = {
289289
name: '小码酱',
290290
avatar: "{\"selections\":{\"head\":\"hm1-p-000018\",\"body\":\"hm1-p-000025\",\"bottom\":\"hm1-p-000038\",\"item\":\"hm1-p-000042\",\"glasses\":\"hm1-p-000056\"},\"colors\":{\"stroke\":\"000000\",\"hair\":\"000000\",\"skin\":\"F7DFBB\",\"clothes\":\"F20202\",\"bottom\":\"000000\"},\"background\":\"3AD9C7\"}",
291291
description: '擅长红队/安全研究与逆向工程,兼顾全栈开发与深度技术。',
292-
tagline: '有什么我能帮上忙的?',
293292
enabled: true,
294293
prompt: PROMPT
295294
}

‎apps/desktop/src/preload/index.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ export interface PersonaRecord {
353353
* 图片文件,不入 upsert 入参——改图走 setAvatarImage / clearAvatarImage。
354354
*/
355355
avatarImage: string
356-
/** 开场白 / 口头禅。 */
357-
tagline: string
358356
/** 偏好模型引用 `"providerId:modelId"`;空串 = 跟随主对话默认。 */
359357
model: string
360358
/** 正文 = 追加进主智能体系统提示词的内容。 */
@@ -395,7 +393,6 @@ export interface PersonaUpsertInput {
395393
name: string
396394
description?: string
397395
avatar?: string
398-
tagline?: string
399396
model?: string
400397
prompt?: string
401398
enabled?: boolean

‎apps/desktop/src/renderer/src/i18n/messages.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,6 @@ const zhCN: MessageTree = {
11131113
background: '背景色'
11141114
},
11151115
fSpecialty: '专长',
1116-
fTagline: '开场白',
11171116
fModel: '偏好模型',
11181117
fPrompt: '系统提示词',
11191118
extEmpty: '暂无扩展',
@@ -2238,7 +2237,6 @@ const en: MessageTree = {
22382237
background: 'Background'
22392238
},
22402239
fSpecialty: 'Specialty',
2241-
fTagline: 'Tagline',
22422240
fModel: 'Preferred model',
22432241
fPrompt: 'System prompt',
22442242
extEmpty: 'No extensions',

‎apps/desktop/src/renderer/src/mock/extensions.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export interface McpServer {
9696
}
9797

9898
/**
99-
* Agent 提示词(Persona):对话优先外壳里的**完整身份**——name/头像/专长/开场白/
99+
* Agent 提示词(Persona):对话优先外壳里的**完整身份**——name/头像/专长/
100100
* 偏好模型/提示词。旧壳仅用 name+prompt(叠加注入),新增字段可选、缺省安全。
101101
* 无工具白名单:角色不收窄工具,全部工具按需可用。
102102
*/
@@ -111,8 +111,6 @@ export interface Persona {
111111
* 是否存在图片文件派生,不随 upsert 写回——改图走 store 的 setPersonaAvatarImage / clear。
112112
*/
113113
avatarImage: string
114-
/** 开场白 / 口头禅。 */
115-
tagline: string
116114
/** 偏好模型引用 `"providerId:modelId"`;空串 = 跟随主对话默认。 */
117115
model: string
118116
/** 提示词正文(追加进主智能体系统提示词)。 */

‎apps/desktop/src/renderer/src/redesign/ChatFirstShell.tsx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -969,14 +969,11 @@ function Rail({
969969
)
970970
})
971971
}, [sessions, personas, q])
972-
// 角色列表按检索词过滤(角色名 + 简介 + 开场白,均大小写不敏感);空词返回全部。
972+
// 角色列表按检索词过滤(角色名 + 简介,均大小写不敏感);空词返回全部。
973973
const shownPersonas = useMemo(() => {
974974
if (!q) return personas
975975
return personas.filter(
976-
(p) =>
977-
p.name.toLowerCase().includes(q) ||
978-
p.desc.toLowerCase().includes(q) ||
979-
p.tagline.toLowerCase().includes(q)
976+
(p) => p.name.toLowerCase().includes(q) || p.desc.toLowerCase().includes(q)
980977
)
981978
}, [personas, q])
982979

@@ -4866,7 +4863,7 @@ function EffortPicker(): React.JSX.Element | null {
48664863
type ProfileTab = 'chats' | 'caps'
48674864

48684865
/**
4869-
* 角色资料卡:头像与名字并排、开场白引言、操作按钮,下面用「对话 / 能力」两个标签切换,一次只看一块。
4866+
* 角色资料卡:头像与名字并排、操作按钮,下面用「对话 / 能力」两个标签切换,一次只看一块。
48704867
* 能力 = 在扩展页指定给这个角色的技能与 MCP(对所有角色开放的不在这里重复),点某项进入设置 › 扩展的详情;
48714868
* 没有专属能力的角色不显示「能力」标签。标签选择跨角色保留,便于逐个查看各角色的能力。
48724869
* 名片(头像到标签)固定不动,只有下方列表滚动。
@@ -4948,7 +4945,6 @@ function ProfileView({
49484945
)}
49494946
</div>
49504947
</div>
4951-
{persona.tagline && <div className="cf-phead__quote">{persona.tagline}</div>}
49524948

49534949
<div className="cf-profile__actions">
49544950
<button className="cf-profile__new" onClick={onStart}>

‎apps/desktop/src/renderer/src/redesign/redesign.css‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,14 +2798,6 @@ body.cf-resizing-y * {
27982798
text-overflow: ellipsis;
27992799
white-space: nowrap;
28002800
}
2801-
/* 开场白:左侧竖线引言 */
2802-
.cf-phead__quote {
2803-
margin-top: 14px;
2804-
padding-left: 12px;
2805-
border-left: 2px solid var(--border-strong);
2806-
font-size: 13px;
2807-
color: var(--fg-muted);
2808-
}
28092801
.cf-ptabs {
28102802
flex: none;
28112803
display: flex;

0 commit comments

Comments
 (0)