dsh-bagu 0.13.0 → 0.13.2
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/CONTRIBUTORS.md +42 -0
- package/README.md +9 -0
- package/client.js +1 -13
- package/dsh-plugin.json +1 -1
- package/lib/config.js +1 -3
- package/lib/index.js +486 -475
- package/package.json +3 -2
- package/test/ai-bridge-tools.test.mjs +124 -0
- package/test/schedule.test.mjs +46 -0
- package/test/tools-execute.test.mjs +122 -0
- package/test/update.test.mjs +11 -9
package/CONTRIBUTORS.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributors
|
|
2
|
+
|
|
3
|
+
按代码、测试、报告、词库任一贡献列。排名不分先后。
|
|
4
|
+
|
|
5
|
+
## 代码与缺陷
|
|
6
|
+
|
|
7
|
+
- **[@AlaIchhe](https://github.com/AlaIchhe)**
|
|
8
|
+
PR [#2](https://github.com/hongdougao111/dsh-bagu/pull/2) —— 修 AI 接梗一开就崩。
|
|
9
|
+
`bridge()` 从 `memes.js` 换成新实现后返回 `{hits, usage, tags}`,
|
|
10
|
+
但 AI 分支还按旧版读 `r.same.length`,AI 接梗开着又命中梗时必炸 `TypeError`。
|
|
11
|
+
真机上一天炸了 15 次,因为 `aiBridge` 默认关、条件短路,130 个测试全绿也没暴露。
|
|
12
|
+
他复现、定位到行、给了 `aiHintOf()` 的修法,还顺手发现 `bagu_meme` 那条
|
|
13
|
+
`ReferenceError: list is not defined`。
|
|
14
|
+
|
|
15
|
+
## 词库
|
|
16
|
+
|
|
17
|
+
- **[梗Wiki](https://cnmeme.wiki)** —— 词库全部来自这里。
|
|
18
|
+
6800 多条词条的来源、用法、标签、别名、摘要,是那个站点一条一条攒出来的。
|
|
19
|
+
最值钱的 `usage` 字段(这个梗怎么接)也是它整理的。
|
|
20
|
+
|
|
21
|
+
## 做法与判据
|
|
22
|
+
|
|
23
|
+
- **[thawline/dsh-memewiki](https://github.com/thawline/dsh-memewiki)** ——
|
|
24
|
+
「不等模型来查,先把答案摆在它面前」这个做法是它先做的,词库内联分发也是跟它学的。
|
|
25
|
+
- **[beagle style-criteria](https://github.com/existential-birds/beagle)** ——
|
|
26
|
+
代码注释判据(把代码念一遍的那类)。
|
|
27
|
+
- **[voku/code-slop](https://github.com/voku/agent-skills)** ——
|
|
28
|
+
comments must explain why, never what the code already expresses.
|
|
29
|
+
- **[sloplint](https://github.com/DW-Studio/sloplint)** —— 评分公式。
|
|
30
|
+
- **[lieflat-less-ai-tone](https://github.com/larashero3-dotcom/lieflat-less-ai-tone)** ——
|
|
31
|
+
两轮对照实验语料,1169 篇 / 520 万字。
|
|
32
|
+
|
|
33
|
+
## 语料
|
|
34
|
+
|
|
35
|
+
回归测试里的真人语料,都是从公开页面摘的:孙笑川吧、v吧、B 站评论区、
|
|
36
|
+
git 仓库的 commit message。这些说话的人不知道自己在帮一个插件做校准,
|
|
37
|
+
但没有他们那 200 多条原话,误拦率是量不出来的。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
想加名字就提 PR。改了代码、补了测试、报了能复现的 bug、或者指出一条误拦,
|
|
42
|
+
都算。写清楚做了什么就行,不用客气。
|
package/README.md
CHANGED
|
@@ -226,6 +226,15 @@ npm test # 110 个单元测试
|
|
|
226
226
|
[sloplint](https://github.com/DW-Studio/sloplint)、
|
|
227
227
|
[lieflat-less-ai-tone](https://github.com/larashero3-dotcom/lieflat-less-ai-tone)。
|
|
228
228
|
|
|
229
|
+
## 一起修过的人
|
|
230
|
+
|
|
231
|
+
- [@AlaIchhe](https://github.com/AlaIchhe) —— PR #2。
|
|
232
|
+
AI 接梗一开就崩的那个 `TypeError`,是他先报的、先定位的、先修好的。
|
|
233
|
+
`bridge()` 换了来源但字段名没跟着换,这种半截重构我漏了一整轮。
|
|
234
|
+
他还顺手发现 `bagu_meme` 那条 `ReferenceError: list is not defined`。
|
|
235
|
+
|
|
236
|
+
完整名单见 [CONTRIBUTORS.md](CONTRIBUTORS.md)。
|
|
237
|
+
|
|
229
238
|
## 许可
|
|
230
239
|
|
|
231
240
|
MIT。词库数据来自梗Wiki,使用时请一并保留对其的署名。
|
package/client.js
CHANGED
|
@@ -335,19 +335,7 @@ window.__ModuleLoader__.load({
|
|
|
335
335
|
onChange: () => save({ autoUpdate: view.autoUpdate === false }),
|
|
336
336
|
})),
|
|
337
337
|
|
|
338
|
-
|
|
339
|
-
h('div', { 'data-bg-grow': '' },
|
|
340
|
-
h('div', { 'data-bg-label': '' }, '每天几点'),
|
|
341
|
-
h('div', { 'data-bg-note': '' },
|
|
342
|
-
'凌晨机器闲着,四点最稳。更新只补新词条,不动你改过的。')),
|
|
343
|
-
h('select', {
|
|
344
|
-
'data-bg-num': '', 'data-wide': '', value: String(view.updateHour ?? 4),
|
|
345
|
-
disabled: busy === 'save',
|
|
346
|
-
onChange: (e) => save({ updateHour: Number(e.target.value) }),
|
|
347
|
-
},
|
|
348
|
-
Array.from({ length: 24 }, (_, i) =>
|
|
349
|
-
h('option', { key: i, value: String(i) },
|
|
350
|
-
String(i).padStart(2, '0') + ':00')))) : null,
|
|
338
|
+
|
|
351
339
|
|
|
352
340
|
h(Row, {
|
|
353
341
|
label: view.toneSwitch ? '尺度:自己定' : '尺度:交给模型',
|
package/dsh-plugin.json
CHANGED
package/lib/config.js
CHANGED
|
@@ -30,10 +30,8 @@ export const DEFAULTS = {
|
|
|
30
30
|
memes: true,
|
|
31
31
|
/** 每轮请求前自动查词库并注入。关掉就只在主动调工具时查。 */
|
|
32
32
|
autoMeme: true,
|
|
33
|
-
/**
|
|
33
|
+
/** 词库自动更新:DSH 开着、距上次超过 20 小时就补。关掉就不再联网。 */
|
|
34
34
|
autoUpdate: true,
|
|
35
|
-
/** 每天几点更新,0-23。默认凌晨 4 点。 */
|
|
36
|
-
updateHour: 4,
|
|
37
35
|
/** 手动接管玩梗尺度。关着时交给模型自己判断。 */
|
|
38
36
|
toneSwitch: false,
|
|
39
37
|
/** 玩梗尺度 0-100。toneSwitch 关着时不生效。 */
|