dsh-soul 0.3.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -9
- package/README_EN.md +25 -9
- package/client/index.mjs +509 -218
- package/index.mjs +637 -242
- package/lib/config.mjs +48 -1
- package/package.json +1 -1
- package/scripts/verify-config.mjs +39 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
9
|
- Web UI 个性化设置页面
|
|
10
|
+
- 设置页体验:中英双语文案(随界面语言切换)、dirty 检测(无改动禁用保存)、保存结果提示、「查看当前生效提示词」只读面板
|
|
10
11
|
- 启用或禁用个性化设置
|
|
11
12
|
- 「关于你」:设置用户昵称、职业和介绍,回复时结合你的背景
|
|
12
13
|
- 选择回复风格和语调(合并为单一选项):`professional`(专业严谨)、`casual`(轻松自然)、`humorous`(幽默风趣)、`roast`(吐槽达人)、`efficient`(高效干练)
|
|
@@ -14,17 +15,22 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
|
|
|
14
15
|
- 标题和列表:`default`(默认)、`more`(增强,采用清晰格式和列表结构)、`less`(减弱,使用更多段落文本)
|
|
15
16
|
- 表情符号:`default`(默认)、`more`(增强,使用较多表情符号)、`less`(减弱,尽量减少使用表情符号)
|
|
16
17
|
- 选择输出语言(Agent 回复语言 + `/soul` 命令输出语言):中文 / English
|
|
18
|
+
- 提示词随输出语言本地化:`language=en` 时 system prompt 使用英文描述
|
|
17
19
|
- 输入自定义指令
|
|
18
20
|
- Agent 可调用工具 `set_persona`,让模型在对话中直接调整人设
|
|
21
|
+
- 人设预设:多套命名人设一键切换(保存 / 使用 / 列表 / 删除,Web UI 与命令双入口)
|
|
22
|
+
- `set_persona` 确认模式(`requireToolConfirmation`):Agent 的人设修改需经 `/soul confirm` 确认后才生效
|
|
23
|
+
- `/soul set` 键值方式修改配置项
|
|
19
24
|
- 配置持久化保存
|
|
20
25
|
- 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000 字符)与枚举校验,非法或超限字段整单拒绝
|
|
21
26
|
- 配置更新后同步到所有活动 Agent
|
|
27
|
+
- 变更检测:仅在配置实际变化时刷新提示词并注入会话,无变化的保存不产生注入消息
|
|
22
28
|
|
|
23
29
|
## 安装
|
|
24
30
|
|
|
25
31
|
```powershell
|
|
26
32
|
dsh plugin --profile web add dsh-soul
|
|
27
|
-
dsh --profile web
|
|
33
|
+
dsh plugin --profile web update dsh-soul
|
|
28
34
|
```
|
|
29
35
|
|
|
30
36
|
插件配置由 `cordis.patch.yml` 提供:
|
|
@@ -60,16 +66,23 @@ dsh --profile web web
|
|
|
60
66
|
也可以使用斜杠命令:
|
|
61
67
|
|
|
62
68
|
```text
|
|
63
|
-
/soul show
|
|
64
|
-
/soul
|
|
65
|
-
/soul
|
|
66
|
-
/soul
|
|
67
|
-
/soul
|
|
69
|
+
/soul show 查看当前配置(含确认模式与预设数量)
|
|
70
|
+
/soul set k=v 修改配置项(如 /soul set style=humorous language=en)
|
|
71
|
+
/soul save <名> 保存当前配置为人设预设
|
|
72
|
+
/soul use <名> 应用人设预设
|
|
73
|
+
/soul list 查看人设预设(✔ 标记当前匹配项)
|
|
74
|
+
/soul del <名> 删除人设预设(delete / rm 别名)
|
|
75
|
+
/soul confirm 应用待确认的人设变更(确认模式)
|
|
76
|
+
/soul reject 拒绝待确认的人设变更
|
|
77
|
+
/soul reset 重置配置(保留人设预设库)
|
|
78
|
+
/soul enable 启用个性化设置
|
|
79
|
+
/soul disable 禁用个性化设置
|
|
80
|
+
/soul 小明 设置昵称
|
|
68
81
|
```
|
|
69
82
|
|
|
70
|
-
配置保存后会同步到所有活动 Agent
|
|
83
|
+
配置保存后会同步到所有活动 Agent,当前会话下一次请求即可使用最新配置;无实际变化的保存不产生注入消息。
|
|
71
84
|
|
|
72
|
-
Agent 也可以通过工具 `set_persona`
|
|
85
|
+
Agent 也可以通过工具 `set_persona` 在对话中直接调整你的人设(昵称、回复风格和语调、特质、回复语言、自定义指令)。模型只会在明确请求改变称呼、语气、风格或语言时调用该工具。开启「人设变更需确认」(`requireToolConfirmation`)后,该工具的修改会以待确认提议返回,需使用 `/soul confirm` 确认或 `/soul reject` 拒绝后才会生效。
|
|
73
86
|
|
|
74
87
|
## 配置文件
|
|
75
88
|
|
|
@@ -89,10 +102,13 @@ soul-config.json
|
|
|
89
102
|
"bio": "对编程和技术感兴趣",
|
|
90
103
|
"style": "professional",
|
|
91
104
|
"language": "zh",
|
|
92
|
-
"customInstructions": "请保持简洁,优先给出结论。"
|
|
105
|
+
"customInstructions": "请保持简洁,优先给出结论。",
|
|
106
|
+
"requireToolConfirmation": false
|
|
93
107
|
}
|
|
94
108
|
```
|
|
95
109
|
|
|
110
|
+
人设预设保存在同一文件的 `personas` 字段:名称 → 人设字段快照(昵称/职业/介绍/风格/特质/语言/自定义指令)+ `updatedAt`;预设库变更不影响活动配置,使用预设时才应用到配置并同步会话。
|
|
111
|
+
|
|
96
112
|
字段长度上限:昵称 / 职业 50 字符,介绍 500 字符,自定义指令 2000 字符;未知字段会被丢弃,非法或超限字段整单拒绝(HTTP 返回 400 与字段级错误明细)。
|
|
97
113
|
|
|
98
114
|
## 实现原理
|
package/README_EN.md
CHANGED
|
@@ -7,6 +7,7 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
- Personalization settings page in the Web UI
|
|
10
|
+
- Localized settings UI (English/Chinese, follows the interface language), dirty tracking (save disabled when unchanged), save-result toasts, and a read-only "active prompt" viewer
|
|
10
11
|
- Enable or disable personalization
|
|
11
12
|
- "About you": set your nickname, occupation and bio so replies fit your background
|
|
12
13
|
- Combined style & tone option: `professional`, `casual`, `humorous`, `roast`, `efficient`
|
|
@@ -14,17 +15,22 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
|
|
|
14
15
|
- Headings & lists: `default`, `more` (clear formatting with headings and lists), `less` (more paragraph text)
|
|
15
16
|
- Emoji: `default`, `more` (frequent emoji usage), `less` (minimal emoji usage)
|
|
16
17
|
- Output language (agent reply language + `/soul` command output language): Chinese or English
|
|
18
|
+
- The compiled system prompt follows the output language (English descriptions when `language=en`)
|
|
17
19
|
- Custom instructions
|
|
18
20
|
- Agent-callable tool `set_persona` to let the model adjust persona during a conversation
|
|
21
|
+
- Named personas: save the current config under a name and switch with one click (save / use / list / delete, in both the Web UI and slash commands)
|
|
22
|
+
- `set_persona` confirmation mode (`requireToolConfirmation`): agent persona changes take effect only after `/soul confirm`
|
|
23
|
+
- `/soul set` key=value field updates
|
|
19
24
|
- Configuration persisted to disk
|
|
20
25
|
- Input validation: field whitelist, types, length limits (nickname/occupation 50, bio 500, custom instructions 2000 chars) and enum checks; invalid or oversized fields reject the whole write
|
|
21
26
|
- Configuration synced to all active agents after every update
|
|
27
|
+
- Change detection: the prompt is refreshed and sessions injected only when the configuration actually changed — no-op saves inject nothing
|
|
22
28
|
|
|
23
29
|
## Installation
|
|
24
30
|
|
|
25
31
|
```powershell
|
|
26
32
|
dsh plugin --profile web add dsh-soul
|
|
27
|
-
dsh --profile web
|
|
33
|
+
dsh plugin --profile web update dsh-soul
|
|
28
34
|
```
|
|
29
35
|
|
|
30
36
|
The plugin is registered via `cordis.patch.yml`:
|
|
@@ -60,16 +66,23 @@ After starting DSH, open the **Personalization** section on the settings page, e
|
|
|
60
66
|
Slash commands are also available:
|
|
61
67
|
|
|
62
68
|
```text
|
|
63
|
-
/soul show
|
|
64
|
-
/soul
|
|
65
|
-
/soul
|
|
66
|
-
/soul
|
|
67
|
-
/soul
|
|
69
|
+
/soul show Show current configuration (confirmation mode & persona count)
|
|
70
|
+
/soul set k=v Change config fields (e.g. /soul set style=humorous language=en)
|
|
71
|
+
/soul save <name> Save the current config as a persona
|
|
72
|
+
/soul use <name> Apply a persona
|
|
73
|
+
/soul list List personas (✔ marks the active match)
|
|
74
|
+
/soul del <name> Delete a persona (delete / rm aliases)
|
|
75
|
+
/soul confirm Apply the pending persona proposal (confirmation mode)
|
|
76
|
+
/soul reject Discard the pending persona proposal
|
|
77
|
+
/soul reset Reset configuration (keeps the persona library)
|
|
78
|
+
/soul enable Enable personalization
|
|
79
|
+
/soul disable Disable personalization
|
|
80
|
+
/soul Bob Set nickname
|
|
68
81
|
```
|
|
69
82
|
|
|
70
|
-
Once saved, the configuration is synced to all active agents and takes effect on the next request in the current session.
|
|
83
|
+
Once saved, the configuration is synced to all active agents and takes effect on the next request in the current session; no-op saves inject nothing.
|
|
71
84
|
|
|
72
|
-
The agent can also use the `set_persona` tool to adjust your persona (nickname, style & tone, traits, reply language, custom instructions)
|
|
85
|
+
The agent can also use the `set_persona` tool to adjust your persona (nickname, style & tone, traits, reply language, custom instructions). The model only invokes this tool when you explicitly ask to change how it addresses or responds to you. With **Require confirmation for persona changes** (`requireToolConfirmation`) enabled, tool changes come back as a pending proposal and take effect only after `/soul confirm` (or are discarded by `/soul reject`).
|
|
73
86
|
|
|
74
87
|
## Configuration File
|
|
75
88
|
|
|
@@ -89,10 +102,13 @@ Example:
|
|
|
89
102
|
"bio": "Interested in programming and technology",
|
|
90
103
|
"style": "professional",
|
|
91
104
|
"language": "en",
|
|
92
|
-
"customInstructions": "Be concise and lead with the conclusion."
|
|
105
|
+
"customInstructions": "Be concise and lead with the conclusion.",
|
|
106
|
+
"requireToolConfirmation": false
|
|
93
107
|
}
|
|
94
108
|
```
|
|
95
109
|
|
|
110
|
+
Personas are stored in the same file under the `personas` field: name → persona field snapshot (nickname / occupation / bio / style / traits / language / custom instructions) + `updatedAt`. Persona library changes never touch the active config; a persona is applied to the config (and synced to sessions) only when used.
|
|
111
|
+
|
|
96
112
|
Length limits: nickname / occupation 50 chars, bio 500 chars, custom instructions 2000 chars. Unknown fields are dropped; invalid or oversized fields reject the whole write (HTTP returns 400 with per-field error details).
|
|
97
113
|
|
|
98
114
|
## How It Works
|