dsh-echo-guard 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -45,21 +45,23 @@ Configure via `cordis.patch.yml`. **Start with `dryRun: true`** for a day.
45
45
  ## Fillers
46
46
 
47
47
  ```yaml
48
- fillers: ["好", "嗯"] # Chinese
49
- fillers: ["OK", "let me go"] # English, case-insensitive
48
+ fillers: ["好", "嗯", "OK", "let me go"] # two Chinese, two English — default since 0.2.1
50
49
  ```
51
50
 
52
51
  - **Counting** includes occurrences inside words (`好` inside `好像`, `OK` inside `Okay`).
53
52
  - **Deletion** only removes standalone ones: preceded by a non-word char, followed by punctuation/space/EOL.
54
53
  - CJK uses character boundaries, Latin uses alphanumeric boundaries; multi-word phrases are removed whole.
54
+ - Drop a word from `fillers` to stop treating it as filler.
55
55
 
56
56
  ### Per-word thresholds (0.2.0)
57
57
 
58
58
  ```yaml
59
- fillers: ["好", "嗯"]
59
+ fillers: ["好", "嗯", "OK", "let me go"]
60
60
  fillerMinCounts:
61
61
  "好": 5
62
62
  "嗯": 3
63
+ "OK": 5
64
+ "let me go": 3
63
65
  burstMinCount: 5 # fallback for words without their own threshold
64
66
  ```
65
67
 
@@ -94,7 +96,7 @@ Hence the threshold of 5, aimed at the "one per sentence" drift.
94
96
 
95
97
  ## Version and testing
96
98
 
97
- **Version 0.2.0.** (0.1.0 → 0.2.0: per-word thresholds; manual `/strip-last` and request-file entry; the manual path never touches a running step.)
99
+ **Version 0.2.1.** (0.1.0 → 0.2.0: per-word thresholds; manual `/strip-last` and request-file entry. 0.2.0 → 0.2.1: `OK` and `let me go` added to the default filler list.)
98
100
 
99
101
  Verified on 2026-12-05 with:
100
102
 
package/README.md CHANGED
@@ -49,8 +49,7 @@ pnpm add dsh-echo-guard
49
49
  ## 词表
50
50
 
51
51
  ```yaml
52
- fillers: ["好", "嗯"] # 中文
53
- fillers: ["OK", "let me go"] # 英文,大小写不敏感
52
+ fillers: ["好", "嗯", "OK", "let me go"] # 中英各两个,0.2.1 起的默认
54
53
  ```
55
54
 
56
55
  规则:
@@ -58,14 +57,17 @@ fillers: ["OK", "let me go"] # 英文,大小写不敏感
58
57
  - **计数**算全部:`好` 会数进「好像」,`OK` 会数进 `Okay`。
59
58
  - **删除**只删单独成句的:前面不是词、后面是标点/空白/行尾。
60
59
  - 中文按汉字边界判,英文按字母数字边界判;多词短语(`let me go`)整句删。
60
+ - 不想要哪个词,从 `fillers` 里删掉就行——计数和删除都只认名单里的。
61
61
 
62
62
  ### 每个词各算各的(0.2.0)
63
63
 
64
64
  ```yaml
65
- fillers: ["好", "嗯"]
65
+ fillers: ["好", "嗯", "OK", "let me go"]
66
66
  fillerMinCounts:
67
67
  "好": 5
68
68
  "嗯": 3
69
+ "OK": 5
70
+ "let me go": 3
69
71
  burstMinCount: 5 # 没单独配的词用这个
70
72
  ```
71
73
 
@@ -112,7 +114,7 @@ manual:
112
114
 
113
115
  ## 版本与验证
114
116
 
115
- **版本 0.2.0。**(0.1.0 → 0.2.0:每个词各算各的门槛;新增手动清上一轮 `/strip-last` 和请求文件入口;手动那条不碰正在跑的步。)
117
+ **版本 0.2.1。**(0.1.0 → 0.2.0:每个词各算各的门槛;新增手动清上一轮 `/strip-last` 和请求文件入口。0.2.0 → 0.2.1:默认词表加上 `OK`、`let me go`。)
116
118
 
