dsh-wdx-relief 0.2.0 → 0.3.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/client/client.js +49 -145
- package/docs/bundle-config.webp +0 -0
- package/docs/guide.md +7 -11
- package/index.js +7 -12
- package/package.json +1 -1
- package/src/style.js +27 -73
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 — 2026-11-09
|
|
4
|
+
|
|
5
|
+
- 精简回复设置:长度 3 档(短/标准/详细);风格 5 选 1(默认/专业/亲和/直接/跟随我的风格);保留「便于行动」开关和自定义指令。
|
|
6
|
+
- 删除 5 个细节轴(亲切、热情、表情、可视化、标题列表)和独立的「参考我的写作风格」开关,避免预设与轴、开关与轴互相冲突。
|
|
7
|
+
- 旧配置兼容:`writingStyle: true` 映射为「跟随我的风格」,旧 `baseStyle` 的 professional/friendly/blunt 映射到同名风格。
|
|
8
|
+
|
|
3
9
|
## 0.2.0 — 2026-11-09
|
|
4
10
|
|
|
5
11
|
- 新增「便于行动」输出模式(默认开启):先给结果/下一步、按内容比例组织、术语先用白话说明、保留风险与失败条件、不复述、不把已授权工作交回用户。规则改编自 `agent-configs-skills/skills/i-have-adhd`(MIT)。
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
## 功能
|
|
9
9
|
|
|
10
10
|
- **输入框下一句预测**:对话结束后用灰字猜你接下来要发的话,<kbd>Tab</kbd> 填入;打字隐藏,<kbd>Esc</kbd> 忽略。
|
|
11
|
-
-
|
|
11
|
+
- **回复风格**:长度 **短 / 标准 / 详细**;风格 **默认 / 专业 / 亲和 / 直接 / 跟随我的风格**;可加最多 2000 字的自定义指令。
|
|
12
12
|
- **便于行动**(默认开启):先给结果和下一步;能一句说清的不写一段,术语先用白话说明;保留风险、失败条件和已授权该做的工作。
|
|
13
13
|
|
|
14
14
|
## 安装
|
package/client/client.js
CHANGED
|
@@ -42,9 +42,6 @@ window.__ModuleLoader__.load({
|
|
|
42
42
|
'.wdxs-page{width:100%;display:flex;flex-direction:column;color:var(--dsw-alias-label-primary)}',
|
|
43
43
|
'.wdxs-intro{color:var(--dsw-alias-label-tertiary);margin:-4px 0 4px;font-size:12px;line-height:18px}',
|
|
44
44
|
'.wdxs-groupHead{color:var(--dsw-alias-label-secondary);margin:24px 0 0;font-size:13px;font-weight:600;line-height:20px}',
|
|
45
|
-
'.wdxs-groupHeadRow{justify-content:space-between;align-items:center;gap:16px;margin:24px 0 0;display:flex}',
|
|
46
|
-
'.wdxs-groupHeadRow .wdxs-groupHead{margin:0}',
|
|
47
|
-
'.wdxs-subHead{color:var(--dsw-alias-label-tertiary);margin:14px 0 0;font-size:12px;font-weight:500;line-height:18px}',
|
|
48
45
|
'.wdxs-item{flex-direction:column;gap:2px;max-width:280px;display:flex}',
|
|
49
46
|
'.wdxs-itemName{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}',
|
|
50
47
|
'.wdxs-itemDesc{color:var(--dsw-alias-label-caption);white-space:normal;font-size:12px;line-height:16px}',
|
|
@@ -74,65 +71,31 @@ window.__ModuleLoader__.load({
|
|
|
74
71
|
// -------------------------------------------------------------- locale
|
|
75
72
|
|
|
76
73
|
var zh = {
|
|
77
|
-
'reply.nav': '回复',
|
|
78
74
|
'reply.intro': '这些偏好只影响回复的表达方式,不改变任务目标、事实准确性或工具权限。',
|
|
79
75
|
'reply.group.input': '输入',
|
|
80
76
|
'reply.group.length': '回复长度',
|
|
81
77
|
'reply.group.writing': '写作',
|
|
82
|
-
'reply.group.style': '基础风格和语气',
|
|
83
|
-
'reply.group.custom': '自定义指令',
|
|
84
78
|
'reply.verbosity.title': '输出详细程度',
|
|
85
79
|
'reply.verbosity.description': '选择回复包含细节的详细程度',
|
|
86
|
-
'reply.verbosity.
|
|
87
|
-
'reply.verbosity.
|
|
88
|
-
'reply.verbosity.
|
|
89
|
-
'reply.verbosity.high': '高',
|
|
80
|
+
'reply.verbosity.low': '短',
|
|
81
|
+
'reply.verbosity.medium': '标准',
|
|
82
|
+
'reply.verbosity.high': '详细',
|
|
90
83
|
'reply.actionable.title': '便于行动',
|
|
91
84
|
'reply.actionable.description': '先给结果和下一步,少铺垫;能一句话说清就不展开,术语先用白话说明',
|
|
92
|
-
'reply.
|
|
93
|
-
'reply.
|
|
94
|
-
'reply.
|
|
95
|
-
'reply.
|
|
96
|
-
'reply.
|
|
97
|
-
'reply.
|
|
98
|
-
'reply.
|
|
99
|
-
'reply.
|
|
100
|
-
'reply.
|
|
101
|
-
'reply.
|
|
102
|
-
'reply.
|
|
103
|
-
'reply.
|
|
104
|
-
'reply.base.option.professional.desc': '精雕细琢,先结论后依据',
|
|
105
|
-
'reply.base.option.friendly.desc': '温和健谈,有耐心',
|
|
106
|
-
'reply.base.option.blunt.desc': '直率指出问题与取舍',
|
|
107
|
-
'reply.base.option.imaginative.desc': '大胆、有想象力的方案',
|
|
108
|
-
'reply.base.option.efficient.desc': '简练直白,最短路径',
|
|
109
|
-
'reply.base.option.snarky.desc': '犀利幽默,不人身攻击',
|
|
110
|
-
'reply.group.axis': '细节调整',
|
|
111
|
-
'reply.axis.default': '默认',
|
|
112
|
-
'reply.axis.enhanced': '增强',
|
|
113
|
-
'reply.axis.reduced': '减弱',
|
|
114
|
-
'reply.friendliness.title': '亲切程度',
|
|
115
|
-
'reply.friendliness.description': '回复的友好与亲近程度',
|
|
116
|
-
'reply.friendliness.enhanced': '更友好、更亲近',
|
|
117
|
-
'reply.friendliness.reduced': '更专业、事实性更强',
|
|
118
|
-
'reply.enthusiasm.title': '热情程度',
|
|
119
|
-
'reply.enthusiasm.description': '回复的活力与热情',
|
|
120
|
-
'reply.enthusiasm.enhanced': '更加活力充沛',
|
|
121
|
-
'reply.enthusiasm.reduced': '更加冷静中立',
|
|
122
|
-
'reply.emoji.title': '表情符号',
|
|
123
|
-
'reply.emoji.description': '回复中表情符号的使用程度',
|
|
124
|
-
'reply.emoji.enhanced': '适当使用表情符号',
|
|
125
|
-
'reply.emoji.reduced': '尽量少用表情符号',
|
|
126
|
-
'reply.visualAnswers.title': '可视化回答',
|
|
127
|
-
'reply.visualAnswers.description': '表格、图示等结构化表达的使用程度',
|
|
128
|
-
'reply.visualAnswers.enhanced': '更多使用可视化结构',
|
|
129
|
-
'reply.visualAnswers.reduced': '优先使用段落文字',
|
|
130
|
-
'reply.headingsLists.title': '标题和列表',
|
|
131
|
-
'reply.headingsLists.description': '标题和列表结构的使用程度',
|
|
132
|
-
'reply.headingsLists.enhanced': '采用清晰格式与列表结构',
|
|
133
|
-
'reply.headingsLists.reduced': '更多段落文本,而非列表结构',
|
|
85
|
+
'reply.style.title': '回复风格',
|
|
86
|
+
'reply.style.description': '选择整体语气和表达方式',
|
|
87
|
+
'reply.style.default': '默认',
|
|
88
|
+
'reply.style.professional': '专业',
|
|
89
|
+
'reply.style.friendly': '亲和',
|
|
90
|
+
'reply.style.blunt': '直接',
|
|
91
|
+
'reply.style.follow': '跟随我的风格',
|
|
92
|
+
'reply.style.option.default.desc': '中立、简洁',
|
|
93
|
+
'reply.style.option.professional.desc': '精确、结构化,少口语',
|
|
94
|
+
'reply.style.option.friendly.desc': '温和、有耐心,术语先解释',
|
|
95
|
+
'reply.style.option.blunt.desc': '直说问题和取舍',
|
|
96
|
+
'reply.style.option.follow.desc': '模仿你在这段对话里的句式与用词',
|
|
134
97
|
'reply.custom.title': '自定义指令',
|
|
135
|
-
'reply.custom.description': '
|
|
98
|
+
'reply.custom.description': '补充只影响回复表达的指令,优先级高于上面的长度和风格',
|
|
136
99
|
'reply.custom.placeholder': '例如:先给结论;用中文解释术语;不要使用「首先/其次」。',
|
|
137
100
|
'reply.saved': '已保存',
|
|
138
101
|
'reply.saveError': '保存失败,请重试',
|
|
@@ -143,65 +106,31 @@ window.__ModuleLoader__.load({
|
|
|
143
106
|
}
|
|
144
107
|
|
|
145
108
|
var en = {
|
|
146
|
-
'reply.nav': 'Replies',
|
|
147
109
|
'reply.intro': 'These preferences shape expression only. They do not change goals, facts, or tool permissions.',
|
|
148
110
|
'reply.group.input': 'Input',
|
|
149
111
|
'reply.group.length': 'Reply length',
|
|
150
112
|
'reply.group.writing': 'Writing',
|
|
151
|
-
'reply.group.style': 'Base style and tone',
|
|
152
|
-
'reply.group.custom': 'Custom instructions',
|
|
153
113
|
'reply.verbosity.title': 'Output detail',
|
|
154
114
|
'reply.verbosity.description': 'How much detail replies should include',
|
|
155
|
-
'reply.verbosity.
|
|
156
|
-
'reply.verbosity.
|
|
157
|
-
'reply.verbosity.
|
|
158
|
-
'reply.verbosity.high': 'High',
|
|
115
|
+
'reply.verbosity.low': 'Short',
|
|
116
|
+
'reply.verbosity.medium': 'Standard',
|
|
117
|
+
'reply.verbosity.high': 'Detailed',
|
|
159
118
|
'reply.actionable.title': 'Actionable replies',
|
|
160
119
|
'reply.actionable.description': 'Lead with the result and next step; explain jargon in plain language; keep risks and failure conditions',
|
|
161
|
-
'reply.
|
|
162
|
-
'reply.
|
|
163
|
-
'reply.
|
|
164
|
-
'reply.
|
|
165
|
-
'reply.
|
|
166
|
-
'reply.
|
|
167
|
-
'reply.
|
|
168
|
-
'reply.
|
|
169
|
-
'reply.
|
|
170
|
-
'reply.
|
|
171
|
-
'reply.
|
|
172
|
-
'reply.
|
|
173
|
-
'reply.base.option.professional.desc': 'Polished, conclusion first',
|
|
174
|
-
'reply.base.option.friendly.desc': 'Warm, patient, approachable',
|
|
175
|
-
'reply.base.option.blunt.desc': 'Direct about problems and tradeoffs',
|
|
176
|
-
'reply.base.option.imaginative.desc': 'Bold, imaginative options',
|
|
177
|
-
'reply.base.option.efficient.desc': 'Terse and action-oriented',
|
|
178
|
-
'reply.base.option.snarky.desc': 'Sharp humor without personal attacks',
|
|
179
|
-
'reply.group.axis': 'Fine-tuning',
|
|
180
|
-
'reply.axis.default': 'Default',
|
|
181
|
-
'reply.axis.enhanced': 'More',
|
|
182
|
-
'reply.axis.reduced': 'Less',
|
|
183
|
-
'reply.friendliness.title': 'Friendliness',
|
|
184
|
-
'reply.friendliness.description': 'How warm and approachable replies feel',
|
|
185
|
-
'reply.friendliness.enhanced': 'Warmer and closer',
|
|
186
|
-
'reply.friendliness.reduced': 'More factual and professional',
|
|
187
|
-
'reply.enthusiasm.title': 'Enthusiasm',
|
|
188
|
-
'reply.enthusiasm.description': 'How energetic replies feel',
|
|
189
|
-
'reply.enthusiasm.enhanced': 'More energetic',
|
|
190
|
-
'reply.enthusiasm.reduced': 'Calmer and more neutral',
|
|
191
|
-
'reply.emoji.title': 'Emoji',
|
|
192
|
-
'reply.emoji.description': 'How often replies use emoji',
|
|
193
|
-
'reply.emoji.enhanced': 'Use emoji when appropriate',
|
|
194
|
-
'reply.emoji.reduced': 'Avoid emoji',
|
|
195
|
-
'reply.visualAnswers.title': 'Visual answers',
|
|
196
|
-
'reply.visualAnswers.description': 'How often replies use tables and diagrams',
|
|
197
|
-
'reply.visualAnswers.enhanced': 'More tables and diagrams',
|
|
198
|
-
'reply.visualAnswers.reduced': 'Prefer prose',
|
|
199
|
-
'reply.headingsLists.title': 'Headings and lists',
|
|
200
|
-
'reply.headingsLists.description': 'How often replies use headings and lists',
|
|
201
|
-
'reply.headingsLists.enhanced': 'Clear headings and lists',
|
|
202
|
-
'reply.headingsLists.reduced': 'More prose, fewer lists',
|
|
120
|
+
'reply.style.title': 'Reply style',
|
|
121
|
+
'reply.style.description': 'Choose the overall tone and expression',
|
|
122
|
+
'reply.style.default': 'Default',
|
|
123
|
+
'reply.style.professional': 'Professional',
|
|
124
|
+
'reply.style.friendly': 'Friendly',
|
|
125
|
+
'reply.style.blunt': 'Blunt',
|
|
126
|
+
'reply.style.follow': 'Follow my style',
|
|
127
|
+
'reply.style.option.default.desc': 'Neutral and concise',
|
|
128
|
+
'reply.style.option.professional.desc': 'Precise, structured, less colloquial',
|
|
129
|
+
'reply.style.option.friendly.desc': 'Warm, patient, explains terms first',
|
|
130
|
+
'reply.style.option.blunt.desc': 'Straight about problems and tradeoffs',
|
|
131
|
+
'reply.style.option.follow.desc': 'Mirror your sentence structure and wording',
|
|
203
132
|
'reply.custom.title': 'Custom instructions',
|
|
204
|
-
'reply.custom.description': 'Extra instructions about expression
|
|
133
|
+
'reply.custom.description': 'Extra instructions about expression; override the length and style settings above',
|
|
205
134
|
'reply.custom.placeholder': 'e.g. Lead with the conclusion; explain terms in one Chinese sentence; avoid "firstly/secondly".',
|
|
206
135
|
'reply.saved': 'Saved',
|
|
207
136
|
'reply.saveError': 'Could not save. Try again.',
|
|
@@ -462,8 +391,7 @@ window.__ModuleLoader__.load({
|
|
|
462
391
|
|
|
463
392
|
// ------------------------------------------------------ reply settings
|
|
464
393
|
|
|
465
|
-
var
|
|
466
|
-
var AXIS_OPTIONS = ['enhanced', 'default', 'reduced']
|
|
394
|
+
var STYLE_OPTIONS = ['default', 'professional', 'friendly', 'blunt', 'follow']
|
|
467
395
|
|
|
468
396
|
function tr(t, key, fallback) {
|
|
469
397
|
if (t) {
|
|
@@ -515,7 +443,6 @@ window.__ModuleLoader__.load({
|
|
|
515
443
|
return h('option', { key: option.id, value: option.id }, option.label)
|
|
516
444
|
}))
|
|
517
445
|
|
|
518
|
-
if (props.compact === true) return control
|
|
519
446
|
|
|
520
447
|
return h('div', { className: 'wdxs-row' }, [
|
|
521
448
|
h('div', { key: 'text', className: 'wdxs-rowText' }, [
|
|
@@ -633,33 +560,27 @@ window.__ModuleLoader__.load({
|
|
|
633
560
|
})
|
|
634
561
|
}
|
|
635
562
|
|
|
636
|
-
var verbosityOptions = ['
|
|
563
|
+
var verbosityOptions = ['low', 'medium', 'high'].map(function (id) {
|
|
637
564
|
return { id: id, label: tr(t, 'reply.verbosity.' + id, id) }
|
|
638
565
|
})
|
|
639
|
-
var
|
|
640
|
-
var name = tr(t, 'reply.
|
|
566
|
+
var styleOptions = STYLE_OPTIONS.map(function (id) {
|
|
567
|
+
var name = tr(t, 'reply.style.' + id, id)
|
|
641
568
|
return {
|
|
642
569
|
id: id,
|
|
643
570
|
text: name,
|
|
644
571
|
label: h('span', { className: 'wdxs-item' }, [
|
|
645
572
|
h('span', { key: 'name', className: 'wdxs-itemName' }, name),
|
|
646
|
-
h('span', { key: 'desc', className: 'wdxs-itemDesc' }, tr(t, 'reply.
|
|
573
|
+
h('span', { key: 'desc', className: 'wdxs-itemDesc' }, tr(t, 'reply.style.option.' + id + '.desc', '')),
|
|
647
574
|
]),
|
|
648
575
|
}
|
|
649
576
|
})
|
|
650
|
-
var axisOptions = AXIS_OPTIONS.map(function (id) {
|
|
651
|
-
return { id: id, label: tr(t, 'reply.axis.' + id, id) }
|
|
652
|
-
})
|
|
653
577
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
value: value[field] || 'default',
|
|
661
|
-
onChange: function (next) { update(field, next) },
|
|
662
|
-
})
|
|
578
|
+
// 旧配置只有 writingStyle/baseStyle,没有 style;这里按同样的优先级显示。
|
|
579
|
+
var selectedStyle = value.style
|
|
580
|
+
if (selectedStyle === undefined) {
|
|
581
|
+
if (value.writingStyle === true) selectedStyle = 'follow'
|
|
582
|
+
else if (value.baseStyle === 'professional' || value.baseStyle === 'friendly' || value.baseStyle === 'blunt') selectedStyle = value.baseStyle
|
|
583
|
+
else selectedStyle = 'default'
|
|
663
584
|
}
|
|
664
585
|
|
|
665
586
|
return h('div', { className: 'wdxs-page' }, [
|
|
@@ -697,31 +618,14 @@ window.__ModuleLoader__.load({
|
|
|
697
618
|
value: value.actionable !== false,
|
|
698
619
|
onChange: function (next) { update('actionable', next) },
|
|
699
620
|
}),
|
|
700
|
-
h(ToggleRow, {
|
|
701
|
-
key: 'toggle',
|
|
702
|
-
title: tr(t, 'reply.writing.title', '参考我的写作风格'),
|
|
703
|
-
description: tr(t, 'reply.writing.description', ''),
|
|
704
|
-
value: value.writingStyle === true,
|
|
705
|
-
onChange: function (next) { update('writingStyle', next) },
|
|
706
|
-
}),
|
|
707
|
-
]),
|
|
708
|
-
|
|
709
|
-
h('div', { key: 'style', className: 'wdxs-group' }, [
|
|
710
|
-
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'reply.group.style', '基础风格和语气')),
|
|
711
621
|
h(SelectRow, {
|
|
712
|
-
key: '
|
|
713
|
-
title: tr(t, 'reply.
|
|
714
|
-
description: tr(t, 'reply.
|
|
715
|
-
options:
|
|
716
|
-
value:
|
|
717
|
-
onChange: function (next) { update('
|
|
622
|
+
key: 'style',
|
|
623
|
+
title: tr(t, 'reply.style.title', '回复风格'),
|
|
624
|
+
description: tr(t, 'reply.style.description', ''),
|
|
625
|
+
options: styleOptions,
|
|
626
|
+
value: selectedStyle,
|
|
627
|
+
onChange: function (next) { update('style', next) },
|
|
718
628
|
}),
|
|
719
|
-
h('div', { key: 'axisHead', className: 'wdxs-subHead' }, tr(t, 'reply.group.axis', '细节调整')),
|
|
720
|
-
axisRow('friendliness', 'reply.friendliness.title', 'reply.friendliness.description'),
|
|
721
|
-
axisRow('enthusiasm', 'reply.enthusiasm.title', 'reply.enthusiasm.description'),
|
|
722
|
-
axisRow('emoji', 'reply.emoji.title', 'reply.emoji.description'),
|
|
723
|
-
axisRow('visualAnswers', 'reply.visualAnswers.title', 'reply.visualAnswers.description'),
|
|
724
|
-
axisRow('headingsLists', 'reply.headingsLists.title', 'reply.headingsLists.description'),
|
|
725
629
|
]),
|
|
726
630
|
|
|
727
631
|
h(CustomInstructionsRow, {
|
package/docs/bundle-config.webp
CHANGED
|
Binary file
|
package/docs/guide.md
CHANGED
|
@@ -25,17 +25,13 @@ dsh plugin --profile web add link:/path/to/dsh-wdx-relief
|
|
|
25
25
|
| 字段 | 默认 | 说明 |
|
|
26
26
|
|---|---|---|
|
|
27
27
|
| `enabled` | `true` | 输入框预测开关 |
|
|
28
|
-
| `verbosity` | `low` | `
|
|
28
|
+
| `verbosity` | `low` | `low` / `medium` / `high`(旧值 `model` 仍兼容) |
|
|
29
29
|
| `actionable` | `true` | 便于行动:先结果/下一步、白话解释术语、保留风险 |
|
|
30
|
-
| `
|
|
31
|
-
| `baseStyle` | `default` | 7 个基础风格预设之一 |
|
|
32
|
-
| `friendliness` | `default` | `default` / `enhanced` / `reduced` |
|
|
33
|
-
| `enthusiasm` | `default` | 同上 |
|
|
34
|
-
| `emoji` | `default` | 同上 |
|
|
35
|
-
| `visualAnswers` | `default` | 同上 |
|
|
36
|
-
| `headingsLists` | `default` | 同上 |
|
|
30
|
+
| `style` | `default` | `default` / `professional` / `friendly` / `blunt` / `follow` |
|
|
37
31
|
| `customInstructions` | `''` | 最多 2000 字 |
|
|
38
32
|
|
|
33
|
+
旧版本的 `writingStyle` / `baseStyle` 仍保留在 schema 里做迁移:没有 `style` 时,`writingStyle: true` 映射为 `follow`,`baseStyle` 的 professional/friendly/blunt 映射到同名风格;设置页只写新的 `style`。
|
|
34
|
+
|
|
39
35
|
bundle 层只声明入口和预测开关,其余字段由 schema 默认值提供:
|
|
40
36
|
|
|
41
37
|
```yaml
|
|
@@ -77,13 +73,13 @@ Host 在 `ctx.systemPrompt` 注册:
|
|
|
77
73
|
|
|
78
74
|
## 实机验证记录(DSH 0.2.2-rc.1)
|
|
79
75
|
|
|
80
|
-
- 侧边栏「插件」→ **WDX Relief** bundle
|
|
81
|
-
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`
|
|
76
|
+
- 侧边栏「插件」→ **WDX Relief** bundle 页出现配置区:输入开关、回复长度、便于行动开关、回复风格、自定义指令;
|
|
77
|
+
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`actionable`、`style`、`customInstructions`;
|
|
82
78
|
- Settings 导航不再出现「回复」,General 不再出现预测行(已迁移到插件配置);
|
|
83
79
|
- 输入框灰字出现、打字隐藏、清空重现,Tab 真正写入 Lexical;
|
|
84
80
|
- 关闭预测开关后不再发预测请求;
|
|
85
81
|
- Host 日志确认预测路由与 `wdx-relief:reply-style` prompt section 注册成功;
|
|
86
|
-
-
|
|
82
|
+
- 27 个 Node 单测通过。
|
|
87
83
|
|
|
88
84
|
## 已知限制
|
|
89
85
|
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import Schema from '@deepseek-ai/schemastery'
|
|
12
12
|
import { createPredictionService } from './src/prediction.js'
|
|
13
|
-
import {
|
|
13
|
+
import { STYLE_VALUES, VERBOSITY_VALUES, buildStylePrompt } from './src/style.js'
|
|
14
14
|
|
|
15
15
|
export const name = 'wdx-relief'
|
|
16
16
|
|
|
@@ -32,19 +32,14 @@ export const Config = Schema.object({
|
|
|
32
32
|
.default(true)
|
|
33
33
|
.volatile()
|
|
34
34
|
.description('便于行动:先给结果和下一步,少铺垫,保留风险与失败条件'),
|
|
35
|
-
|
|
36
|
-
.default(false)
|
|
35
|
+
style: Schema.union(STYLE_VALUES)
|
|
37
36
|
.volatile()
|
|
38
|
-
.description('
|
|
39
|
-
|
|
37
|
+
.description('回复风格:default / professional / friendly / blunt / follow'),
|
|
38
|
+
/** 0.2.0 及更早版本的字段,仅用于旧配置迁移,界面不再展示。 */
|
|
39
|
+
writingStyle: Schema.boolean().default(false).volatile(),
|
|
40
|
+
baseStyle: Schema.union(['default', 'professional', 'friendly', 'blunt', 'imaginative', 'efficient', 'snarky'])
|
|
40
41
|
.default('default')
|
|
41
|
-
.volatile()
|
|
42
|
-
.description('整体风格与语气预设'),
|
|
43
|
-
friendliness: Schema.union(AXIS_VALUES).default('default').volatile().description('亲切程度'),
|
|
44
|
-
enthusiasm: Schema.union(AXIS_VALUES).default('default').volatile().description('热情程度'),
|
|
45
|
-
emoji: Schema.union(AXIS_VALUES).default('default').volatile().description('表情符号使用程度'),
|
|
46
|
-
visualAnswers: Schema.union(AXIS_VALUES).default('default').volatile().description('可视化回答程度'),
|
|
47
|
-
headingsLists: Schema.union(AXIS_VALUES).default('default').volatile().description('标题和列表使用程度'),
|
|
42
|
+
.volatile(),
|
|
48
43
|
customInstructions: Schema.string()
|
|
49
44
|
.default('')
|
|
50
45
|
.volatile()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wdx-relief",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Take the friction out of daily DSH work: predicted next messages in the composer, plus reply length, tone, and writing style controls.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/src/style.js
CHANGED
|
@@ -4,67 +4,25 @@
|
|
|
4
4
|
* 设计原则:
|
|
5
5
|
* - 只影响表达方式,不改变任务目标、事实准确性、工具权限和安全规则;
|
|
6
6
|
* - 默认项不写进 prompt,避免每轮都付无意义的 token;
|
|
7
|
-
* -
|
|
7
|
+
* - 风格之间互斥,长度与「便于行动」是独立的正交层,避免互相打架。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/** `model` 是旧版本的隐藏值,保留它以免旧配置校验失败;界面不再提供。 */
|
|
10
11
|
export const VERBOSITY_VALUES = ['model', 'low', 'medium', 'high']
|
|
11
|
-
export const AXIS_VALUES = ['default', 'enhanced', 'reduced']
|
|
12
|
-
export const BASE_STYLE_VALUES = [
|
|
13
|
-
'default',
|
|
14
|
-
'professional',
|
|
15
|
-
'friendly',
|
|
16
|
-
'blunt',
|
|
17
|
-
'imaginative',
|
|
18
|
-
'efficient',
|
|
19
|
-
'snarky',
|
|
20
|
-
]
|
|
21
12
|
|
|
22
|
-
export const
|
|
13
|
+
export const STYLE_VALUES = ['default', 'professional', 'friendly', 'blunt', 'follow']
|
|
23
14
|
|
|
24
15
|
const VERBOSITY_LINES = {
|
|
25
|
-
low: '
|
|
26
|
-
medium: '
|
|
27
|
-
high: '
|
|
16
|
+
low: '保持回复简短:先给结论和必要步骤,只保留关键原因;省略客套、复述和背景铺垫。除非用户明确要求展开。',
|
|
17
|
+
medium: '长度适中:给出结论和关键步骤,补充必要的边界与原因,省略无关铺垫。',
|
|
18
|
+
high: '回复可以更详细:解释原因、边界和取舍,必要时给出替代方案;不要重复和凑字数。',
|
|
28
19
|
}
|
|
29
20
|
|
|
30
|
-
const
|
|
21
|
+
const STYLE_LINES = {
|
|
31
22
|
professional: '专业可靠:用词精确、结构清晰,先结论后依据,避免口语化和夸张表达。',
|
|
32
23
|
friendly: '亲和友善:语气温和、有耐心,适当鼓励,避免生硬和居高临下。',
|
|
33
24
|
blunt: '直言不讳:直接指出问题、风险和取舍,不绕弯子,但保持尊重、不做人身攻击。',
|
|
34
|
-
|
|
35
|
-
efficient: '高效务实:用最短路径解决问题,少铺垫,多给可执行的动作和结果。',
|
|
36
|
-
snarky: '吐槽达人:可以犀利、幽默地吐槽,但不做人身攻击,不牺牲准确性和可执行性。',
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const AXIS_LINES = {
|
|
40
|
-
friendliness: {
|
|
41
|
-
enhanced: '更友好、更亲近,像熟悉的同事。',
|
|
42
|
-
reduced: '更专业、更事实性,减少寒暄和情绪表达。',
|
|
43
|
-
},
|
|
44
|
-
enthusiasm: {
|
|
45
|
-
enhanced: '更有活力、更热情,但不要浮夸。',
|
|
46
|
-
reduced: '更冷静、更中立,避免感叹和情绪渲染。',
|
|
47
|
-
},
|
|
48
|
-
emoji: {
|
|
49
|
-
enhanced: '可以适当使用表情符号来分隔语气,但不要过量。',
|
|
50
|
-
reduced: '尽量少用或不用表情符号。',
|
|
51
|
-
},
|
|
52
|
-
visualAnswers: {
|
|
53
|
-
enhanced: '适合时使用表格、图示或结构化对比来辅助理解。',
|
|
54
|
-
reduced: '优先使用段落文字,少用表格和图示。',
|
|
55
|
-
},
|
|
56
|
-
headingsLists: {
|
|
57
|
-
enhanced: '使用清晰的标题和列表结构组织信息。',
|
|
58
|
-
reduced: '更多使用段落文本,少用标题和列表。',
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const AXIS_LABELS = {
|
|
63
|
-
friendliness: '亲切程度',
|
|
64
|
-
enthusiasm: '热情程度',
|
|
65
|
-
emoji: '表情符号',
|
|
66
|
-
visualAnswers: '可视化回答',
|
|
67
|
-
headingsLists: '标题和列表',
|
|
25
|
+
follow: '跟随用户的写作风格:参考本对话中用户最近的表达方式,模仿其句式长短、用词习惯、正式或口语程度、解释术语的方式;只模仿风格,不复制内容,也不要刻意夸张。',
|
|
68
26
|
}
|
|
69
27
|
|
|
70
28
|
const ACTIONABLE_LINES = [
|
|
@@ -91,6 +49,19 @@ function oneOf(value, allowed) {
|
|
|
91
49
|
return typeof value === 'string' && allowed.includes(value) ? value : undefined
|
|
92
50
|
}
|
|
93
51
|
|
|
52
|
+
/**
|
|
53
|
+
* 兼容 0.2.0 及更早的字段:旧配置没有 `style` 时,用 `writingStyle` / `baseStyle` 推断。
|
|
54
|
+
* 新的界面只写 `style`。
|
|
55
|
+
*/
|
|
56
|
+
function resolveStyle(config) {
|
|
57
|
+
const explicit = oneOf(read(config, 'style', undefined), STYLE_VALUES)
|
|
58
|
+
if (explicit !== undefined) return explicit
|
|
59
|
+
if (read(config, 'writingStyle', false) === true) return 'follow'
|
|
60
|
+
const legacy = read(config, 'baseStyle', 'default')
|
|
61
|
+
if (legacy === 'professional' || legacy === 'friendly' || legacy === 'blunt') return legacy
|
|
62
|
+
return 'default'
|
|
63
|
+
}
|
|
64
|
+
|
|
94
65
|
/**
|
|
95
66
|
* 编译当前设置对应的 system prompt 段落。返回空字符串表示不追加任何内容。
|
|
96
67
|
* @param {object|undefined} config - 插件 Config(volatile 引用)
|
|
@@ -108,20 +79,9 @@ export function buildStylePrompt(config) {
|
|
|
108
79
|
lines.push(...ACTIONABLE_LINES)
|
|
109
80
|
}
|
|
110
81
|
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
lines.push(`-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
for (const field of AXIS_FIELDS) {
|
|
117
|
-
const value = oneOf(read(config, field, 'default'), AXIS_VALUES)
|
|
118
|
-
if (value === undefined || value === 'default') continue
|
|
119
|
-
lines.push(`- ${AXIS_LABELS[field]}:${AXIS_LINES[field][value]}`)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const writingStyle = read(config, 'writingStyle', false) === true
|
|
123
|
-
if (writingStyle) {
|
|
124
|
-
lines.push('- 参考用户在本对话中最近的表达方式:模仿其句式长短、用词习惯、正式或口语程度、以及解释术语的方式;只模仿风格,不复制内容,也不要刻意夸张。')
|
|
82
|
+
const style = resolveStyle(config)
|
|
83
|
+
if (style !== 'default') {
|
|
84
|
+
lines.push(`- ${STYLE_LINES[style]}`)
|
|
125
85
|
}
|
|
126
86
|
|
|
127
87
|
const custom = String(read(config, 'customInstructions', '') ?? '').trim().slice(0, MAX_CUSTOM_CHARS)
|
|
@@ -137,16 +97,10 @@ export function buildStylePrompt(config) {
|
|
|
137
97
|
].join('\n')
|
|
138
98
|
}
|
|
139
99
|
|
|
140
|
-
/**
|
|
100
|
+
/** 供测试与前端读取的默认值。 */
|
|
141
101
|
export const STYLE_DEFAULTS = {
|
|
142
102
|
verbosity: 'low',
|
|
143
103
|
actionable: true,
|
|
144
|
-
|
|
145
|
-
baseStyle: 'default',
|
|
146
|
-
friendliness: 'default',
|
|
147
|
-
enthusiasm: 'default',
|
|
148
|
-
emoji: 'default',
|
|
149
|
-
visualAnswers: 'default',
|
|
150
|
-
headingsLists: 'default',
|
|
104
|
+
style: 'default',
|
|
151
105
|
customInstructions: '',
|
|
152
|
-
}
|
|
106
|
+
}
|