dsh-wdx-relief 0.1.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 +11 -0
- package/README.md +2 -1
- package/client/client.js +58 -143
- package/docs/bundle-config.webp +0 -0
- package/docs/guide.md +12 -11
- package/index.js +11 -12
- package/package.json +1 -1
- package/src/style.js +38 -70
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
9
|
+
## 0.2.0 — 2026-11-09
|
|
10
|
+
|
|
11
|
+
- 新增「便于行动」输出模式(默认开启):先给结果/下一步、按内容比例组织、术语先用白话说明、保留风险与失败条件、不复述、不把已授权工作交回用户。规则改编自 `agent-configs-skills/skills/i-have-adhd`(MIT)。
|
|
12
|
+
- 设置页「写作」组新增「便于行动」开关;关闭后只保留长度、语气和自定义指令。
|
|
13
|
+
|
|
3
14
|
## 0.1.0 — 2026-11-09
|
|
4
15
|
|
|
5
16
|
首个公开版本。
|
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
## 功能
|
|
9
9
|
|
|
10
10
|
- **输入框下一句预测**:对话结束后用灰字猜你接下来要发的话,<kbd>Tab</kbd> 填入;打字隐藏,<kbd>Esc</kbd> 忽略。
|
|
11
|
-
-
|
|
11
|
+
- **回复风格**:长度 **短 / 标准 / 详细**;风格 **默认 / 专业 / 亲和 / 直接 / 跟随我的风格**;可加最多 2000 字的自定义指令。
|
|
12
|
+
- **便于行动**(默认开启):先给结果和下一步;能一句说清的不写一段,术语先用白话说明;保留风险、失败条件和已授权该做的工作。
|
|
12
13
|
|
|
13
14
|
## 安装
|
|
14
15
|
|
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,63 +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.
|
|
90
|
-
'reply.
|
|
91
|
-
'reply.
|
|
92
|
-
'reply.
|
|
93
|
-
'reply.
|
|
94
|
-
'reply.
|
|
95
|
-
'reply.
|
|
96
|
-
'reply.
|
|
97
|
-
'reply.
|
|
98
|
-
'reply.
|
|
99
|
-
'reply.
|
|
100
|
-
'reply.
|
|
101
|
-
'reply.
|
|
102
|
-
'reply.
|
|
103
|
-
'reply.base.option.friendly.desc': '温和健谈,有耐心',
|
|
104
|
-
'reply.base.option.blunt.desc': '直率指出问题与取舍',
|
|
105
|
-
'reply.base.option.imaginative.desc': '大胆、有想象力的方案',
|
|
106
|
-
'reply.base.option.efficient.desc': '简练直白,最短路径',
|
|
107
|
-
'reply.base.option.snarky.desc': '犀利幽默,不人身攻击',
|
|
108
|
-
'reply.group.axis': '细节调整',
|
|
109
|
-
'reply.axis.default': '默认',
|
|
110
|
-
'reply.axis.enhanced': '增强',
|
|
111
|
-
'reply.axis.reduced': '减弱',
|
|
112
|
-
'reply.friendliness.title': '亲切程度',
|
|
113
|
-
'reply.friendliness.description': '回复的友好与亲近程度',
|
|
114
|
-
'reply.friendliness.enhanced': '更友好、更亲近',
|
|
115
|
-
'reply.friendliness.reduced': '更专业、事实性更强',
|
|
116
|
-
'reply.enthusiasm.title': '热情程度',
|
|
117
|
-
'reply.enthusiasm.description': '回复的活力与热情',
|
|
118
|
-
'reply.enthusiasm.enhanced': '更加活力充沛',
|
|
119
|
-
'reply.enthusiasm.reduced': '更加冷静中立',
|
|
120
|
-
'reply.emoji.title': '表情符号',
|
|
121
|
-
'reply.emoji.description': '回复中表情符号的使用程度',
|
|
122
|
-
'reply.emoji.enhanced': '适当使用表情符号',
|
|
123
|
-
'reply.emoji.reduced': '尽量少用表情符号',
|
|
124
|
-
'reply.visualAnswers.title': '可视化回答',
|
|
125
|
-
'reply.visualAnswers.description': '表格、图示等结构化表达的使用程度',
|
|
126
|
-
'reply.visualAnswers.enhanced': '更多使用可视化结构',
|
|
127
|
-
'reply.visualAnswers.reduced': '优先使用段落文字',
|
|
128
|
-
'reply.headingsLists.title': '标题和列表',
|
|
129
|
-
'reply.headingsLists.description': '标题和列表结构的使用程度',
|
|
130
|
-
'reply.headingsLists.enhanced': '采用清晰格式与列表结构',
|
|
131
|
-
'reply.headingsLists.reduced': '更多段落文本,而非列表结构',
|
|
80
|
+
'reply.verbosity.low': '短',
|
|
81
|
+
'reply.verbosity.medium': '标准',
|
|
82
|
+
'reply.verbosity.high': '详细',
|
|
83
|
+
'reply.actionable.title': '便于行动',
|
|
84
|
+
'reply.actionable.description': '先给结果和下一步,少铺垫;能一句话说清就不展开,术语先用白话说明',
|
|
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': '模仿你在这段对话里的句式与用词',
|
|
132
97
|
'reply.custom.title': '自定义指令',
|
|
133
|
-
'reply.custom.description': '
|
|
98
|
+
'reply.custom.description': '补充只影响回复表达的指令,优先级高于上面的长度和风格',
|
|
134
99
|
'reply.custom.placeholder': '例如:先给结论;用中文解释术语;不要使用「首先/其次」。',
|
|
135
100
|
'reply.saved': '已保存',
|
|
136
101
|
'reply.saveError': '保存失败,请重试',
|
|
@@ -141,63 +106,31 @@ window.__ModuleLoader__.load({
|
|
|
141
106
|
}
|
|
142
107
|
|
|
143
108
|
var en = {
|
|
144
|
-
'reply.nav': 'Replies',
|
|
145
109
|
'reply.intro': 'These preferences shape expression only. They do not change goals, facts, or tool permissions.',
|
|
146
110
|
'reply.group.input': 'Input',
|
|
147
111
|
'reply.group.length': 'Reply length',
|
|
148
112
|
'reply.group.writing': 'Writing',
|
|
149
|
-
'reply.group.style': 'Base style and tone',
|
|
150
|
-
'reply.group.custom': 'Custom instructions',
|
|
151
113
|
'reply.verbosity.title': 'Output detail',
|
|
152
114
|
'reply.verbosity.description': 'How much detail replies should include',
|
|
153
|
-
'reply.verbosity.
|
|
154
|
-
'reply.verbosity.
|
|
155
|
-
'reply.verbosity.
|
|
156
|
-
'reply.
|
|
157
|
-
'reply.
|
|
158
|
-
'reply.
|
|
159
|
-
'reply.
|
|
160
|
-
'reply.
|
|
161
|
-
'reply.
|
|
162
|
-
'reply.
|
|
163
|
-
'reply.
|
|
164
|
-
'reply.
|
|
165
|
-
'reply.
|
|
166
|
-
'reply.
|
|
167
|
-
'reply.
|
|
168
|
-
'reply.
|
|
169
|
-
'reply.
|
|
170
|
-
'reply.base.option.friendly.desc': 'Warm, patient, approachable',
|
|
171
|
-
'reply.base.option.blunt.desc': 'Direct about problems and tradeoffs',
|
|
172
|
-
'reply.base.option.imaginative.desc': 'Bold, imaginative options',
|
|
173
|
-
'reply.base.option.efficient.desc': 'Terse and action-oriented',
|
|
174
|
-
'reply.base.option.snarky.desc': 'Sharp humor without personal attacks',
|
|
175
|
-
'reply.group.axis': 'Fine-tuning',
|
|
176
|
-
'reply.axis.default': 'Default',
|
|
177
|
-
'reply.axis.enhanced': 'More',
|
|
178
|
-
'reply.axis.reduced': 'Less',
|
|
179
|
-
'reply.friendliness.title': 'Friendliness',
|
|
180
|
-
'reply.friendliness.description': 'How warm and approachable replies feel',
|
|
181
|
-
'reply.friendliness.enhanced': 'Warmer and closer',
|
|
182
|
-
'reply.friendliness.reduced': 'More factual and professional',
|
|
183
|
-
'reply.enthusiasm.title': 'Enthusiasm',
|
|
184
|
-
'reply.enthusiasm.description': 'How energetic replies feel',
|
|
185
|
-
'reply.enthusiasm.enhanced': 'More energetic',
|
|
186
|
-
'reply.enthusiasm.reduced': 'Calmer and more neutral',
|
|
187
|
-
'reply.emoji.title': 'Emoji',
|
|
188
|
-
'reply.emoji.description': 'How often replies use emoji',
|
|
189
|
-
'reply.emoji.enhanced': 'Use emoji when appropriate',
|
|
190
|
-
'reply.emoji.reduced': 'Avoid emoji',
|
|
191
|
-
'reply.visualAnswers.title': 'Visual answers',
|
|
192
|
-
'reply.visualAnswers.description': 'How often replies use tables and diagrams',
|
|
193
|
-
'reply.visualAnswers.enhanced': 'More tables and diagrams',
|
|
194
|
-
'reply.visualAnswers.reduced': 'Prefer prose',
|
|
195
|
-
'reply.headingsLists.title': 'Headings and lists',
|
|
196
|
-
'reply.headingsLists.description': 'How often replies use headings and lists',
|
|
197
|
-
'reply.headingsLists.enhanced': 'Clear headings and lists',
|
|
198
|
-
'reply.headingsLists.reduced': 'More prose, fewer lists',
|
|
115
|
+
'reply.verbosity.low': 'Short',
|
|
116
|
+
'reply.verbosity.medium': 'Standard',
|
|
117
|
+
'reply.verbosity.high': 'Detailed',
|
|
118
|
+
'reply.actionable.title': 'Actionable replies',
|
|
119
|
+
'reply.actionable.description': 'Lead with the result and next step; explain jargon in plain language; keep risks and failure conditions',
|
|
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',
|
|
199
132
|
'reply.custom.title': 'Custom instructions',
|
|
200
|
-
'reply.custom.description': 'Extra instructions about expression
|
|
133
|
+
'reply.custom.description': 'Extra instructions about expression; override the length and style settings above',
|
|
201
134
|
'reply.custom.placeholder': 'e.g. Lead with the conclusion; explain terms in one Chinese sentence; avoid "firstly/secondly".',
|
|
202
135
|
'reply.saved': 'Saved',
|
|
203
136
|
'reply.saveError': 'Could not save. Try again.',
|
|
@@ -458,8 +391,7 @@ window.__ModuleLoader__.load({
|
|
|
458
391
|
|
|
459
392
|
// ------------------------------------------------------ reply settings
|
|
460
393
|
|
|
461
|
-
var
|
|
462
|
-
var AXIS_OPTIONS = ['enhanced', 'default', 'reduced']
|
|
394
|
+
var STYLE_OPTIONS = ['default', 'professional', 'friendly', 'blunt', 'follow']
|
|
463
395
|
|
|
464
396
|
function tr(t, key, fallback) {
|
|
465
397
|
if (t) {
|
|
@@ -511,7 +443,6 @@ window.__ModuleLoader__.load({
|
|
|
511
443
|
return h('option', { key: option.id, value: option.id }, option.label)
|
|
512
444
|
}))
|
|
513
445
|
|
|
514
|
-
if (props.compact === true) return control
|
|
515
446
|
|
|
516
447
|
return h('div', { className: 'wdxs-row' }, [
|
|
517
448
|
h('div', { key: 'text', className: 'wdxs-rowText' }, [
|
|
@@ -629,33 +560,27 @@ window.__ModuleLoader__.load({
|
|
|
629
560
|
})
|
|
630
561
|
}
|
|
631
562
|
|
|
632
|
-
var verbosityOptions = ['
|
|
563
|
+
var verbosityOptions = ['low', 'medium', 'high'].map(function (id) {
|
|
633
564
|
return { id: id, label: tr(t, 'reply.verbosity.' + id, id) }
|
|
634
565
|
})
|
|
635
|
-
var
|
|
636
|
-
var name = tr(t, 'reply.
|
|
566
|
+
var styleOptions = STYLE_OPTIONS.map(function (id) {
|
|
567
|
+
var name = tr(t, 'reply.style.' + id, id)
|
|
637
568
|
return {
|
|
638
569
|
id: id,
|
|
639
570
|
text: name,
|
|
640
571
|
label: h('span', { className: 'wdxs-item' }, [
|
|
641
572
|
h('span', { key: 'name', className: 'wdxs-itemName' }, name),
|
|
642
|
-
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', '')),
|
|
643
574
|
]),
|
|
644
575
|
}
|
|
645
576
|
})
|
|
646
|
-
var axisOptions = AXIS_OPTIONS.map(function (id) {
|
|
647
|
-
return { id: id, label: tr(t, 'reply.axis.' + id, id) }
|
|
648
|
-
})
|
|
649
577
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
value: value[field] || 'default',
|
|
657
|
-
onChange: function (next) { update(field, next) },
|
|
658
|
-
})
|
|
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'
|
|
659
584
|
}
|
|
660
585
|
|
|
661
586
|
return h('div', { className: 'wdxs-page' }, [
|
|
@@ -687,30 +612,20 @@ window.__ModuleLoader__.load({
|
|
|
687
612
|
h('div', { key: 'writing', className: 'wdxs-group' }, [
|
|
688
613
|
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'reply.group.writing', '写作')),
|
|
689
614
|
h(ToggleRow, {
|
|
690
|
-
key: '
|
|
691
|
-
title: tr(t, 'reply.
|
|
692
|
-
description: tr(t, 'reply.
|
|
693
|
-
value: value.
|
|
694
|
-
onChange: function (next) { update('
|
|
615
|
+
key: 'actionable',
|
|
616
|
+
title: tr(t, 'reply.actionable.title', '便于行动'),
|
|
617
|
+
description: tr(t, 'reply.actionable.description', ''),
|
|
618
|
+
value: value.actionable !== false,
|
|
619
|
+
onChange: function (next) { update('actionable', next) },
|
|
695
620
|
}),
|
|
696
|
-
]),
|
|
697
|
-
|
|
698
|
-
h('div', { key: 'style', className: 'wdxs-group' }, [
|
|
699
|
-
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'reply.group.style', '基础风格和语气')),
|
|
700
621
|
h(SelectRow, {
|
|
701
|
-
key: '
|
|
702
|
-
title: tr(t, 'reply.
|
|
703
|
-
description: tr(t, 'reply.
|
|
704
|
-
options:
|
|
705
|
-
value:
|
|
706
|
-
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) },
|
|
707
628
|
}),
|
|
708
|
-
h('div', { key: 'axisHead', className: 'wdxs-subHead' }, tr(t, 'reply.group.axis', '细节调整')),
|
|
709
|
-
axisRow('friendliness', 'reply.friendliness.title', 'reply.friendliness.description'),
|
|
710
|
-
axisRow('enthusiasm', 'reply.enthusiasm.title', 'reply.enthusiasm.description'),
|
|
711
|
-
axisRow('emoji', 'reply.emoji.title', 'reply.emoji.description'),
|
|
712
|
-
axisRow('visualAnswers', 'reply.visualAnswers.title', 'reply.visualAnswers.description'),
|
|
713
|
-
axisRow('headingsLists', 'reply.headingsLists.title', 'reply.headingsLists.description'),
|
|
714
629
|
]),
|
|
715
630
|
|
|
716
631
|
h(CustomInstructionsRow, {
|
package/docs/bundle-config.webp
CHANGED
|
Binary file
|
package/docs/guide.md
CHANGED
|
@@ -25,16 +25,13 @@ dsh plugin --profile web add link:/path/to/dsh-wdx-relief
|
|
|
25
25
|
| 字段 | 默认 | 说明 |
|
|
26
26
|
|---|---|---|
|
|
27
27
|
| `enabled` | `true` | 输入框预测开关 |
|
|
28
|
-
| `verbosity` | `low` | `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `friendliness` | `default` | `default` / `enhanced` / `reduced` |
|
|
32
|
-
| `enthusiasm` | `default` | 同上 |
|
|
33
|
-
| `emoji` | `default` | 同上 |
|
|
34
|
-
| `visualAnswers` | `default` | 同上 |
|
|
35
|
-
| `headingsLists` | `default` | 同上 |
|
|
28
|
+
| `verbosity` | `low` | `low` / `medium` / `high`(旧值 `model` 仍兼容) |
|
|
29
|
+
| `actionable` | `true` | 便于行动:先结果/下一步、白话解释术语、保留风险 |
|
|
30
|
+
| `style` | `default` | `default` / `professional` / `friendly` / `blunt` / `follow` |
|
|
36
31
|
| `customInstructions` | `''` | 最多 2000 字 |
|
|
37
32
|
|
|
33
|
+
旧版本的 `writingStyle` / `baseStyle` 仍保留在 schema 里做迁移:没有 `style` 时,`writingStyle: true` 映射为 `follow`,`baseStyle` 的 professional/friendly/blunt 映射到同名风格;设置页只写新的 `style`。
|
|
34
|
+
|
|
38
35
|
bundle 层只声明入口和预测开关,其余字段由 schema 默认值提供:
|
|
39
36
|
|
|
40
37
|
```yaml
|
|
@@ -70,15 +67,19 @@ Host 在 `ctx.systemPrompt` 注册:
|
|
|
70
67
|
`buildStylePrompt` 只输出非默认项,并加一段“只影响表达方式”的前缀。自定义指令最多 2000 字;
|
|
71
68
|
`interpolate: false` 让其中的 `{{...}}` 保持字面量,避免 prompt 装配报错。
|
|
72
69
|
|
|
70
|
+
「便于行动」规则改编自 `agent-configs-skills/skills/i-have-adhd`(MIT):开头给结果/下一步、
|
|
71
|
+
按内容比例组织(句 > 段 > 清单)、术语先用白话说明、保留风险与失败条件、不复述、
|
|
72
|
+
不把已获授权的工作交回用户。
|
|
73
|
+
|
|
73
74
|
## 实机验证记录(DSH 0.2.2-rc.1)
|
|
74
75
|
|
|
75
|
-
- 侧边栏「插件」→ **WDX Relief** bundle
|
|
76
|
-
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`
|
|
76
|
+
- 侧边栏「插件」→ **WDX Relief** bundle 页出现配置区:输入开关、回复长度、便于行动开关、回复风格、自定义指令;
|
|
77
|
+
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`actionable`、`style`、`customInstructions`;
|
|
77
78
|
- Settings 导航不再出现「回复」,General 不再出现预测行(已迁移到插件配置);
|
|
78
79
|
- 输入框灰字出现、打字隐藏、清空重现,Tab 真正写入 Lexical;
|
|
79
80
|
- 关闭预测开关后不再发预测请求;
|
|
80
81
|
- Host 日志确认预测路由与 `wdx-relief:reply-style` prompt section 注册成功;
|
|
81
|
-
-
|
|
82
|
+
- 27 个 Node 单测通过。
|
|
82
83
|
|
|
83
84
|
## 已知限制
|
|
84
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
|
|
|
@@ -28,19 +28,18 @@ export const Config = Schema.object({
|
|
|
28
28
|
.default('low')
|
|
29
29
|
.volatile()
|
|
30
30
|
.description('回复详细程度:model 表示不干预,low/medium/high 为固定偏好'),
|
|
31
|
-
|
|
32
|
-
.default(
|
|
31
|
+
actionable: Schema.boolean()
|
|
32
|
+
.default(true)
|
|
33
33
|
.volatile()
|
|
34
|
-
.description('
|
|
35
|
-
|
|
36
|
-
.default('default')
|
|
34
|
+
.description('便于行动:先给结果和下一步,少铺垫,保留风险与失败条件'),
|
|
35
|
+
style: Schema.union(STYLE_VALUES)
|
|
37
36
|
.volatile()
|
|
38
|
-
.description('
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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'])
|
|
41
|
+
.default('default')
|
|
42
|
+
.volatile(),
|
|
44
43
|
customInstructions: Schema.string()
|
|
45
44
|
.default('')
|
|
46
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,68 +4,35 @@
|
|
|
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
|
-
},
|
|
25
|
+
follow: '跟随用户的写作风格:参考本对话中用户最近的表达方式,模仿其句式长短、用词习惯、正式或口语程度、解释术语的方式;只模仿风格,不复制内容,也不要刻意夸张。',
|
|
60
26
|
}
|
|
61
27
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
28
|
+
const ACTIONABLE_LINES = [
|
|
29
|
+
'- 便于行动:开头直接给结果或最相关的下一步,不写「好的」「我来看看」之类铺垫;需要用户操作时,把命令、路径或决定放在显眼位置。',
|
|
30
|
+
'- 能一句话说清的,不写成一段;能一段说清的,不列成清单;多步操作用短编号列表,一步对应一个可完成动作;次要信息放后面。',
|
|
31
|
+
'- 不用复杂名词堆砌代替解释:必须使用术语时,先用一句白话说明它是什么、为什么重要。',
|
|
32
|
+
'- 重要细节、风险和失败条件不因精简而省略;出错时直接说症状、已知原因和下一步。',
|
|
33
|
+
'- 不复述用户已说过或上一轮结论;长任务或中断后,用一句话说明已完成什么、当前卡在哪里。',
|
|
34
|
+
'- 已获授权且工具可执行时直接完成,不把本可代办的工作交回用户;全部完成后自然结束。',
|
|
35
|
+
]
|
|
69
36
|
|
|
70
37
|
const MAX_CUSTOM_CHARS = 2000
|
|
71
38
|
|
|
@@ -82,6 +49,19 @@ function oneOf(value, allowed) {
|
|
|
82
49
|
return typeof value === 'string' && allowed.includes(value) ? value : undefined
|
|
83
50
|
}
|
|
84
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
|
+
|
|
85
65
|
/**
|
|
86
66
|
* 编译当前设置对应的 system prompt 段落。返回空字符串表示不追加任何内容。
|
|
87
67
|
* @param {object|undefined} config - 插件 Config(volatile 引用)
|
|
@@ -95,20 +75,13 @@ export function buildStylePrompt(config) {
|
|
|
95
75
|
lines.push(`- ${VERBOSITY_LINES[verbosity]}`)
|
|
96
76
|
}
|
|
97
77
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
lines.push(`- 基础风格:${BASE_STYLE_LINES[base]}`)
|
|
78
|
+
if (read(config, 'actionable', true) === true) {
|
|
79
|
+
lines.push(...ACTIONABLE_LINES)
|
|
101
80
|
}
|
|
102
81
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
lines.push(`- ${AXIS_LABELS[field]}:${AXIS_LINES[field][value]}`)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const writingStyle = read(config, 'writingStyle', false) === true
|
|
110
|
-
if (writingStyle) {
|
|
111
|
-
lines.push('- 参考用户在本对话中最近的表达方式:模仿其句式长短、用词习惯、正式或口语程度、以及解释术语的方式;只模仿风格,不复制内容,也不要刻意夸张。')
|
|
82
|
+
const style = resolveStyle(config)
|
|
83
|
+
if (style !== 'default') {
|
|
84
|
+
lines.push(`- ${STYLE_LINES[style]}`)
|
|
112
85
|
}
|
|
113
86
|
|
|
114
87
|
const custom = String(read(config, 'customInstructions', '') ?? '').trim().slice(0, MAX_CUSTOM_CHARS)
|
|
@@ -124,15 +97,10 @@ export function buildStylePrompt(config) {
|
|
|
124
97
|
].join('\n')
|
|
125
98
|
}
|
|
126
99
|
|
|
127
|
-
/**
|
|
100
|
+
/** 供测试与前端读取的默认值。 */
|
|
128
101
|
export const STYLE_DEFAULTS = {
|
|
129
102
|
verbosity: 'low',
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
friendliness: 'default',
|
|
133
|
-
enthusiasm: 'default',
|
|
134
|
-
emoji: 'default',
|
|
135
|
-
visualAnswers: 'default',
|
|
136
|
-
headingsLists: 'default',
|
|
103
|
+
actionable: true,
|
|
104
|
+
style: 'default',
|
|
137
105
|
customInstructions: '',
|
|
138
|
-
}
|
|
106
|
+
}
|