117
119
  在以下环境实测通过(2026-12-05):
118
120
 
package/cordis.patch.yml CHANGED
@@ -6,17 +6,21 @@
6
6
  config:
7
7
  enabled: true
8
8
 
9
- # 哪些词算「收束词灌水」。中文常见这两个;英文可以写 ["OK", "let me go", "alright"]。
10
- # 计数算全部(「好像」里的「好」也算),删除只删单独成句的那一个。
9
+ # 哪些词算「收束词灌水」。0.2.1 起默认带中英各两个;不想要的从名单里删掉即可。
10
+ # 计数算全部(「好像」里的「好」、「Okay」里的「OK」也算),删除只删单独成句的那一个。
11
11
  fillers:
12
12
  - "好"
13
13
  - "嗯"
14
+ - "OK"
15
+ - "let me go"
14
16
 
15
17
  # 每个词各算各的门槛,不互相凑数。
16
18
  # 例:好 够 5 次才算,嗯 够 3 次就算;「好 4 + 嗯 2」不算命中。
17
19
  fillerMinCounts:
18
20
  "好": 5
19
21
  "嗯": 3
22
+ "OK": 5
23
+ "let me go": 3
20
24
 
21
25
  # 没在 fillerMinCounts 里单独配的词,用这个数。
22
26
  burstMinCount: 5
package/lib/core.mjs CHANGED
@@ -8,7 +8,10 @@
8
8
  // - **删除**只删单独成句的那一个:前后都不是词的一部分才删。
9
9
  // 这条区分是整套逻辑的关键,别简化。
10
10
 
11
- export const DEFAULT_FILLERS = ['好', '嗯']
11
+ // 默认词表:中文两个 + 英文两个。英文那两个原本是「让人自己加」,
12
+ // 0.2.1 起放进默认——这个包是给外面的人用的,英文思考里 OK / let me go 一样常见。
13
+ // 不想删哪个,从 fillers 里去掉就行(计数和删除都只认名单里的)。
14
+ export const DEFAULT_FILLERS = ['好', '嗯', 'OK', 'let me go']
12
15
 
13
16
  // 跟着被删词一起带走的标点(中文、中文全角、英文常见)
14
17
  const TRAILING_PUNCT = '[,,、。.!!??;;::.…")”’]'
package/lib/index.mjs CHANGED
@@ -142,7 +142,14 @@ export function apply(ctx, config = {}) {
142
142
  burstMinCount: Number.isSafeInteger(config.burstMinCount) ? config.burstMinCount : 5,
143
143
  // 每个词各算各的门槛;没配的词用 burstMinCount。
144
144
  // 例:{ "好": 5, "嗯": 3 } —— 好 够 5 次才算,嗯 够 3 次就算,不互相凑。
145
- fillerMinCounts: config.fillerMinCounts && typeof config.fillerMinCounts === 'object' ? config.fillerMinCounts : {},
145
+ // 默认给英文两个也配了:OK 跟「好」同级,"let me go" 这种整句短语门槛低一档。
146
+ fillerMinCounts: {
147
+ 好: 5,
148
+ 嗯: 3,
149
+ OK: 5,
150
+ 'let me go': 3,
151
+ ...(config.fillerMinCounts && typeof config.fillerMinCounts === 'object' ? config.fillerMinCounts : {})
152
+ },
146
153
  receipt: typeof config.receipt === 'string' ? config.receipt : DEFAULT_RECEIPT,
147
154
  // 删完剩不到两成就放弃:整段都是收束词时删光只会剩个空块,不如留着。
148
155
  stripMinKeepRatio: typeof config.stripMinKeepRatio === 'number' ? config.stripMinKeepRatio : 0.2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-echo-guard",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Strips filler-word bursts out of the model-visible reasoning history — only standalone occurrences, everything else verbatim. DSH plugin.",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",