dsh-direct-human-style 0.0.0-stage → 0.1.3
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/LICENSE +22 -0
- package/README.md +88 -2
- package/analyze.js +338 -0
- package/cordis.patch.yml +6 -0
- package/icon.svg +16 -0
- package/index.js +224 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +49 -4
- package/prompt.js +38 -0
- package/rules.js +158 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 歸藏 (upstream Humanizer-zh, https://github.com/op7418/Humanizer-zh)
|
|
4
|
+
Copyright (c) 2026 pseudonymzjt
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-direct-human-style
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
常驻文风约束插件,给 DeepSeek Harness 用。一轮对话开始时把一份直白文风契约写进系统提示词,并配两个按需调用的工具:一个扫描稿子,一个查清单全文。
|
|
4
|
+
|
|
5
|
+
An always-on prose contract for DeepSeek Harness: one system-prompt section applied to every turn, plus `humanize_check` (pattern and rhythm scan) and `humanize_rules` (the long-form lists, pulled only when needed). Zero runtime dependencies.
|
|
6
|
+
|
|
7
|
+
## 为什么常驻而不是按需
|
|
8
|
+
|
|
9
|
+
写作风格约束只有在每轮都生效时才有意义。按需触发的 skill 要用户先说「帮我润色」,模型才想起规则;那时候稿子已经写完、AI 腔已经落地。这个插件在 order 100(persona 之后、工具段落之前)挂一段 1449 字符的契约,默认对所有对话生效。
|
|
10
|
+
|
|
11
|
+
代价是每轮多花约 1010 tokens。所以长清单不放进提示词,放工具后面。
|
|
12
|
+
|
|
13
|
+
## 装了什么
|
|
14
|
+
|
|
15
|
+
**常驻提示词段。** 七条原则:结论先行、直接说是什么、该下判断就下、去掉元话语、具体压抽象、句长自然交替、长度跟着信息走。加必删套话表、必拆句式表、英文镜像和例外条款(纯代码、引文、法条、错误日志不动)。
|
|
16
|
+
|
|
17
|
+
**`humanize_check`。** 58 条规则(中文 45、英文 13)分八组:平行否定、元话语、伪严谨、套话收尾、抽象大词、拔高、借权威、中文冗余。输入一段文本,返回命中位置、类别和改法,外加统计指标:破折号密度、加粗占比、列表占比、平均句长、段落长度变异系数。纯文本(Notion、网页抽取)里没有任何 Markdown 标记时,格式类指标会单独标注为不可信。判两轴取重的一轴。词级:严重度按 3/2/1 加权,除以「字数/300」(下限 8,避免长文被稀释成 clean)。结构级:序数骨架、标签冒号开头、短句先行、对称否定这四项按绝对条数给分,不随长度衰减。两轴取最大值判四档:`clean` / `mostly clean` / `some templating`(≥4)/ `heavily templated`(≥9)。命中是线索不是判决书,报告里会注明。
|
|
18
|
+
|
|
19
|
+
**`humanize_rules`。** 取清单全文,四份:
|
|
20
|
+
|
|
21
|
+
| part | 内容 |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `direct` | 全局直白风格七条原则与替换示例 |
|
|
24
|
+
| `gpt` | GPT 腔调 16 条(英文模型特征与中文对应) |
|
|
25
|
+
| `deepseek` | DeepSeek 腔调 20 条(中文模型特征) |
|
|
26
|
+
| `checkpoints` | A–F 31 个检查点,改别人稿子时用 |
|
|
27
|
+
| `all` | 四份拼接 |
|
|
28
|
+
|
|
29
|
+
## 安装
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
dsh plugin --profile desktop add github:pseudonymzjt/dsh-direct-human-style
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
本地开发挂目录:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile desktop add "link:D:\path\to\dsh-direct-human-style"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
装完重载 profile。插件列表里显示「直白文风 Direct Human Style」。
|
|
42
|
+
|
|
43
|
+
## 配置
|
|
44
|
+
|
|
45
|
+
`cordis.patch.yml` 里可传:
|
|
46
|
+
|
|
47
|
+
| 键 | 默认 | 说明 |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| `enabled` | `true` | 关掉整段注入与工具 |
|
|
50
|
+
| `order` | `100` | 提示词段排序 |
|
|
51
|
+
| `registerTools` | `true` | 只留提示词、不注册工具 |
|
|
52
|
+
| `extraBanned` | `[]` | 追加到提示词末尾的禁用表达 |
|
|
53
|
+
|
|
54
|
+
## 目录
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
index.js 插件入口:注册提示词段与两个工具
|
|
58
|
+
prompt.js 常驻提示词文本
|
|
59
|
+
rules.js 四份清单全文(硬编码,不读 markdown)
|
|
60
|
+
analyze.js 扫描器:正则规则 + 统计指标
|
|
61
|
+
locale/{en,zh}.json 插件列表里的标题与描述
|
|
62
|
+
icon.svg 图标
|
|
63
|
+
cordis.patch.yml bundle patch
|
|
64
|
+
selftest.mjs 开发自测,不随包发布
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 自测
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
node selftest.mjs
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
跑脏中文、干净中文、英文三组样本,加四份清单长度检查。
|
|
74
|
+
|
|
75
|
+
## 规则来源
|
|
76
|
+
|
|
77
|
+
- A–F 31 个检查点来自 [Humanizer-zh](https://github.com/op7418/Humanizer-zh)(MIT,Copyright (c) 2026 歸藏),本插件把它的编辑逻辑提炼成常驻契约。
|
|
78
|
+
- GPT 腔调清单依据 [Wikipedia:Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing)。
|
|
79
|
+
- DeepSeek 与中文腔调清单依据 [中文维基:AI生成文的特征](https://zh.wikipedia.org/wiki/Wikipedia:AI%E7%94%9F%E6%88%90%E6%96%87%E7%9A%84%E7%89%B9%E5%BE%B5),并参考中文写作社区对「AI 味」的归纳。
|
|
80
|
+
|
|
81
|
+
## 实现说明
|
|
82
|
+
|
|
83
|
+
零依赖。刻意不 import `@deepseek-ai/dsh-tools`:以 link 方式安装的 bundle 没有自己的 `node_modules`,裸导入宿主包会抛 `ERR_MODULE_NOT_FOUND`,而且失败是静默的——工具不注册、插件不报错。`index.js` 里的 `makeTool` 自己做了参数校验,覆盖 `required` / `string` / `integer` / `array` / `enum`。
|
|
84
|
+
|
|
85
|
+
`rules.js` 是硬编码文本,与上游 markdown 分开维护。改了清单要同步到 `rules.js`,`selftest.mjs` 打印的四份字符数用来发现漏同步。
|
|
86
|
+
|
|
87
|
+
## 许可
|
|
88
|
+
|
|
89
|
+
MIT。上游 Humanizer-zh 同为 MIT,版权归 歸藏;见 [LICENSE](LICENSE)。
|
package/analyze.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule engine behind the humanize_check tool.
|
|
3
|
+
*
|
|
4
|
+
* The table is a set of leads, not a blacklist: every hit is reported with the
|
|
5
|
+
* matched excerpt so the caller can decide from context whether it carries
|
|
6
|
+
* independent information. Statistics (dash count, bold ratio, sentence
|
|
7
|
+
* length, paragraph uniformity) are reported next to the pattern hits because
|
|
8
|
+
* they are the tells a word list can never catch.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const SEVERITY = { high: 3, mid: 2, low: 1 }
|
|
12
|
+
|
|
13
|
+
/** @typedef {{ id: string, group: string, re: RegExp, advice: string, sev: 'high'|'mid'|'low' }} Rule */
|
|
14
|
+
|
|
15
|
+
/** @type {Rule[]} */
|
|
16
|
+
const CN_RULES = [
|
|
17
|
+
// 铺垫与否定
|
|
18
|
+
{ id: 'cn-not-x-but-y', group: '平行否定', sev: 'high', re: /不是[^,。!?\n]{1,30}[,,]\s*(而|反而)?是/g, advice: '直接说正面断言,删掉否定铺垫' },
|
|
19
|
+
{ id: 'cn-neither', group: '平行否定', sev: 'high', re: /不能(认为|当作|说)[^。\n]{0,40}(也不能|也不能当作|也不应)/g, advice: '给出一个确定判断,不要双向免责' },
|
|
20
|
+
{ id: 'cn-not-need-either', group: '平行否定', sev: 'high', re: /不需要[^。\n]{0,25}(也不需要|也无须|也无需)/g, advice: '说明实际需要什么' },
|
|
21
|
+
{ id: 'cn-rather-than', group: '平行否定', sev: 'high', re: /与其说[^。\n]{0,30}(不如|毋宁)说/g, advice: '直接说结论' },
|
|
22
|
+
{ id: 'cn-not-only', group: '平行否定', sev: 'mid', re: /不仅[^。\n]{0,30}(更是|更|而且|还)[^。\n]{0,20}/g, advice: '拆成两句,或只留信息量大的那一半' },
|
|
23
|
+
{ id: 'cn-from-to', group: '平行否定', sev: 'mid', re: /从[^。\n]{1,15}?到[^。\n]{1,15}?再到/g, advice: '三段递进是模板,只留有信息的那一段' },
|
|
24
|
+
|
|
25
|
+
// 元话语
|
|
26
|
+
{ id: 'cn-meta-judgement', group: '元话语', sev: 'high', re: /我想(提出|说|强调)一个?[^。\n]{0,10}/g, advice: '删掉引导语,直接写判断' },
|
|
27
|
+
{ id: 'cn-meta-advise', group: '元话语', sev: 'mid', re: /我(建议|想|打算|认为应该)|我不(想|打算|建议)/g, advice: '改成动作句,例如「先排查网络延迟」' },
|
|
28
|
+
{ id: 'cn-meta-plain', group: '元话语', sev: 'mid', re: /说白了|本质上(就)?是|说到底|归根结底/g, advice: '这是铺垫,删掉直接说事' },
|
|
29
|
+
{ id: 'cn-meta-realize', group: '元话语', sev: 'mid', re: /我们(需要|必须)(认识到|意识到|明确)/g, advice: '直接陈述事实或动作' },
|
|
30
|
+
{ id: 'cn-meta-look', group: '元话语', sev: 'mid', re: /让我们(来)?(一起)?(看看|深入|探讨|了解)|接下来我们(来看|讨论)/g, advice: '删掉预告,直接给内容' },
|
|
31
|
+
|
|
32
|
+
// 伪严谨
|
|
33
|
+
{ id: 'cn-note-worth', group: '伪严谨', sev: 'high', re: /(值得|需要)注意的?是|值得一提的是|需要指出的是|必须指出的?是/g, advice: '删掉,直接说这件事本身' },
|
|
34
|
+
{ id: 'cn-hedge-maybe', group: '伪严谨', sev: 'high', re: /或许未必|也许未必|(还|尚)不能(得出)?结论|有待进一步(观察|验证)[^。\n]{0,10}/g, advice: '缺数据就点明缺哪个指标或哪次测试' },
|
|
35
|
+
{ id: 'cn-hedge-degree', group: '伪严谨', sev: 'mid', re: /在某种程度上|一定程度上|客观(地)?(讲|说)|平心而论|相对而言(?=,)/g, advice: '给出校准过的判断,删掉程度状语' },
|
|
36
|
+
{ id: 'cn-hedge-dialectic', group: '伪严谨', sev: 'mid', re: /既要[^。\n]{0,20}又要|既[^。\n]{0,12}又(要|想|能|得)/g, advice: '如果有一方更重,直接说哪一方' },
|
|
37
|
+
{ id: 'cn-hedge-dialectic-b', group: '伪严谨', sev: 'mid', re: /一方面[^。\n]{0,30}另一方面/g, advice: '如果有一方更重,直接说哪一方' },
|
|
38
|
+
|
|
39
|
+
// 套话与收尾
|
|
40
|
+
{ id: 'cn-conclusion', group: '套话收尾', sev: 'high', re: /综上所述|总而言之|总的来说|由此可见|一言以蔽之|综上,/g, advice: '删掉收尾句,正文写完就停' },
|
|
41
|
+
{ id: 'cn-service-close', group: '套话收尾', sev: 'high', re: /希望(这|以上)?(对你|对您)?(能|可以)?(有所)?(帮助|帮到你)|如(需|有)(进一步|更多|其他)|欢迎随时(交流|联系|提问)|(还|你|您)有其他问题|如果你还有(其他)?问题/g, advice: '客服腔,删掉' },
|
|
42
|
+
{ id: 'cn-great-question', group: '套话收尾', sev: 'high', re: /(这是一个|这是个)(很好|非常好|不错)的?问题|好问题|感谢(您的?)?(提问|阅读|关注)/g, advice: '删掉开场客套,第一句给答案' },
|
|
43
|
+
{ id: 'cn-era-open', group: '套话收尾', sev: 'high', re: /随着[^。\n]{0,20}的(不断)?(发展|进步|普及|推进)|在(当今|当前)?[^。\n]{0,15}(的)?(时代)?背景下|在(这个|当今)[^。\n]{0,10}(时代|社会)|在[^。\n]{0,12}的今天/g, advice: '背景没有独立信息就删掉,直接说事' },
|
|
44
|
+
|
|
45
|
+
// 抽象词
|
|
46
|
+
{ id: 'cn-jargon', group: '抽象大词', sev: 'mid', re: /赋能|抓手|闭环|生态圈|生态位|生态|护城河|底层逻辑|顶层设计|组合拳|全方位|多维度|全链路|数字化转型|数字化|新质生产力|压舱石|护航|助力|全景|至关重要|举足轻重|深入探讨|无缝|稳健/g, advice: '换成具体做了什么、改了什么数字' },
|
|
47
|
+
{ id: 'cn-inflate', group: '拔高', sev: 'high', re: /标志着|里程碑|具有(深远|重大)(的)?(影响|意义)|开启(了)?新(的)?(篇章|时代|阶段)|书写(了)?新/g, advice: '删掉意义拔高,只留发生了什么' },
|
|
48
|
+
{ id: 'cn-avoid-be', group: '拔高', sev: 'mid', re: /(作为|充当|扮演)[^。\n]{0,20}(而存在|的角色|的作用|的载体)|起到了?[^。\n]{0,12}的作用/g, advice: '用「是」「有」直接说' },
|
|
49
|
+
{ id: 'cn-tail-inflate', group: '拔高', sev: 'high', re: /[,,][^。\n]{0,30}(充分)?(体现|彰显|凸显|印证|折射)(了)?/g, advice: '删掉句尾赞美,保留真实原因时改写' },
|
|
50
|
+
{ id: 'cn-tail-verb', group: '拔高', sev: 'mid', re: /(以|来|用以)?(充分)?(彰显|凸显|印证)(了)?(其|这|该)?/g, advice: '删掉以「彰显/凸显/印证」结尾的拔高尾巴' },
|
|
51
|
+
{ id: 'cn-promo', group: '拔高', sev: 'mid', re: /堪称|不失为|完美(诠释|结合|呈现)|令人(眼前一亮|印象深刻)|独具匠心/g, advice: '主观评价保留为评价,不加宣传语' },
|
|
52
|
+
{ id: 'cn-attrib', group: '借权威', sev: 'high', re: /专家(指出|表示|认为)|业界(普遍)?认为|多项研究(表明|显示)|有(分析|观察)(认为|指出)|据了解|据悉/g, advice: '实名来源保留;笼统归因保留其不确定性' },
|
|
53
|
+
{ id: 'cn-media-boost', group: '借权威', sev: 'mid', re: /据(多家)?媒体(报道|披露)|多家媒体(报道|指出)|在社交媒体(上)?(相当|非常|十分)?活跃|具有(一定的?)?(能见度|影响力)/g, advice: '罗列报道证明不了什么,直接说事实' },
|
|
54
|
+
|
|
55
|
+
// 空泛正面(均值回归:笼统夸奖,省掉具体细节)
|
|
56
|
+
{ id: 'cn-vague-praise', group: '拔高', sev: 'mid', re: /享有(一定的?)?(知名度|声誉|美誉)|广受(好评|欢迎|喜爱|赞誉|关注)|备受(赞誉|推崇|关注|瞩目|好评)|深受(喜爱|欢迎|信赖)|赢得(了)?(一定的?)?(声誉|好评|认可|口碑)|引起(了)?(广泛|强烈|热烈)(关注|反响)/g, advice: '换成具体做了什么、谁在什么场合说了什么' },
|
|
57
|
+
|
|
58
|
+
// 结局式展望
|
|
59
|
+
{ id: 'cn-outlook', group: '套话收尾', sev: 'mid', re: /未来可期|前景(广阔|可期|看好|十分)|拭目以待|值得期待|大有可为|值得关注/g, advice: '删掉展望句,正文写完就停' },
|
|
60
|
+
|
|
61
|
+
// 对话式开场(「说到 X,很多人会想到」)
|
|
62
|
+
{ id: 'cn-convo-open', group: '元话语', sev: 'mid', re: /说到[^。\n,,]{1,15}[,,][^。\n]{0,8}(不得不|绝对|就)|提到[^。\n,,]{1,15}[,,](很多人|大家|不少人|人们)|谈到[^。\n,,]{1,15}[,,](很多人|大家)/g, advice: '删掉寒暄式引入,第一句给事实' },
|
|
63
|
+
|
|
64
|
+
// 知识截止免责与笼统保证
|
|
65
|
+
{ id: 'cn-cutoff', group: '伪严谨', sev: 'mid', re: /(截至|截止)[^。\n]{0,6}知识|知识(截止|截至)|建议(您|你)(查阅|参考|查看)(最新|相关|官方)|请以(官方|官网)[^。\n]{0,6}为准|我(无法|不能)提供[^。\n]{0,10}(信息|内容|最新)/g, advice: '查不到就说缺哪个来源,不要写免责声明' },
|
|
66
|
+
{ id: 'cn-vague-assurance', group: '元话语', sev: 'mid', re: /确保(内容|信息|表述)(符合|满足)|在保留原意的?同时|(提升|改善)(了)?(可读性|准确性|中立性|一致性)|优化(了)?(结构|表达|排版)/g, advice: '说清改了哪一句、哪个事实,不要笼统保证质量' },
|
|
67
|
+
|
|
68
|
+
// 谄媚式附和
|
|
69
|
+
{ id: 'cn-sycophancy', group: '套话收尾', sev: 'high', re: /你说得(对|没错|很对)(?![^。!?\n]{0,15}(但|不过|然而|可是))|说得(很)?有道理|您的?(观察|理解|判断|思路)(很|非常)?(准确|到位|深刻)|这(是)?(一个)?(很好|不错)的?(观察|角度|切入点)/g, advice: '别先肯定再拐弯,直接说哪部分对、哪部分错' },
|
|
70
|
+
|
|
71
|
+
// 先肯定后转折、否定链、同义反复、流程堆砌、故作沉稳(2026-11 语料新增)
|
|
72
|
+
{ id: 'cn-affirm-pivot', group: '平行否定', sev: 'high', re: /(你说得(对|没错|有道理|很对)|你的?(观点|说法|理解|判断)(很|非常)?有(价值|道理)|这个(想法|思路|观点)很(好|不错)|我(完全)?同意你的?)[^。!?\n]{0,15}[,,]\s*(但|不过|然而|可是)/g, advice: '不同意的部分直接说,不必先发糖再下刀' },
|
|
73
|
+
{ id: 'cn-neg-chain', group: '伪严谨', sev: 'mid', re: /(不代表|不能|无法|不足以|不应|不宜|不可)[^。!?\n\d]{0,20}(不代表|不能|无法|不足以|不应|不宜|不可)/g, advice: '一条判断就够;带具体数值的规格上下限不算' },
|
|
74
|
+
{ id: 'cn-restate', group: '元话语', sev: 'mid', re: /换言之|换句话说|也就是说|更准确地说|更准确的说|简言之|用更直白的话说/g, advice: '换个说法重复不算新信息,删掉或补一条新证据' },
|
|
75
|
+
{ id: 'cn-purpose-open', group: '元话语', sev: 'mid', re: /为了更好地(帮助|理解|服务|支持)你|为(了)?避免(误解|混淆)|先(明确|澄清|确认)一下(边界|范围|前提)|我(先)?(复述|确认)一下/g, advice: '删掉铺陈直接给内容;不确定就写不确定在哪' },
|
|
76
|
+
{ id: 'cn-therapy', group: '套话收尾', sev: 'mid', re: /我理解你的(情绪|感受|担心|顾虑|处境)|我(能)?(感受到|理解)你的[^。\n]{0,4}(情绪|感受)|建议(你)?保持(理性|冷静|耐心)|按(你自己|自己)?(感到)?舒适的(节奏|方式|步调)|你的(感受|情绪)(很|非常)?(重要|合理)/g, advice: '不必替对方做情绪管理,说清事实就行' },
|
|
77
|
+
{ id: 'cn-refuse-redirect', group: '套话收尾', sev: 'low', re: /我(无法|不能)(提供|回答|帮助)[^。!?\n]{0,15}[,,]\s*(但|不过|可以|你可以)/g, advice: '不能做就说不能做,替代方案另起一句' },
|
|
78
|
+
{ id: 'cn-wuxia-tone', group: '拔高', sev: 'high', re: /这话我(记下|认)(了|着)?|这话(说)?得(不轻|有点重)|这事我?心里有数|这笔账|我守着|你往下讲|这个问题我?先不接|行,这话/g, advice: '别把日常对话演成电影台词,说「知道了」「好」就够' },
|
|
79
|
+
{ id: 'cn-proc-pile', group: '抽象大词', sev: 'mid', re: /(?:[\u4e00-\u9fa5]{2,4}[、,]){4,}/g, advice: '四个以上并列词堆在一起通常没说什么对象;挑真正做的那两三件' },
|
|
80
|
+
|
|
81
|
+
// 中文冗余
|
|
82
|
+
{ id: 'cn-do-verb', group: '中文冗余', sev: 'low', re: /进行(了)?(全面|深入|系统|重点|进一步)?(的)?(测试|调整|优化|分析|评估|检查|改造|升级|处理)/g, advice: '直接用动词:测试、调整、优化' },
|
|
83
|
+
{ id: 'cn-de-stack', group: '中文冗余', sev: 'low', re: /的[^的,。\n]{1,8}的[^的,。\n]{1,8}的/g, advice: '拆句,减少长定语' },
|
|
84
|
+
{ id: 'cn-passive-stack', group: '中文冗余', sev: 'low', re: /被[^。\n]{0,12}被/g, advice: '施事者已知就改主动句' },
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
/** @type {Rule[]} */
|
|
88
|
+
const EN_RULES = [
|
|
89
|
+
{ id: 'en-not-just', group: 'English', sev: 'high', re: /\bnot (just|only) [^.,;!?\n]{1,40}?,? but( also)?\b/gi, advice: 'state the plain claim' },
|
|
90
|
+
{ id: 'en-worth-noting', group: 'English', sev: 'high', re: /\b(it'?s|it is) worth noting\b|\bnotably,|\bimportantly,/gi, advice: 'delete the lead-in' },
|
|
91
|
+
{ id: 'en-conclusion', group: 'English', sev: 'high', re: /\bin conclusion\b|\boverall,|\bultimately,|\bto sum up\b/gi, advice: 'stop after the last point' },
|
|
92
|
+
{ id: 'en-avoid-be', group: 'English', sev: 'mid', re: /\bserves? as\b|\bstands? as\b|\bplay(s|ed)? a (crucial|pivotal|vital|significant|key|major|central) role\b/gi, advice: 'use "is" or "has"' },
|
|
93
|
+
{ id: 'en-inflate', group: 'English', sev: 'high', re: /\bis a testament to\b|\bunderscores? the (importance|significance)\b|\breflects? (a )?broader\b|\bmarking a turning point\b|\bevolving landscape\b|\bindelible mark\b|\bsetting the stage\b/gi, advice: 'delete the significance clause' },
|
|
94
|
+
{ id: 'en-ai-words', group: 'English', sev: 'mid', re: /\b(delve|tapestry|testament|pivotal|realm|underscore|showcase|foster|leverage|seamless|robust|holistic|multifaceted|intricate|embark)\b/gi, advice: 'plain word, unless it is a real term of art' },
|
|
95
|
+
{ id: 'en-service', group: 'English', sev: 'high', re: /\bi hope this helps\b|\blet me know if\b|\bwould you like me to\b|\bgreat question\b|\bfeel free to\b/gi, advice: 'delete the service-desk line' },
|
|
96
|
+
{ id: 'en-vague-attrib', group: 'English', sev: 'high', re: /\bexperts say\b|\bobservers have noted\b|\bstudies (suggest|show)\b|\bindustry reports\b/gi, advice: 'name the source or keep it explicitly vague' },
|
|
97
|
+
{ id: 'en-era', group: 'English', sev: 'mid', re: /\bin today'?s\b|\bever-evolving\b|\blet'?s (dive|unpack|explore)\b|\bdive into\b/gi, advice: 'delete the framing, start with the fact' },
|
|
98
|
+
{ id: 'en-affirm-pivot', group: 'English', sev: 'high', re: /\b(you'?re (absolutely |totally )?right|that'?s a (great|good|fair|excellent) (point|question)|fair enough)\b[^.!?\n]{0,25}[,.]?\s*(but|however|that said|yet)\b/gi, advice: 'say the disagreement outright, skip the sugar' },
|
|
99
|
+
{ id: 'en-therapy', group: 'English', sev: 'mid', re: /\bI (understand|hear|appreciate) (your|that|how)\b|\bwhatever you'?re comfortable with\b/gi, advice: 'skip the counselling, state the fact' },
|
|
100
|
+
{ id: 'en-clarify', group: 'English', sev: 'mid', re: /\b(let me (clarify|be clear)|to be clear|to avoid (any )?confusion|just to clarify)\b/gi, advice: 'delete the lead-in, give the content' },
|
|
101
|
+
{ id: 'en-refuse-redirect', group: 'English', sev: 'low', re: /\bI can'?t (help with|answer|provide)\b[^.!?\n]{0,30}[,.]?\s*(but|however)\b/gi, advice: 'refuse plainly; put the alternative in its own sentence' },
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
const ALL_RULES = [...CN_RULES, ...EN_RULES]
|
|
105
|
+
|
|
106
|
+
/** 1-based line and column for a string index. */
|
|
107
|
+
function lineCol(text, index) {
|
|
108
|
+
const before = text.slice(0, index)
|
|
109
|
+
const line = before.split('\n').length
|
|
110
|
+
return { line, col: index - before.lastIndexOf('\n') }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Short human-readable window around a match. */
|
|
114
|
+
function excerpt(text, index, length) {
|
|
115
|
+
const start = Math.max(0, index - 16)
|
|
116
|
+
const end = Math.min(text.length, index + length + 16)
|
|
117
|
+
const body = text.slice(start, end).replace(/\s+/g, ' ').trim()
|
|
118
|
+
return `${start > 0 ? '…' : ''}${body}${end < text.length ? '…' : ''}`
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Count occurrences of a plain pattern. */
|
|
122
|
+
function count(text, re) {
|
|
123
|
+
const m = text.match(re)
|
|
124
|
+
return m ? m.length : 0
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Statistical tells that no word list catches. */
|
|
128
|
+
function stats(text) {
|
|
129
|
+
const chars = text.length
|
|
130
|
+
let paragraphs = text.split(/\n[ \t]*\n/).map(p => p.trim()).filter(Boolean)
|
|
131
|
+
// 从 Notion / 网页抽出来的文本常常只有单换行,没有空行分段。
|
|
132
|
+
if (paragraphs.length < 3) {
|
|
133
|
+
const lineParas = text.split('\n').map(p => p.trim()).filter(Boolean)
|
|
134
|
+
if (lineParas.length >= 5) paragraphs = lineParas
|
|
135
|
+
}
|
|
136
|
+
const sentences = text.split(/[。!?!?;;]+|\n{2,}/).map(s => s.trim()).filter(s => s.length > 1)
|
|
137
|
+
const emDash = count(text, /——/g) + count(text, /—(?!—)/g) + count(text, /(^|[^-])--(?=[^-])/g)
|
|
138
|
+
const boldMatches = [...text.matchAll(/\*\*([^*\n]+)\*\*/g)].map(m => m[1])
|
|
139
|
+
const boldChars = boldMatches.reduce((sum, s) => sum + s.length, 0)
|
|
140
|
+
const lines = text.split('\n')
|
|
141
|
+
const bulletLines = lines.filter(l => /^\s*([-*+]\s+|\d+[.、)]\s+)/.test(l)).length
|
|
142
|
+
const nonEmptyLines = lines.filter(l => l.trim()).length || 1
|
|
143
|
+
const emojiHeading = lines.filter(l => /^#{1,6}\s*[\p{Extended_Pictographic}]/u.test(l)).length
|
|
144
|
+
const emojiAny = count(text, /[\p{Extended_Pictographic}]/gu)
|
|
145
|
+
const tableRows = lines.filter(l => l.trim().startsWith('|')).length
|
|
146
|
+
const parenthetical = count(text, /([^)]{0,20}(也就是|即|即所谓)[^)]{0,20})/g)
|
|
147
|
+
|
|
148
|
+
let uniformity = null
|
|
149
|
+
if (paragraphs.length >= 3) {
|
|
150
|
+
const lens = paragraphs.map(p => p.length)
|
|
151
|
+
const mean = lens.reduce((a, b) => a + b, 0) / lens.length
|
|
152
|
+
const variance = lens.reduce((a, b) => a + (b - mean) ** 2, 0) / lens.length
|
|
153
|
+
uniformity = mean > 0 ? Math.sqrt(variance) / mean : 0
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
chars,
|
|
158
|
+
paragraphs: paragraphs.length,
|
|
159
|
+
sentences: sentences.length,
|
|
160
|
+
avgSentenceChars: sentences.length ? Math.round(chars / sentences.length) : 0,
|
|
161
|
+
emDash,
|
|
162
|
+
emDashPer1000: chars ? Math.round((emDash / chars) * 1000 * 10) / 10 : 0,
|
|
163
|
+
boldCount: boldMatches.length,
|
|
164
|
+
boldRatio: chars ? Math.round((boldChars / chars) * 1000) / 10 : 0,
|
|
165
|
+
bulletRatio: Math.round((bulletLines / nonEmptyLines) * 100),
|
|
166
|
+
emojiHeadings: emojiHeading,
|
|
167
|
+
emoji: emojiAny,
|
|
168
|
+
tableRows,
|
|
169
|
+
parenthetical,
|
|
170
|
+
paragraphUniformity: uniformity === null ? null : Math.round(uniformity * 100) / 100,
|
|
171
|
+
markdownFree: boldMatches.length === 0 && bulletLines === 0 && tableRows === 0,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Structural checks: the shape of the text, which word-level regexes cannot see.
|
|
177
|
+
* Every note carries a fixed weight, so the verdict does not decay with length —
|
|
178
|
+
* a 20,000-character document with a rigid skeleton is not "cleaner" than a
|
|
179
|
+
* 500-character one with the same tells.
|
|
180
|
+
*/
|
|
181
|
+
function structural(text, s) {
|
|
182
|
+
const notes = []
|
|
183
|
+
const caveats = []
|
|
184
|
+
let points = 0
|
|
185
|
+
|
|
186
|
+
const lines = text.split('\n').map(l => l.trim()).filter(Boolean)
|
|
187
|
+
const lineCount = lines.length || 1
|
|
188
|
+
|
|
189
|
+
// 序数骨架:结论一/结论二/结论三……同一标签连续编号
|
|
190
|
+
const ordinalRe = /(结论|优化|架构|局限|路径|路线|方案|策略|原因|要点|阶段|做法|假设|边界|层次|方向|风险|收益|成本|步骤|环节)[一二三四五六七八九十]/g
|
|
191
|
+
const byLabel = new Map()
|
|
192
|
+
for (const m of text.matchAll(ordinalRe)) byLabel.set(m[1], (byLabel.get(m[1]) ?? 0) + 1)
|
|
193
|
+
const runs = [...byLabel.entries()].filter(([, n]) => n >= 3)
|
|
194
|
+
if (runs.length) {
|
|
195
|
+
const total = runs.reduce((sum, [, n]) => sum + n, 0)
|
|
196
|
+
const shape = runs
|
|
197
|
+
.map(([label, n]) => `${label}一~${label}${'一二三四五六七八九十'[Math.min(n, 10) - 1]} ${n} 条`)
|
|
198
|
+
.join('、')
|
|
199
|
+
points += runs.length >= 2 ? 4 : 3
|
|
200
|
+
notes.push(`序数骨架 ${runs.length} 组共 ${total} 条:${shape}。整节按编号平铺,读者看不出轻重,改成按重要性排或直接写散文。`)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 标签冒号开头:每条都以「短语:」起头
|
|
204
|
+
const labelOpeners = lines.filter(l => /^[^。!?,、:\n]{2,12}:/.test(l)).length
|
|
205
|
+
const labelRatio = Math.round((labelOpeners / lineCount) * 100)
|
|
206
|
+
if (labelOpeners >= 8 && labelRatio >= 8) {
|
|
207
|
+
points += labelRatio >= 20 ? 4 : 3
|
|
208
|
+
notes.push(`「标签:内容」开头 ${labelOpeners} 条,占全部段落的 ${labelRatio}%。条目全做成表单字段,是把散文写成了配置项。`)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// 短句先行再展开:每条都是「一句话结论。补充说明」的同一节奏
|
|
212
|
+
const leadThenBody = lines.filter(l => /^[^\n]{6,40}。\s*\S/.test(l)).length
|
|
213
|
+
if (leadThenBody >= 6) {
|
|
214
|
+
points += leadThenBody >= 12 ? 2 : 1
|
|
215
|
+
notes.push(`短句先行再展开 ${leadThenBody} 处,每条都是同一节奏,读下去像模板填空。`)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// 对称否定总量,正序「不是…是…」与反序「…,不是…」都算
|
|
219
|
+
const notXButY = (text.match(/不是[^。!?\n]{2,25}[,,]\s*(而是|是)[^。!?\n]{2,25}/g) ?? []).length
|
|
220
|
+
const yNotX = (text.match(/[^。!?\n]{2,25}[,,]\s*不是[^。!?\n]{2,25}[。!?]/g) ?? []).length
|
|
221
|
+
const negTotal = notXButY + yNotX
|
|
222
|
+
if (negTotal >= 10) {
|
|
223
|
+
points += negTotal >= 18 ? 3 : 2
|
|
224
|
+
notes.push(`对称否定 ${negTotal} 处(「不是…是…」${notXButY},「…,不是…」${yNotX})。对比立得住就直说结论,不必每段先摆一个错的再纠正。`)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (s.emDashPer1000 >= 2) {
|
|
228
|
+
points += 1
|
|
229
|
+
notes.push(`破折号密度偏高:${s.emDash} 处 / ${s.chars} 字,当作逗号用了。`)
|
|
230
|
+
}
|
|
231
|
+
if (s.boldRatio > 5) {
|
|
232
|
+
points += 1
|
|
233
|
+
notes.push(`加粗占比 ${s.boldRatio}%,超过 5% 的上限。`)
|
|
234
|
+
}
|
|
235
|
+
if (s.bulletRatio > 60 && s.chars > 400) {
|
|
236
|
+
points += 1
|
|
237
|
+
notes.push(`列表行占比 ${s.bulletRatio}%,正文被拆成了要点提纲。`)
|
|
238
|
+
}
|
|
239
|
+
if (s.paragraphUniformity !== null && s.paragraphUniformity < 0.15) {
|
|
240
|
+
points += 1
|
|
241
|
+
notes.push(`段落长度高度均匀(变异系数 ${s.paragraphUniformity}),读起来像模板。`)
|
|
242
|
+
}
|
|
243
|
+
if (s.emojiHeadings > 0) {
|
|
244
|
+
points += 1
|
|
245
|
+
notes.push(`${s.emojiHeadings} 个标题带 emoji 装饰。`)
|
|
246
|
+
}
|
|
247
|
+
if (s.tableRows >= 4 && s.chars < 600) {
|
|
248
|
+
points += 1
|
|
249
|
+
notes.push('短文本配了表格,两个选项也做成了多列表格。')
|
|
250
|
+
}
|
|
251
|
+
if (s.parenthetical >= 3) {
|
|
252
|
+
points += 1
|
|
253
|
+
notes.push(`${s.parenthetical} 处「(也就是……)」式括号解释。`)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const threeStep = /首先[^。\n]{0,40}/.test(text) && /其次[^。\n]{0,40}/.test(text) && /(最后|再次)[^。\n]{0,40}/.test(text)
|
|
257
|
+
if (threeStep) {
|
|
258
|
+
points += 1
|
|
259
|
+
notes.push('出现「首先/其次/最后」骨架,没有真实顺序就拆掉。')
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (s.markdownFree && s.chars > 1200) {
|
|
263
|
+
caveats.push('文本里没有任何 Markdown 标记(加粗、列表、表格),若原文来自 Notion、网页或富文本编辑器,这几项格式指标不可信——扫描到的只有文字层,加粗块、列表项、表格结构在抽取时已经丢了。')
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return { notes, caveats, points }
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Scan text for style defects.
|
|
271
|
+
* @param {string} text
|
|
272
|
+
* @param {{ lang?: 'zh'|'en'|'auto', limit?: number }} [options]
|
|
273
|
+
*/
|
|
274
|
+
export function analyze(text, options = {}) {
|
|
275
|
+
const source = String(text ?? '')
|
|
276
|
+
const lang = options.lang ?? 'auto'
|
|
277
|
+
const limit = Math.min(Math.max(options.limit ?? 40, 1), 200)
|
|
278
|
+
|
|
279
|
+
if (!source.trim()) {
|
|
280
|
+
return { ok: false, error: 'text 为空,没有可扫描的内容。' }
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const s = stats(source)
|
|
284
|
+
const hits = []
|
|
285
|
+
|
|
286
|
+
for (const rule of ALL_RULES) {
|
|
287
|
+
if (lang === 'zh' && rule.group === 'English') continue
|
|
288
|
+
if (lang === 'en' && rule.group !== 'English') continue
|
|
289
|
+
let seen = 0
|
|
290
|
+
for (const m of source.matchAll(rule.re)) {
|
|
291
|
+
if (seen >= 20) break
|
|
292
|
+
const { line, col } = lineCol(source, m.index ?? 0)
|
|
293
|
+
hits.push({
|
|
294
|
+
group: rule.group,
|
|
295
|
+
severity: rule.sev,
|
|
296
|
+
match: m[0].slice(0, 40),
|
|
297
|
+
line,
|
|
298
|
+
col,
|
|
299
|
+
excerpt: excerpt(source, m.index ?? 0, m[0].length),
|
|
300
|
+
advice: rule.advice,
|
|
301
|
+
})
|
|
302
|
+
seen += 1
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
hits.sort((a, b) => a.line - b.line || a.col - b.col)
|
|
307
|
+
|
|
308
|
+
const groups = {}
|
|
309
|
+
let score = 0
|
|
310
|
+
for (const hit of hits) {
|
|
311
|
+
groups[hit.group] = (groups[hit.group] ?? 0) + 1
|
|
312
|
+
score += SEVERITY[hit.severity]
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// 词级密度按长度稀释;结构分是绝对计数,不随长度衰减。
|
|
316
|
+
// 判决取两者较重的一个:2 万字文档骨架僵硬,不该因为字多被判 clean。
|
|
317
|
+
const wordDensity = s.chars >= 300 ? score / (s.chars / 300) : score
|
|
318
|
+
const { notes, caveats, points } = structural(source, s)
|
|
319
|
+
const severity = Math.max(wordDensity, points)
|
|
320
|
+
const verdict = severity >= 9 ? 'heavily templated' : severity >= 4 ? 'some templating' : severity > 0 ? 'mostly clean' : 'clean'
|
|
321
|
+
|
|
322
|
+
return {
|
|
323
|
+
ok: true,
|
|
324
|
+
lang,
|
|
325
|
+
chars: s.chars,
|
|
326
|
+
stats: s,
|
|
327
|
+
verdict,
|
|
328
|
+
score: Math.round(severity * 10) / 10,
|
|
329
|
+
wordDensity: Math.round(wordDensity * 10) / 10,
|
|
330
|
+
structurePoints: points,
|
|
331
|
+
hitCount: hits.length,
|
|
332
|
+
groups,
|
|
333
|
+
hits: hits.slice(0, limit),
|
|
334
|
+
truncated: hits.length > limit,
|
|
335
|
+
notes,
|
|
336
|
+
caveats,
|
|
337
|
+
}
|
|
338
|
+
}
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# dsh-direct-human-style bundle patch: inserts the plugin row into the
|
|
2
|
+
# profile roster. Host-only: it adds one always-on system-prompt section
|
|
3
|
+
# (order 100) and two agent tools (humanize_check / humanize_rules).
|
|
4
|
+
- insert:
|
|
5
|
+
- id: direct-human-style
|
|
6
|
+
name: 'dsh-direct-human-style'
|
package/icon.svg
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="humanizer-zh">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#111827"/>
|
|
3
|
+
<g fill="#E5E7EB">
|
|
4
|
+
<rect x="12" y="15" width="40" height="4.5" rx="2.25"/>
|
|
5
|
+
<rect x="12" y="25" width="31" height="4.5" rx="2.25"/>
|
|
6
|
+
<rect x="12" y="35" width="37" height="4.5" rx="2.25"/>
|
|
7
|
+
</g>
|
|
8
|
+
<g transform="rotate(-34 47 45)">
|
|
9
|
+
<rect x="33" y="38.5" width="28" height="13" rx="3.5" fill="#34D399"/>
|
|
10
|
+
<rect x="33" y="38.5" width="9" height="13" rx="3.5" fill="#059669"/>
|
|
11
|
+
</g>
|
|
12
|
+
<g fill="#6B7280">
|
|
13
|
+
<rect x="12" y="47" width="7" height="4.5" rx="2.25"/>
|
|
14
|
+
<rect x="22.5" y="47" width="4.5" height="4.5" rx="2.25"/>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-direct-human-style — host half.
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces:
|
|
5
|
+
* 1. an always-on system-prompt section (order 100) carrying the
|
|
6
|
+
* direct-human-style constraint, so every reply is held to it;
|
|
7
|
+
* 2. two agent tools — humanize_check (pattern + statistics scan) and
|
|
8
|
+
* humanize_rules (long-form references pulled on demand).
|
|
9
|
+
*
|
|
10
|
+
* The style section is deliberately short: it is paid for on every request,
|
|
11
|
+
* so the 31 checkpoint details live behind humanize_rules instead.
|
|
12
|
+
*
|
|
13
|
+
* Dependency note: the tool objects are built here instead of through
|
|
14
|
+
* `@deepseek-ai/dsh-tools`. A linked (unbuilt) bundle has no node_modules of
|
|
15
|
+
* its own, so a bare import of a host package fails and silently leaves the
|
|
16
|
+
* tools unregistered. `defineTool` only normalises a parameter spec into JSON
|
|
17
|
+
* Schema and wraps `execute` with argument validation — both are done below.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { STYLE_PROMPT, STYLE_SECTION_NAME, STYLE_SECTION_ORDER } from './prompt.js'
|
|
21
|
+
import { analyze } from './analyze.js'
|
|
22
|
+
import { INDEX, PARTS, lookup } from './rules.js'
|
|
23
|
+
|
|
24
|
+
/** Stable cordis plugin name. */
|
|
25
|
+
export const name = 'direct-human-style'
|
|
26
|
+
|
|
27
|
+
/** Services required before the style surface can mount. */
|
|
28
|
+
export const inject = ['tools', 'systemPrompt']
|
|
29
|
+
|
|
30
|
+
const DEFAULTS = {
|
|
31
|
+
enabled: true,
|
|
32
|
+
order: STYLE_SECTION_ORDER,
|
|
33
|
+
registerTools: true,
|
|
34
|
+
extraBanned: [],
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Compose the section text: the fixed prompt plus any user additions. */
|
|
38
|
+
function buildPrompt(config) {
|
|
39
|
+
const extra = Array.isArray(config.extraBanned) ? config.extraBanned.filter(Boolean) : []
|
|
40
|
+
if (extra.length === 0) return STYLE_PROMPT
|
|
41
|
+
return `${STYLE_PROMPT}\n\n**用户追加的禁用表达:** ${extra.join(' / ')}`
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** One text content block. */
|
|
45
|
+
function text(value) {
|
|
46
|
+
return [{ type: 'text', text: value }]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Build a registry-ready tool definition.
|
|
51
|
+
*
|
|
52
|
+
* @param {object} options
|
|
53
|
+
* @param {string} options.name - model-facing tool name.
|
|
54
|
+
* @param {string} options.description - what it does and when to call it.
|
|
55
|
+
* @param {object} options.parameters - raw JSON Schema for the arguments.
|
|
56
|
+
* @param {(args: object, value: unknown) => object[]} options.render - content blocks.
|
|
57
|
+
* @param {number} [options.timeoutMs] - per-call budget.
|
|
58
|
+
* @param {(args: object, exec: unknown) => unknown} options.execute - the work.
|
|
59
|
+
* @returns {object} the object `ctx.tools.register` expects.
|
|
60
|
+
*/
|
|
61
|
+
function makeTool(options) {
|
|
62
|
+
const { parameters, execute, render, timeoutMs } = options
|
|
63
|
+
const required = Array.isArray(parameters.required) ? parameters.required : []
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
name: options.name,
|
|
67
|
+
description: options.description,
|
|
68
|
+
parameters,
|
|
69
|
+
output: { schema: {}, render },
|
|
70
|
+
...(Number.isFinite(timeoutMs) && timeoutMs > 0 ? { timeoutMs } : {}),
|
|
71
|
+
async execute(args) {
|
|
72
|
+
const value = args ?? {}
|
|
73
|
+
const violations = []
|
|
74
|
+
for (const key of required) {
|
|
75
|
+
if (value[key] === undefined) violations.push(`${key} is required`)
|
|
76
|
+
}
|
|
77
|
+
for (const [key, schema] of Object.entries(parameters.properties ?? {})) {
|
|
78
|
+
const given = value[key]
|
|
79
|
+
if (given === undefined) continue
|
|
80
|
+
const type = schema.type
|
|
81
|
+
if (type === 'string' && typeof given !== 'string') violations.push(`${key} must be a string`)
|
|
82
|
+
if (type === 'integer' && !Number.isInteger(given)) violations.push(`${key} must be an integer`)
|
|
83
|
+
if (type === 'array' && !Array.isArray(given)) violations.push(`${key} must be an array`)
|
|
84
|
+
if (Array.isArray(schema.enum) && !schema.enum.includes(given)) {
|
|
85
|
+
violations.push(`${key} must be one of ${schema.enum.join(', ')}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (violations.length > 0) {
|
|
89
|
+
return { ok: false, error: `invalid arguments: ${violations.join('; ')}` }
|
|
90
|
+
}
|
|
91
|
+
return execute(value)
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Render a scan result as a readable report. */
|
|
97
|
+
function renderScan(_args, value) {
|
|
98
|
+
if (!value || value.ok === false) return text(value?.error ?? '扫描失败。')
|
|
99
|
+
|
|
100
|
+
const s = value.stats
|
|
101
|
+
const lines = [
|
|
102
|
+
`判定:${value.verdict}(词级密度 ${value.wordDensity ?? value.score} · 结构分 ${value.structurePoints ?? 0})· ${value.chars} 字 · ${s.sentences} 句 · 平均句长 ${s.avgSentenceChars} 字`,
|
|
103
|
+
`命中 ${value.hitCount} 处${value.truncated ? '(已截断)' : ''}:${Object.entries(value.groups).map(([g, n]) => `${g} ${n}`).join(' · ') || '无'}`,
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
if (value.notes.length > 0) {
|
|
107
|
+
lines.push('', '结构问题:')
|
|
108
|
+
for (const note of value.notes) lines.push(`- ${note}`)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (value.caveats?.length > 0) {
|
|
112
|
+
lines.push('', '指标不可信:')
|
|
113
|
+
for (const caveat of value.caveats) lines.push(`- ${caveat}`)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (value.hits.length > 0) {
|
|
117
|
+
lines.push('', '命中明细:')
|
|
118
|
+
for (const hit of value.hits) {
|
|
119
|
+
lines.push(`- L${hit.line}:${hit.col} [${hit.group}/${hit.severity}] ${hit.match}`)
|
|
120
|
+
lines.push(` 上下文:${hit.excerpt}`)
|
|
121
|
+
lines.push(` 改法:${hit.advice}`)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
lines.push('', '命中不等于要改:先看有没有独立信息、是否空泛、是否与文体冲突。')
|
|
126
|
+
return text(lines.join('\n'))
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Render a rules lookup. */
|
|
130
|
+
function renderRules(_args, value) {
|
|
131
|
+
if (!value || value.ok === false) return text(value?.error ?? '未找到对应部分。')
|
|
132
|
+
return text(value.markdown)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** The scanning tool. */
|
|
136
|
+
function humanizeCheckTool() {
|
|
137
|
+
return makeTool({
|
|
138
|
+
name: 'humanize_check',
|
|
139
|
+
description:
|
|
140
|
+
'按 direct-human-style 规则扫描一段文本,返回命中的套话、平行否定、伪严谨、拔高、借权威、英文 AI 腔,' +
|
|
141
|
+
'以及破折号密度、加粗占比、平均句长、段落均匀度等统计指标。用于交付前自检或审阅用户文档,' +
|
|
142
|
+
'只报线索不改写:命中不等于要改,先看有没有独立信息。' +
|
|
143
|
+
'Triggers: 去掉 AI 味, 检查文风, AI 腔, 太像 AI 写的, 审稿.',
|
|
144
|
+
parameters: {
|
|
145
|
+
type: 'object',
|
|
146
|
+
properties: {
|
|
147
|
+
text: { type: 'string', description: '要扫描的文本全文' },
|
|
148
|
+
lang: { type: 'string', enum: ['auto', 'zh', 'en'], description: '扫描语种,默认 auto 同时跑中英规则' },
|
|
149
|
+
limit: { type: 'integer', description: '最多返回多少条命中,默认 40,最大 200' },
|
|
150
|
+
},
|
|
151
|
+
required: ['text'],
|
|
152
|
+
},
|
|
153
|
+
render: renderScan,
|
|
154
|
+
timeoutMs: 30_000,
|
|
155
|
+
async execute(args) {
|
|
156
|
+
return analyze(args.text, { lang: args.lang ?? 'auto', limit: args.limit ?? 40 })
|
|
157
|
+
},
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** The reference lookup tool. */
|
|
162
|
+
function humanizeRulesTool() {
|
|
163
|
+
return makeTool({
|
|
164
|
+
name: 'humanize_rules',
|
|
165
|
+
description:
|
|
166
|
+
'取回 direct-human-style 的细则文本:direct 全局直白风格、gpt 英文模型腔调清单、' +
|
|
167
|
+
'deepseek 中文模型腔调清单、checkpoints 编辑已有文本用的 31 个检查点。' +
|
|
168
|
+
`未指定 part 时返回全部。${INDEX}` +
|
|
169
|
+
'Triggers: 文风规则, 怎么改写, AI 腔清单, humanizer 细则.',
|
|
170
|
+
parameters: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: {
|
|
173
|
+
part: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
enum: PARTS,
|
|
176
|
+
description: '要取回的部分,默认 all',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
render: renderRules,
|
|
181
|
+
timeoutMs: 15_000,
|
|
182
|
+
async execute(args) {
|
|
183
|
+
const part = args.part ?? 'all'
|
|
184
|
+
const markdown = lookup(part)
|
|
185
|
+
if (markdown === null) {
|
|
186
|
+
return { ok: false, error: `未知的 part:${part}。可用:${PARTS.join(' / ')}` }
|
|
187
|
+
}
|
|
188
|
+
return { ok: true, part, chars: markdown.length, markdown }
|
|
189
|
+
},
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** All tools this plugin contributes. */
|
|
194
|
+
export function humanizerTools() {
|
|
195
|
+
return [humanizeCheckTool(), humanizeRulesTool()]
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Mount the style constraint and the tools. */
|
|
199
|
+
export function apply(ctx, config = {}) {
|
|
200
|
+
const settings = { ...DEFAULTS, ...(config ?? {}) }
|
|
201
|
+
|
|
202
|
+
if (settings.enabled === false) {
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
ctx.effect(
|
|
207
|
+
() =>
|
|
208
|
+
ctx.systemPrompt.section({
|
|
209
|
+
name: STYLE_SECTION_NAME,
|
|
210
|
+
order: Number.isFinite(settings.order) ? settings.order : STYLE_SECTION_ORDER,
|
|
211
|
+
text: buildPrompt(settings),
|
|
212
|
+
}),
|
|
213
|
+
'dsh-humanizer-zh: style section',
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
if (settings.registerTools !== false) {
|
|
217
|
+
ctx.effect(() => {
|
|
218
|
+
const disposers = humanizerTools().map(tool => ctx.tools.register(tool))
|
|
219
|
+
return () => {
|
|
220
|
+
for (const dispose of disposers) dispose()
|
|
221
|
+
}
|
|
222
|
+
}, 'dsh-humanizer-zh: scanning tools')
|
|
223
|
+
}
|
|
224
|
+
}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-direct-human-style",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Always-on prose contract for DeepSeek Harness: one system-prompt section that strips GPT and DeepSeek filler from every reply, plus humanize_check and humanize_rules tools. · DSH 直白文风插件:常驻系统提示词,去掉 GPT 与 DeepSeek 腔调,附扫描与清单查询工具。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js",
|
|
9
|
+
"./locale/*.json": "./locale/*.json",
|
|
10
|
+
"./icon": "./icon.svg",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"dsh": {
|
|
14
|
+
"bundle": {
|
|
15
|
+
"patch": "./cordis.patch.yml"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"prompt.js",
|
|
21
|
+
"rules.js",
|
|
22
|
+
"analyze.js",
|
|
23
|
+
"cordis.patch.yml",
|
|
24
|
+
"locale",
|
|
25
|
+
"icon.svg",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dsh",
|
|
34
|
+
"dsh-plugin",
|
|
35
|
+
"deepseek-harness",
|
|
36
|
+
"system-prompt",
|
|
37
|
+
"writing-style",
|
|
38
|
+
"humanizer",
|
|
39
|
+
"ai-writing"
|
|
40
|
+
],
|
|
41
|
+
"author": "pseudonymzjt",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/pseudonymzjt/dsh-direct-human-style.git"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/pseudonymzjt/dsh-direct-human-style#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/pseudonymzjt/dsh-direct-human-style/issues"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/prompt.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The always-on system-prompt section. Kept short on purpose: it is paid for
|
|
3
|
+
* on every request. The long-form references live behind humanize_rules.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const STYLE_SECTION_NAME = 'plugin:dsh-direct-human-style'
|
|
7
|
+
|
|
8
|
+
/** Band right after the deployment persona, before any tool guidance. */
|
|
9
|
+
export const STYLE_SECTION_ORDER = 100
|
|
10
|
+
|
|
11
|
+
export const STYLE_PROMPT = `## 沟通风格:直白工程同侪(direct-human-style,全局常驻)
|
|
12
|
+
|
|
13
|
+
适用于所有对话、技术解释、总结与写作。纯代码、命令、数学推导、引用原文除外。
|
|
14
|
+
|
|
15
|
+
1. **结论先行。** 第一句给答案或核心判断。
|
|
16
|
+
2. **直接说是什么。** 先给正面断言,不用「不是 A 而是 B」「不需要 A 也不需要 B」搭架子。
|
|
17
|
+
3. **该下判断就下。** 证据不足就点出缺哪个指标、哪次测试、哪个数据源,不写「或许未必」「还不能得出结论」。
|
|
18
|
+
4. **去掉元话语。** 不写「我想提出一个判断」「我建议」「说白了」「本质上是」,直接从判断或动作动词开始。
|
|
19
|
+
5. **具体压抽象。** 用数字、机制、因果链代替「全面提升」「赋能」「生态」「闭环」。
|
|
20
|
+
6. **句长自然交替。** 不硬凑三段排比,不套 rule of three,不拿「——」当逗号,正文加粗控制在 5% 以内。
|
|
21
|
+
|
|
22
|
+
**长度跟着信息走。** 删的是铺垫、套话、重复;机制、条件、边界、反例照写,该长就长。步骤和对照表只要有信息就保留,别为了干脆把层次压平。
|
|
23
|
+
|
|
24
|
+
**长文别搭骨架。** 不把整篇切成「结论一/结论二」「优化一/优化二」这种编号清单,不让每条都以「标签:」起头,也不让各节凑成同一个条目数。分节按内容需要,长短可以不齐。
|
|
25
|
+
|
|
26
|
+
**开头与结尾。** 不写「这是一个很好的问题」「在……的背景下」「从某种程度上说」开场;不写「希望这能帮到你」「如果你还有其他问题」「需要我继续吗」收尾。正文写完就停。
|
|
27
|
+
|
|
28
|
+
**必删套话:** 值得注意的是 / 值得一提的是 / 需要注意的是 / 综上所述 / 总而言之 / 由此可见 / 随着……的发展 / 在……的今天 / 让我们深入看看 / 一言以蔽之 / 说白了 / 本质上 / 全方位 / 多维度 / 赋能 / 抓手 / 闭环 / 生态 / 护城河 / 底层逻辑 / 至关重要 / 举足轻重 / 深入探讨 / 无缝 / 稳健 / 压舱石
|
|
29
|
+
|
|
30
|
+
**必拆句式:** 不仅……更是…… / 不是……而是…… / 不需要……也不需要…… / 与其说……不如说…… / 既……又…… / 从……到……再到…… / 首先·其次·最后(没有真实顺序时)/ 以「彰显」「凸显」「印证」结尾的拔高尾巴
|
|
31
|
+
|
|
32
|
+
**模型腔速查:** 「你说得对,但……」先肯定后转折 ·「换言之/更准确地说」换个说法再说一遍 ·「不能……也不能……」否定链 ·「先校验、再审计、最后回滚」流程词堆一串但没有对象和数字 ·「这话我记下了」「这事我心里有数」故作沉稳 ·「为了更好地帮助你」「我理解你的情绪」客服与安抚腔 ·「我无法回答,但可以帮你」拒绝配替代
|
|
33
|
+
|
|
34
|
+
**英文镜像:** Not just X, but Y · It's worth noting · In conclusion / Overall · serves as / stands as · is a testament to · played a crucial role · underscores the importance · evolving landscape · Let me know if · I hope this helps · Great question
|
|
35
|
+
|
|
36
|
+
**例外:** 纯代码只给代码与命令,不加垫话;引语、法条、错误日志原样保留。
|
|
37
|
+
|
|
38
|
+
细节清单用 \`humanize_rules\` 检索,交付前审稿用 \`humanize_check\`。`
|
package/rules.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Long-form references served by the humanize_rules tool. Kept out of the
|
|
3
|
+
* always-on prompt so the per-request cost stays flat; the model pulls the
|
|
4
|
+
* part it needs when it is actually editing text.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DIRECT = `# direct-human-style
|
|
8
|
+
|
|
9
|
+
## 七条原则
|
|
10
|
+
1. 结论先行。第一句给答案或核心判断。
|
|
11
|
+
2. 直接说是什么。先给正面断言,不靠打倒稻草人制造深度。
|
|
12
|
+
3. 该下判断就下。证据不足就点出缺哪个指标、哪次测试、哪个数据源。
|
|
13
|
+
4. 去掉元话语。不预告自己的修辞动作。
|
|
14
|
+
5. 具体压抽象。用数字、机制、因果链。
|
|
15
|
+
6. 句长自然交替。不硬凑三段排比,不套 rule of three。
|
|
16
|
+
7. 长度跟着信息走。删的是铺垫、套话、重复;机制、条件、边界、反例照写,该长就长。
|
|
17
|
+
|
|
18
|
+
## 必改
|
|
19
|
+
- 不能认为 A,也不能当作 B → 直接给正面断言
|
|
20
|
+
- 不需要 A,也不需要 B → 说明实际需要什么
|
|
21
|
+
- 不仅 A,更是 B → 拆成两句或只留信息量大的一半
|
|
22
|
+
- 或许未必是……,更可能…… → 直接说哪种原因更可能
|
|
23
|
+
- 值得注意的是 / 在某种程度上 → 删掉,直接说事
|
|
24
|
+
- 我想提出一个判断 / 我建议 / 说白了 / 本质上是 → 从判断或动词开始
|
|
25
|
+
- 这比……更……(当修辞拐棍用)→ 给可测差异
|
|
26
|
+
- 三连形容词堆叠 → 给参数或取舍
|
|
27
|
+
- —— 当逗号 → 一段最多一次
|
|
28
|
+
- 正文加粗 > 5% → 只留跳读要用的
|
|
29
|
+
- 每个小标题后加(……)解释 → 只留读者确实缺的那条
|
|
30
|
+
- 段落末尾复述本节 → 删掉
|
|
31
|
+
- 为了显得干脆把步骤或对照结构压成一段散文 → 还原结构
|
|
32
|
+
- 你说得对,但…… / 你的观点很有价值,但…… → 不同意的部分直接说
|
|
33
|
+
- 换言之 / 更准确地说 / 换句话说 → 删掉,或补一条新证据
|
|
34
|
+
- 不能……也不能……(一条判断里堆否定)→ 一条判断就够
|
|
35
|
+
- 先校验、再审计、最后回滚(流程词堆砌)→ 只写真正做的那两三件,带对象和数字
|
|
36
|
+
- 这话我记下了 / 这事我心里有数 / 这笔账 → 说「知道了」「好」就够
|
|
37
|
+
- 为了更好地帮助你 / 我理解你的情绪 → 删掉,直接给内容
|
|
38
|
+
- 结论一/结论二……优化一/优化二(整篇编号平铺)→ 只给真有先后顺序的部分编号,其余按重要性排或写散文
|
|
39
|
+
- 每条都以「标签:」起头 → 该说成句子的说成句子,标签只留给真正的字段
|
|
40
|
+
- 各节条目数凑成同一个模子(每节都 4 条)→ 按内容定长短,不齐才对
|
|
41
|
+
|
|
42
|
+
## 例外
|
|
43
|
+
纯代码与数学直接给结果;引语、法条、错误日志原样保留。
|
|
44
|
+
|
|
45
|
+
## 交付前核对
|
|
46
|
+
1. 第一句是否给了核心答案?
|
|
47
|
+
2. 有没有「不是……而是」「不能……也不能」「我想/我建议」「或许未必」?
|
|
48
|
+
3. 结尾是否停在最后一句,没有复述、祝福或主动提议?
|
|
49
|
+
4. 有没有为了短而删掉机制、条件、边界或反例?
|
|
50
|
+
5. 整篇有没有套同一个骨架:编号平铺、标签冒号开头、各节条目数一样?`
|
|
51
|
+
|
|
52
|
+
export const GPT = `# GPT 腔调清单
|
|
53
|
+
|
|
54
|
+
1. 拔高意义:标志着新时代、具有里程碑意义、奠定了坚实基础、掀开了序幕 → 只留发生了什么。
|
|
55
|
+
2. 回避系动词:作为……而存在、扮演着……的角色、起到了……的作用 → 用「是」「有」。
|
|
56
|
+
3. 分词收尾拔高:以「充分体现/彰显/凸显/印证」结尾 → 删尾巴,或保留真实原因。
|
|
57
|
+
4. 否定式平行:不是……而是……、不仅……更是…… → 直接给正面断言。
|
|
58
|
+
5. 三段式与清单癖:无信息增量的三项并列、每答必 3 个 bullet → 有几项写几项。
|
|
59
|
+
6. 模糊归因:专家指出、业界普遍认为、多项研究表明 → 实名保留,笼统归因保留其不确定性。
|
|
60
|
+
7. 官样收尾:综上所述、总而言之、由此可见、展望未来 → 删掉。
|
|
61
|
+
8. 客服腔:好问题、希望这对你有帮助、需要我继续展开吗 → 删掉。
|
|
62
|
+
9. 高频 AI 词:delve / tapestry / landscape / testament / pivotal / crucial / realm / underscore / showcase / foster / leverage / seamless / robust / holistic / multifaceted;中文对应:深入探讨、画卷、图景、见证、至关重要、领域、凸显、展示、培育、赋能、无缝、稳健、整体性、多面。
|
|
63
|
+
10. 排版痕迹:破折号当逗号、加粗 > 5%、每条 bullet 以加粗短语开头、括号解释泛滥、段落长度均匀。
|
|
64
|
+
11. 谄媚式附和:你说得对、这是很好的观察、非常赞同 → 对的部分直接认同并往下走,错的部分点出来(《科学》2026 年测 11 个模型,附和频率平均比人类高 49%)。
|
|
65
|
+
12. 知识截止免责:由于我的知识截止于……、建议您查阅最新信息 → 查不到就说缺哪个来源。
|
|
66
|
+
13. 笼统保证:确保内容符合要求、在保留原意的同时提升了可读性 → 说清改了哪一句、哪一处事实。
|
|
67
|
+
14. 先肯定后转折:你说得对,但这不代表……、你的观点很有价值,但问题更复杂 → 不同意的部分直接说,同意的部分不必铺垫。
|
|
68
|
+
15. 目的状语开场:为了更好地帮助你、为避免误解、先明确一下边界、我先复述一下 → 删掉铺陈,直接给内容。
|
|
69
|
+
16. 情绪安抚:我理解你的情绪,但建议保持理性、你可以按自己舒适的节奏 → 不替对方做情绪管理,说清事实。
|
|
70
|
+
|
|
71
|
+
判定顺序:先看有没有独立信息,再看是否空泛,最后看文体。三项都不成立就保留。`
|
|
72
|
+
|
|
73
|
+
export const DEEPSEEK = `# DeepSeek 腔调清单
|
|
74
|
+
|
|
75
|
+
1. 三段式骨架:首先/其次/最后、第一/第二/第三(无真实顺序)、结尾「以上就是」→ 拆掉骨架,按信息重要度排。
|
|
76
|
+
2. 抽象大词:赋能、助力、抓手、闭环、生态、护城河、底层逻辑、顶层设计、组合拳、全方位、多维度、全链路 → 换成做了什么、改了什么数字。
|
|
77
|
+
3. 工整对仗与四字格:稳定可靠、快速响应、易于维护;层层递进、环环相扣 → 给具体表现。
|
|
78
|
+
4. 重大化叙述:标志着、意味着全新开始、开启新篇章、意义重大 → 说加了什么功能。
|
|
79
|
+
5. 总结癖:综上所述、总而言之、一句话总结、核心要点如下、划重点、敲黑板 → 删掉。
|
|
80
|
+
6. 谦卑开场:您提出的问题非常好、这是一个很有价值的问题、我理解您的困惑、别担心 → 直接给原因。
|
|
81
|
+
7. 思维链泄漏:让我重新审视一下、等等这里好像有问题、嗯那么 → 只留结论和依据。
|
|
82
|
+
8. 客套收尾:希望以上内容对您有帮助、如有疑问欢迎随时交流、需要我继续展开吗 → 删掉。
|
|
83
|
+
9. 排版癖:🚀 核心优势 / ✅ 最佳实践、每条 bullet 以加粗短语开头、(也就是……)括号解释、两个选项也做表格、段落等长 → 按内容需要排。
|
|
84
|
+
10. 中文冗余:进行测试→测试、层叠的「的」、「随着……的发展」开头、「被」字堆叠、值得一提的是 → 简化。
|
|
85
|
+
11. 空泛正面词:享有一定的知名度、广受好评、备受关注、深受喜爱、赢得良好口碑 → 换成具体做了什么、哪个数字、谁在哪说的。
|
|
86
|
+
12. 媒体背书当事实:据多家媒体报道、媒体广泛关注、在社交媒体上相当活跃、具有一定的能见度 → 给具体媒体名和日期,或直接说事实。
|
|
87
|
+
13. 展望式收尾:未来可期、前景广阔、拭目以待、值得期待、大有可为 → 删掉,正文写完就停。
|
|
88
|
+
14. 对话式开场:说到 X 就不得不提 Y、提到 X 很多人会想到 → 删掉破题,直接给事实。
|
|
89
|
+
15. 知识截止免责与笼统保证:由于我的知识截止于……、建议您查阅最新信息、确保内容符合要求、在保留原意的同时提升了可读性 → 查不到就说缺哪个来源;说清改了哪一句。
|
|
90
|
+
16. 谄媚式附和:你说得对、您的观察很准确、这是一个很好的角度 → 对的部分直接认同并往下走,错的部分点出来。
|
|
91
|
+
17. 否定链:不能断言、不能保证、不足以证明、不代表一定可行 → 一条判断就够,缺哪条证据就点名。
|
|
92
|
+
18. 同义反复:换言之、换句话说、更准确地说(后面把同一句换个说法再说一遍)→ 删掉,或补一条新证据。
|
|
93
|
+
19. 流程词堆砌:校验、检索、探针、审计、门禁、快照、回滚堆成一串,不说对象也不说数字 → 只写真正执行的那两三件。
|
|
94
|
+
20. 故作沉稳的江湖腔:这话我记下了、这事我心里有数、这笔账我记着、这个问题我先不接 → 日常对话就说「知道了」「好」,别演电影台词。
|
|
95
|
+
|
|
96
|
+
判定顺序同上:独立信息 → 是否空泛 → 文体。`
|
|
97
|
+
|
|
98
|
+
export const CHECKPOINTS = `# A–F 31 个检查点(编辑已有文本时用)
|
|
99
|
+
|
|
100
|
+
A 铺垫代替陈述
|
|
101
|
+
1 不是 X,而是 Y:删只抬高语气的假对比(两部分都提供信息时保留)。
|
|
102
|
+
2 单句收尾与戏剧性碎片:合并重复意思的碎片。
|
|
103
|
+
3 格言与伪深度:修辞没有增加意思就回到具体判断。
|
|
104
|
+
4 起跑式铺垫:「让我们深入看看」「以下是你需要知道的」直接删。
|
|
105
|
+
5 与假想敌辩论:「不要误会,我不是在……」删掉。
|
|
106
|
+
|
|
107
|
+
B 公式化节奏
|
|
108
|
+
6 强凑三段式:逐项检查是否提供独立信息。
|
|
109
|
+
7 句式开头复读:连续同主语可合并。
|
|
110
|
+
8 破折号当万能连接:反复制造悬念时改。
|
|
111
|
+
9 限定词堆叠:「也许可能会」压成一层不确定。
|
|
112
|
+
10 生造复合词与连接号:换成已有定义。
|
|
113
|
+
11 被动与缺主语:施事者已知就改主动。
|
|
114
|
+
|
|
115
|
+
C 拔高与借权威
|
|
116
|
+
12 AI 高频词:赋能、至关重要、深入探讨、无缝、闭环。
|
|
117
|
+
13 意义拔高:「标志着新时代」。
|
|
118
|
+
14 模糊关联:「与……有着密切联系」。
|
|
119
|
+
15 句尾补充式拔高:「彰显了……的追求」。
|
|
120
|
+
16 宣传语:「堪称……梦想天堂」。
|
|
121
|
+
17 借权威:不能把「专家认为」换成编造的机构。
|
|
122
|
+
18 回避「是/有」:「作为……而存在」。
|
|
123
|
+
|
|
124
|
+
D 公式化排版
|
|
125
|
+
19 粗体当装饰:超过跳读需要就减。
|
|
126
|
+
20 装饰性标题:🚀 箭头分隔线。
|
|
127
|
+
21 引号与中文标点:中文正文用中文标点。
|
|
128
|
+
|
|
129
|
+
E 聊天与草稿残留
|
|
130
|
+
22 客服腔:「好问题!……希望这对您有帮助!」
|
|
131
|
+
23 知识边界免责与猜测填充:重复免责删掉,猜测不升级成事实。
|
|
132
|
+
24 首句复读标题:只删没有独立含义的复述。
|
|
133
|
+
25 谈论上一稿:「这一段是刚补充的」不属于正文。
|
|
134
|
+
|
|
135
|
+
F 中文表达的补充检查
|
|
136
|
+
26 层叠的「的」:长定语拆句。
|
|
137
|
+
27 「进行+动词」:换直接动词。
|
|
138
|
+
28 被字句堆叠:与 §11 一起判断。
|
|
139
|
+
29 四字词排比:只处理空泛同义堆叠。
|
|
140
|
+
30 「随着……的发展」式开头:背景没有独立信息就压缩。
|
|
141
|
+
31 套话收尾:「总而言之,让我们拭目以待」。`
|
|
142
|
+
|
|
143
|
+
export const INDEX = `可用部分:direct(全局直白风格)、gpt(英文模型腔调)、deepseek(DeepSeek 中文腔调)、checkpoints(A–F 31 个检查点)、all(全部)。`
|
|
144
|
+
|
|
145
|
+
/** Look up one part by key, defaulting to the union of everything. */
|
|
146
|
+
export function lookup(part) {
|
|
147
|
+
const key = String(part ?? 'all').toLowerCase()
|
|
148
|
+
if (key === 'direct' || key === 'style') return DIRECT
|
|
149
|
+
if (key === 'gpt' || key === 'openai' || key === 'en') return GPT
|
|
150
|
+
if (key === 'deepseek' || key === 'ds' || key === 'zh') return DEEPSEEK
|
|
151
|
+
if (key === 'checkpoints' || key === 'af' || key === 'checklist') return CHECKPOINTS
|
|
152
|
+
if (key === 'all' || key === '') {
|
|
153
|
+
return [DIRECT, GPT, DEEPSEEK, CHECKPOINTS].join('\n\n---\n\n')
|
|
154
|
+
}
|
|
155
|
+
return null
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const PARTS = ['direct', 'gpt', 'deepseek', 'checkpoints', 'all']
|