dsh-soul 0.3.2 → 0.4.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 +7 -1
- package/README_EN.md +7 -1
- package/client/index.mjs +295 -148
- package/index.mjs +298 -274
- package/lib/config.mjs +138 -0
- package/package.json +7 -2
- package/scripts/verify-config.mjs +142 -0
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,16 +15,19 @@ 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`,让模型在对话中直接调整人设
|
|
19
21
|
- 配置持久化保存
|
|
22
|
+
- 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000 字符)与枚举校验,非法或超限字段整单拒绝
|
|
20
23
|
- 配置更新后同步到所有活动 Agent
|
|
24
|
+
- 变更检测:仅在配置实际变化时刷新提示词并注入会话,无变化的保存不产生注入消息
|
|
21
25
|
|
|
22
26
|
## 安装
|
|
23
27
|
|
|
24
28
|
```powershell
|
|
25
29
|
dsh plugin --profile web add dsh-soul
|
|
26
|
-
dsh --profile web
|
|
30
|
+
dsh plugin --profile web update dsh-soul
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
插件配置由 `cordis.patch.yml` 提供:
|
|
@@ -92,6 +96,8 @@ soul-config.json
|
|
|
92
96
|
}
|
|
93
97
|
```
|
|
94
98
|
|
|
99
|
+
字段长度上限:昵称 / 职业 50 字符,介绍 500 字符,自定义指令 2000 字符;未知字段会被丢弃,非法或超限字段整单拒绝(HTTP 返回 400 与字段级错误明细)。
|
|
100
|
+
|
|
95
101
|
## 实现原理
|
|
96
102
|
|
|
97
103
|
插件通过 `compilePrompt()` 将昵称、风格、语调和自定义指令编译成 system prompt,并注册到 DSH:
|
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,16 +15,19 @@ 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
|
|
19
21
|
- Configuration persisted to disk
|
|
22
|
+
- 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
|
|
20
23
|
- Configuration synced to all active agents after every update
|
|
24
|
+
- Change detection: the prompt is refreshed and sessions injected only when the configuration actually changed — no-op saves inject nothing
|
|
21
25
|
|
|
22
26
|
## Installation
|
|
23
27
|
|
|
24
28
|
```powershell
|
|
25
29
|
dsh plugin --profile web add dsh-soul
|
|
26
|
-
dsh --profile web
|
|
30
|
+
dsh plugin --profile web update dsh-soul
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
The plugin is registered via `cordis.patch.yml`:
|
|
@@ -92,6 +96,8 @@ Example:
|
|
|
92
96
|
}
|
|
93
97
|
```
|
|
94
98
|
|
|
99
|
+
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
|
+
|
|
95
101
|
## How It Works
|
|
96
102
|
|
|
97
103
|
The plugin compiles the nickname, style, tone and custom instructions into a system prompt via `compilePrompt()` and registers it with DSH:
|