dsh-soul 0.5.0 → 0.6.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 +16 -5
- package/README_EN.md +16 -5
- package/client/index.mjs +704 -169
- package/index.mjs +79 -39
- package/lib/config.mjs +50 -3
- package/package.json +1 -1
- package/scripts/verify-config.mjs +55 -0
package/README.md
CHANGED
|
@@ -20,11 +20,16 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
|
|
|
20
20
|
- Agent 可调用工具 `set_persona`,让模型在对话中直接调整人设
|
|
21
21
|
- 人设预设:多套命名人设一键切换(保存 / 使用 / 列表 / 删除,Web UI 与命令双入口)
|
|
22
22
|
- `set_persona` 确认模式(`requireToolConfirmation`):Agent 的人设修改需经 `/soul confirm` 确认后才生效
|
|
23
|
+
- 输入框光轨:Agent 回复中时,输入框边框显示沿边循环流动的光轨(默认颜色 `#679EFE`)
|
|
24
|
+
- 颜色:预设色板、取色器或十六进制输入(如 `#679EFE`)
|
|
25
|
+
- 流动速度:慢 / 中 / 快;光带粗细:细 / 中 / 粗
|
|
26
|
+
- 光轨起点、终点沿边框匀速推进,带渐隐拖尾;与输入框边框完全重合,不出现双线
|
|
27
|
+
- 设置页内置实时效果示例,随颜色 / 速度 / 粗细联动;系统开启「减少动态效果」时自动停用
|
|
23
28
|
- `/soul set` 键值方式修改配置项
|
|
24
29
|
- 配置持久化保存
|
|
25
|
-
- 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000
|
|
30
|
+
- 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000 字符)、枚举与十六进制颜色校验,非法或超限字段整单拒绝
|
|
26
31
|
- 配置更新后同步到所有活动 Agent
|
|
27
|
-
-
|
|
32
|
+
- 变更检测:仅在影响 Agent 行为的配置实际变化时刷新提示词并注入会话;纯外观配置(输入框光轨)只落盘,不产生注入消息
|
|
28
33
|
|
|
29
34
|
## 安装
|
|
30
35
|
|
|
@@ -67,7 +72,7 @@ dsh plugin --profile web update dsh-soul
|
|
|
67
72
|
|
|
68
73
|
```text
|
|
69
74
|
/soul show 查看当前配置(含确认模式与预设数量)
|
|
70
|
-
/soul set k=v 修改配置项(如 /soul set style=humorous language=en)
|
|
75
|
+
/soul set k=v 修改配置项(如 /soul set style=humorous language=en;光轨:trailColor=#679EFE trailSpeed=fast trailWidth=thick)
|
|
71
76
|
/soul save <名> 保存当前配置为人设预设
|
|
72
77
|
/soul use <名> 应用人设预设
|
|
73
78
|
/soul list 查看人设预设(✔ 标记当前匹配项)
|
|
@@ -103,13 +108,19 @@ soul-config.json
|
|
|
103
108
|
"style": "professional",
|
|
104
109
|
"language": "zh",
|
|
105
110
|
"customInstructions": "请保持简洁,优先给出结论。",
|
|
106
|
-
"requireToolConfirmation": false
|
|
111
|
+
"requireToolConfirmation": false,
|
|
112
|
+
"trailEnabled": true,
|
|
113
|
+
"trailColor": "#679EFE",
|
|
114
|
+
"trailSpeed": "slow",
|
|
115
|
+
"trailWidth": "thin"
|
|
107
116
|
}
|
|
108
117
|
```
|
|
109
118
|
|
|
110
119
|
人设预设保存在同一文件的 `personas` 字段:名称 → 人设字段快照(昵称/职业/介绍/风格/特质/语言/自定义指令)+ `updatedAt`;预设库变更不影响活动配置,使用预设时才应用到配置并同步会话。
|
|
111
120
|
|
|
112
|
-
|
|
121
|
+
输入框光轨字段:`trailEnabled`(是否启用,默认 `true`)、`trailColor`(6 位十六进制颜色,统一大写存储,默认 `#679EFE`)、`trailSpeed`(`slow` / `normal` / `fast`,默认 `slow`)、`trailWidth`(`thin` / `normal` / `thick`,默认 `thin`)。这四个字段属纯外观配置,只落盘、不进入 system prompt、不触发会话注入。
|
|
122
|
+
|
|
123
|
+
字段长度上限:昵称 / 职业 50 字符,介绍 500 字符,自定义指令 2000 字符;颜色必须为 `#rrggbb` 形式。未知字段会被丢弃,非法或超限字段整单拒绝(HTTP 返回 400 与字段级错误明细)。
|
|
113
124
|
|
|
114
125
|
## 实现原理
|
|
115
126
|
|
package/README_EN.md
CHANGED
|
@@ -20,11 +20,16 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
|
|
|
20
20
|
- Agent-callable tool `set_persona` to let the model adjust persona during a conversation
|
|
21
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
22
|
- `set_persona` confirmation mode (`requireToolConfirmation`): agent persona changes take effect only after `/soul confirm`
|
|
23
|
+
- Composer light trail: while the agent is replying, a light trail loops around the composer border (default color `#679EFE`)
|
|
24
|
+
- Color: preset swatches, a color picker, or a hex input (e.g. `#679EFE`)
|
|
25
|
+
- Flow speed: slow / normal / fast (default slow, 4.8s / 3.6s / 2.4s); trail thickness: thin / normal / thick (default thin, 1.5 / 2.5 / 4 px)
|
|
26
|
+
- The trail advances at constant speed along the border and fades into a tail; it sits exactly on the composer border, never producing a double line
|
|
27
|
+
- The settings page shows a live preview that follows color / speed / thickness; automatically disabled under "reduce motion"
|
|
23
28
|
- `/soul set` key=value field updates
|
|
24
29
|
- Configuration persisted to disk
|
|
25
|
-
- Input validation: field whitelist, types, length limits (nickname/occupation 50, bio 500, custom instructions 2000 chars) and
|
|
30
|
+
- Input validation: field whitelist, types, length limits (nickname/occupation 50, bio 500, custom instructions 2000 chars), enum and hex-color checks; invalid or oversized fields reject the whole write
|
|
26
31
|
- Configuration synced to all active agents after every update
|
|
27
|
-
- Change detection: the prompt is refreshed and sessions injected only when
|
|
32
|
+
- Change detection: the prompt is refreshed and sessions injected only when a behavior-affecting field actually changed — appearance-only config (composer light trail) is persisted without injecting anything
|
|
28
33
|
|
|
29
34
|
## Installation
|
|
30
35
|
|
|
@@ -67,7 +72,7 @@ Slash commands are also available:
|
|
|
67
72
|
|
|
68
73
|
```text
|
|
69
74
|
/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)
|
|
75
|
+
/soul set k=v Change config fields (e.g. /soul set style=humorous language=en; trail: trailColor=#679EFE trailSpeed=fast trailWidth=thick)
|
|
71
76
|
/soul save <name> Save the current config as a persona
|
|
72
77
|
/soul use <name> Apply a persona
|
|
73
78
|
/soul list List personas (✔ marks the active match)
|
|
@@ -103,13 +108,19 @@ Example:
|
|
|
103
108
|
"style": "professional",
|
|
104
109
|
"language": "en",
|
|
105
110
|
"customInstructions": "Be concise and lead with the conclusion.",
|
|
106
|
-
"requireToolConfirmation": false
|
|
111
|
+
"requireToolConfirmation": false,
|
|
112
|
+
"trailEnabled": true,
|
|
113
|
+
"trailColor": "#679EFE",
|
|
114
|
+
"trailSpeed": "slow",
|
|
115
|
+
"trailWidth": "thin"
|
|
107
116
|
}
|
|
108
117
|
```
|
|
109
118
|
|
|
110
119
|
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
120
|
|
|
112
|
-
|
|
121
|
+
Composer light trail fields: `trailEnabled` (on/off, default `true`), `trailColor` (6-digit hex, stored uppercase, default `#679EFE`), `trailSpeed` (`slow` / `normal` / `fast`, default `slow`), `trailWidth` (`thin` / `normal` / `thick`, default `thin`). These are appearance-only: they are persisted but never enter the system prompt and never trigger a session injection.
|
|
122
|
+
|
|
123
|
+
Length limits: nickname / occupation 50 chars, bio 500 chars, custom instructions 2000 chars; the color must be `#rrggbb`. Unknown fields are dropped; invalid or oversized fields reject the whole write (HTTP returns 400 with per-field error details).
|
|
113
124
|
|
|
114
125
|
## How It Works
|
|
115
126
|
|