dsh-soul 0.4.0 → 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 +21 -8
- package/README_EN.md +21 -8
- package/client/index.mjs +245 -99
- package/index.mjs +446 -52
- package/lib/config.mjs +48 -1
- package/package.json +1 -1
- package/scripts/verify-config.mjs +39 -1
package/README.md
CHANGED
|
@@ -18,6 +18,9 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
|
|
|
18
18
|
- 提示词随输出语言本地化:`language=en` 时 system prompt 使用英文描述
|
|
19
19
|
- 输入自定义指令
|
|
20
20
|
- Agent 可调用工具 `set_persona`,让模型在对话中直接调整人设
|
|
21
|
+
- 人设预设:多套命名人设一键切换(保存 / 使用 / 列表 / 删除,Web UI 与命令双入口)
|
|
22
|
+
- `set_persona` 确认模式(`requireToolConfirmation`):Agent 的人设修改需经 `/soul confirm` 确认后才生效
|
|
23
|
+
- `/soul set` 键值方式修改配置项
|
|
21
24
|
- 配置持久化保存
|
|
22
25
|
- 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000 字符)与枚举校验,非法或超限字段整单拒绝
|
|
23
26
|
- 配置更新后同步到所有活动 Agent
|
|
@@ -63,16 +66,23 @@ dsh plugin --profile web update dsh-soul
|
|
|
63
66
|
也可以使用斜杠命令:
|
|
64
67
|
|
|
65
68
|
```text
|
|
66
|
-
/soul show
|
|
67
|
-
/soul
|
|
68
|
-
/soul
|
|
69
|
-
/soul
|
|
70
|
-
/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 小明 设置昵称
|
|
71
81
|
```
|
|
72
82
|
|
|
73
|
-
配置保存后会同步到所有活动 Agent
|
|
83
|
+
配置保存后会同步到所有活动 Agent,当前会话下一次请求即可使用最新配置;无实际变化的保存不产生注入消息。
|
|
74
84
|
|
|
75
|
-
Agent 也可以通过工具 `set_persona`
|
|
85
|
+
Agent 也可以通过工具 `set_persona` 在对话中直接调整你的人设(昵称、回复风格和语调、特质、回复语言、自定义指令)。模型只会在明确请求改变称呼、语气、风格或语言时调用该工具。开启「人设变更需确认」(`requireToolConfirmation`)后,该工具的修改会以待确认提议返回,需使用 `/soul confirm` 确认或 `/soul reject` 拒绝后才会生效。
|
|
76
86
|
|
|
77
87
|
## 配置文件
|
|
78
88
|
|
|
@@ -92,10 +102,13 @@ soul-config.json
|
|
|
92
102
|
"bio": "对编程和技术感兴趣",
|
|
93
103
|
"style": "professional",
|
|
94
104
|
"language": "zh",
|
|
95
|
-
"customInstructions": "请保持简洁,优先给出结论。"
|
|
105
|
+
"customInstructions": "请保持简洁,优先给出结论。",
|
|
106
|
+
"requireToolConfirmation": false
|
|
96
107
|
}
|
|
97
108
|
```
|
|
98
109
|
|
|
110
|
+
人设预设保存在同一文件的 `personas` 字段:名称 → 人设字段快照(昵称/职业/介绍/风格/特质/语言/自定义指令)+ `updatedAt`;预设库变更不影响活动配置,使用预设时才应用到配置并同步会话。
|
|
111
|
+
|
|
99
112
|
字段长度上限:昵称 / 职业 50 字符,介绍 500 字符,自定义指令 2000 字符;未知字段会被丢弃,非法或超限字段整单拒绝(HTTP 返回 400 与字段级错误明细)。
|
|
100
113
|
|
|
101
114
|
## 实现原理
|
package/README_EN.md
CHANGED
|
@@ -18,6 +18,9 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
|
|
|
18
18
|
- The compiled system prompt follows the output language (English descriptions when `language=en`)
|
|
19
19
|
- Custom instructions
|
|
20
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
|
|
21
24
|
- Configuration persisted to disk
|
|
22
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
|
|
23
26
|
- Configuration synced to all active agents after every update
|
|
@@ -63,16 +66,23 @@ After starting DSH, open the **Personalization** section on the settings page, e
|
|
|
63
66
|
Slash commands are also available:
|
|
64
67
|
|
|
65
68
|
```text
|
|
66
|
-
/soul show
|
|
67
|
-
/soul
|
|
68
|
-
/soul
|
|
69
|
-
/soul
|
|
70
|
-
/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
|
|
71
81
|
```
|
|
72
82
|
|
|
73
|
-
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.
|
|
74
84
|
|
|
75
|
-
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`).
|
|
76
86
|
|
|
77
87
|
## Configuration File
|
|
78
88
|
|
|
@@ -92,10 +102,13 @@ Example:
|
|
|
92
102
|
"bio": "Interested in programming and technology",
|
|
93
103
|
"style": "professional",
|
|
94
104
|
"language": "en",
|
|
95
|
-
"customInstructions": "Be concise and lead with the conclusion."
|
|
105
|
+
"customInstructions": "Be concise and lead with the conclusion.",
|
|
106
|
+
"requireToolConfirmation": false
|
|
96
107
|
}
|
|
97
108
|
```
|
|
98
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
|
+
|
|
99
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).
|
|
100
113
|
|
|
101
114
|
## How It Works
|