dsh-soul 0.1.0 → 0.1.1
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 +2 -8
- package/index.mjs +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,16 +46,10 @@ dsh --profile web web
|
|
|
46
46
|
|
|
47
47
|
## 配置文件
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
插件将配置保存到 DSH 的用户数据目录,文件名为:
|
|
50
50
|
|
|
51
51
|
```text
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
未设置 `DSH_HOME` 时使用:
|
|
56
|
-
|
|
57
|
-
```text
|
|
58
|
-
~/.dsh/soul-config.json
|
|
52
|
+
soul-config.json
|
|
59
53
|
```
|
|
60
54
|
|
|
61
55
|
配置示例:
|
package/index.mjs
CHANGED
|
@@ -216,20 +216,25 @@ function injectPromptToAllAgents(ctx, config) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
const prompt = compilePrompt(config)
|
|
219
|
-
|
|
219
|
+
const disabledText = [
|
|
220
|
+
'[dsh-soul 个性化配置已关闭]',
|
|
221
|
+
'从现在开始不要使用 dsh-soul 之前注入的昵称、角色、回复风格或语调配置。',
|
|
222
|
+
'请恢复使用 Agent 的默认行为。'
|
|
223
|
+
].join('\\n')
|
|
224
|
+
const snapshotText = prompt || disabledText
|
|
220
225
|
|
|
221
226
|
for (const agent of agents.list()) {
|
|
222
227
|
try {
|
|
223
228
|
agent.inject(createUserMessage({
|
|
224
229
|
content: [{
|
|
225
230
|
type: 'text',
|
|
226
|
-
text: [
|
|
231
|
+
text: prompt ? [
|
|
227
232
|
'[dsh-soul 个性化配置已更新]',
|
|
228
233
|
'以下是当前最新的个性化配置快照。',
|
|
229
234
|
'从现在开始必须按照此配置回复,不要继续使用旧的昵称、旧的角色或旧的风格。',
|
|
230
235
|
'',
|
|
231
236
|
prompt
|
|
232
|
-
].join('\\n')
|
|
237
|
+
].join('\\n') : snapshotText
|
|
233
238
|
}],
|
|
234
239
|
source: {
|
|
235
240
|
kind: 'plugin',
|
|
@@ -237,7 +242,7 @@ function injectPromptToAllAgents(ctx, config) {
|
|
|
237
242
|
form: 'snapshot',
|
|
238
243
|
sections: [{
|
|
239
244
|
name: 'soul:persona',
|
|
240
|
-
text:
|
|
245
|
+
text: snapshotText
|
|
241
246
|
}]
|
|
242
247
|
}
|
|
243
248
|
}))
|