@zxh126/pi-qqbot 2.0.0 → 2.0.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/CHANGELOG.md +23 -0
- package/README.md +13 -1
- package/docs/README.zh-CN.md +13 -1
- package/index.ts +71 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
本文件记录 pi-qqbot 的版本变更。格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
4
4
|
版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
5
5
|
|
|
6
|
+
## [2.0.1] - 2026-10-25
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- **口令语序:「暂停汇报进度」之前不被识别**,会漏成普通对话丢给模型。现在「暂停**进度汇报**」与
|
|
11
|
+
「暂停**汇报进度**」两种语序都认;「别汇报了**吧**」这类双尾字也不再漏。
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **口语静音词扩充**:「别汇报了」「别说了」「别讲了」「别推了」「别发了」「别报了」「闭嘴」「安静」
|
|
16
|
+
「打住」「甭」等,与 `/progress off` 等价(恢复用「恢复汇报」「接着说」)。
|
|
17
|
+
- **「停」改为中断任务**(按用户反馈):`停`/`停下`/`停一下`/`停停`/`停掉`/`别跑了` 归入 `RE_CANCEL`,
|
|
18
|
+
与 `/cancel` 完全等价;只有带名词的「停止汇报」或纯闭嘴词才是静音。
|
|
19
|
+
- **主动问进度归为指令**:「汇报一下当前进度」「看一下进度」「说说进度」「进度如何」「进度怎么样」
|
|
20
|
+
不再当聊天转给 pi,忙时回一次摘要且不入队,空闲时直接回「当前没有正在运行的任务」。
|
|
21
|
+
- `/help` 区分两种语义:只关推送用 `/progress off`/「别汇报了」/「闭嘴」;「停」是中断任务。
|
|
22
|
+
- 两份 README 新增「口语说法」对照表(意图 → 可说的话)。
|
|
23
|
+
|
|
24
|
+
### Tests
|
|
25
|
+
|
|
26
|
+
- `test/progress.test.mjs` 16 → 22 个用例(新增 / 改写:语序两边、口语静音词、
|
|
27
|
+
「停/停下/停一下/停止/取消」均为中断、「停止汇报」仍为静音、主动问进度三姿态、口令不误伤)。
|
|
28
|
+
|
|
6
29
|
## [2.0.0] - 2026-10-25
|
|
7
30
|
|
|
8
31
|
### Added
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ Start pi, then message the bot in QQ; pi handles it and replies.
|
|
|
100
100
|
| `/progress` | **Show the current progress summary immediately** (aliases: `/p`, 「进度」, 「当前进度」, 「进展」; plain-text questions like 「到哪了」「怎么样了」 work while busy). While you paused reports yourself it only replies once — use `/progress on` to resume; while reports are merely quota-quiet, asking resumes them |
|
|
101
101
|
| `/progress off` | **Pause automatic progress reports for the rest of the session** (aliases: `pause`, `stop`, `暂停`, 「暂停汇报」, 「关闭汇报」). Manual `/progress` still works, it just no longer resumes the timer |
|
|
102
102
|
| `/progress on` | **Resume automatic progress reports** (aliases: `resume`, `start`, `恢复`, 「恢复汇报」, 「继续汇报」) |
|
|
103
|
-
| `/cancel` | **Interrupt the task that is running right now** and empty the queue (aliases: `/stop`, `/abort`, 「取消」, 「停止」, 「中止」, 「终止」,
|
|
103
|
+
| `/cancel` | **Interrupt the task that is running right now** and empty the queue (aliases: `/stop`, `/abort`, 「取消」, 「停止」, 「中止」, 「终止」, 「算了」, 「停」, 「停下」, 「停一下」, 「别跑了」). Note: a bare 「停」 interrupts the *task*; to silence progress reports say 「别汇报了」/「闭嘴」 or `/progress off` |
|
|
104
104
|
| `/help` | Show help |
|
|
105
105
|
|
|
106
106
|
### Slash commands from QQ
|
|
@@ -226,6 +226,18 @@ While a run is in progress, a summary is pushed to QQ every `progress.intervalMs
|
|
|
226
226
|
- Timer is cleared on `agent_settled` / `/cancel` / session shutdown.
|
|
227
227
|
- Set `progress.enabled: false` to turn the whole thing off (across sessions; read at session start).
|
|
228
228
|
|
|
229
|
+
#### Colloquial shortcuts (Chinese, matched only as a whole message)
|
|
230
|
+
|
|
231
|
+
| Intent | Say any of |
|
|
232
|
+
|---|---|
|
|
233
|
+
| Pause automatic reports | 「暂停汇报进度」「暂停进度汇报」「别汇报了」「别说了」「闭嘴」「安静」「打住」「停止汇报」, or `/progress off` |
|
|
234
|
+
| Resume them | 「恢复汇报」「恢复汇报进度」「接着说」「说下去」, or `/progress on` |
|
|
235
|
+
| Ask once | 「汇报一下当前进度」「看一下进度」「说说进度」「进度如何」「进度怎么样」, or `/progress` |
|
|
236
|
+
| Interrupt the task | 「停」「停下」「停一下」「停停」「停止」「取消」「别跑了」, or `/cancel` |
|
|
237
|
+
|
|
238
|
+
A bare 「停」 interrupts the **task**; only phrases carrying a report noun (「停止汇报」) or an explicit
|
|
239
|
+
silence word (「别说了」「闭嘴」) pause the reports. Sentences like 「帮我加个进度条」 are still forwarded to pi.
|
|
240
|
+
|
|
229
241
|
### Cancelling a run
|
|
230
242
|
|
|
231
243
|
Long tasks started from QQ (installs, builds, a runaway agent loop) can be interrupted without going
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -98,7 +98,7 @@ pi install ./pi-qqbot
|
|
|
98
98
|
| `/progress` | **立即获取当前进度摘要**(别名 `/p`、「进度」「当前进度」「进展」;忙碌时「到哪了」「怎么样了」这类问法同样生效)。手动暂停期间**问一次只回一次**,要重新打开定时汇报需发 `/progress on` 或「恢复汇报」;若只是配额静默,问一次即恢复 |
|
|
99
99
|
| `/progress off` | **在本会话内暂停自动进度汇报**(别名:`pause`、`stop`、`暂停`、「暂停汇报」、「关闭汇报」)。手动 `/progress` 仍可看一次,但不再解除暂停 |
|
|
100
100
|
| `/progress on` | **恢复自动进度汇报**(别名:`resume`、`start`、`恢复`、「恢复汇报」、「继续汇报」) |
|
|
101
|
-
| `/cancel` | **中断当前正在运行的任务**并清空队列(别名:`/stop`、`/abort
|
|
101
|
+
| `/cancel` | **中断当前正在运行的任务**并清空队列(别名:`/stop`、`/abort`、「取消」、「停止」、「中止」、「终止」、「算了」、「停」、「停下」、「停一下」、「别跑了」)。注意:单说「停」是中断**任务**,要关进度推送请说「别汇报了」「闭嘴」或 `/progress off` |
|
|
102
102
|
| `/help` | 帮助 |
|
|
103
103
|
|
|
104
104
|
### QQ 里的斜杠命令
|
|
@@ -213,6 +213,18 @@ pi 的会话一次只跑一轮 agent run,所以串行调度由 bot 自己做
|
|
|
213
213
|
- `agent_settled` / `/cancel` / 会话关闭时定时器都会清掉。
|
|
214
214
|
- 想彻底关掉(跨会话):`progress.enabled: false`(改完需 `/new` 或重启才生效)。
|
|
215
215
|
|
|
216
|
+
#### 口语说法(整句匹配,只在发整句时生效)
|
|
217
|
+
|
|
218
|
+
| 意图 | 可以说 |
|
|
219
|
+
|---|---|
|
|
220
|
+
| 暂停自动汇报 | 「暂停汇报进度」「暂停进度汇报」「别汇报了」「别说了」「闭嘴」「安静」「打住」「停止汇报」,或 `/progress off` |
|
|
221
|
+
| 恢复自动汇报 | 「恢复汇报」「恢复汇报进度」「接着说」「说下去」,或 `/progress on` |
|
|
222
|
+
| 看一次当前进度 | 「汇报一下当前进度」「看一下进度」「说说进度」「进度如何」「进度怎么样」,或 `/progress` |
|
|
223
|
+
| 中断当前任务 | 「停」「停下」「停一下」「停停」「停止」「取消」「别跑了」,或 `/cancel` |
|
|
224
|
+
|
|
225
|
+
单说「停」是中断**任务**;只有带名词的(「停止汇报」)或明确的闭嘴词(「别说了」「闭嘴」)才是暂停汇报。
|
|
226
|
+
「帮我加个进度条」这种任务句仍照常转给 pi,不会被当成口令。
|
|
227
|
+
|
|
216
228
|
### 取消正在运行的任务
|
|
217
229
|
|
|
218
230
|
从 QQ 发起的耗时任务(装依赖、编译、agent 跑飞了)不必回到机器上处理:
|
package/index.ts
CHANGED
|
@@ -484,8 +484,15 @@ export default function (
|
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
/** 取消/停止这类「打断当前任务」的表达 */
|
|
487
|
+
/**
|
|
488
|
+
* 取消/停止这类「打断当前任务」的表达。
|
|
489
|
+
*
|
|
490
|
+
* 注意分工:「停」「停下」「停一下」属于**中断任务**(用户定的:停 = 停止干活);
|
|
491
|
+
* 想只关掉进度推送请用「别汇报了」「闭嘴」「/progress off」;
|
|
492
|
+
* 「停止汇报」因为带了名词,不算取消,走静音。
|
|
493
|
+
*/
|
|
487
494
|
const RE_CANCEL =
|
|
488
|
-
/^(\/cancel|\/stop|\/abort
|
|
495
|
+
/^(\/cancel|\/stop|\/abort|取消|停止|中止|终止|算了|停|停下|停一下|停停|停掉|别跑了|cancel|stop|abort)$/i;
|
|
489
496
|
|
|
490
497
|
function isCancelIntent(text: string): boolean {
|
|
491
498
|
return RE_CANCEL.test(text.trim());
|
|
@@ -880,7 +887,8 @@ export async function handleMessage(
|
|
|
880
887
|
"/status — 查看状态(当前 qqbot / 忙闲 / 队列 / 自动同意 / 待审批 / 自动汇报)",
|
|
881
888
|
"/queue — 查看队列;/queue clear 清空;/queue drop <编号> 删一条",
|
|
882
889
|
"/reset — 清空回复缓冲、审批记忆与自动同意(不换会话;换会话发 /new)",
|
|
883
|
-
"/cancel
|
|
890
|
+
"/cancel(或「取消」「停止」「停」)— 中断正在运行的任务并清空队列",
|
|
891
|
+
"只关进度推送:/progress off(或「别汇报了」「闭嘴」);「停」是中断任务,不是静音",
|
|
884
892
|
"/help — 帮助",
|
|
885
893
|
"pi 的命令优先:/reload /new /compact /session /name /model /thinking,以及扩展命令、模板与 /skill:xxx。",
|
|
886
894
|
"忙碌时发来的普通消息(含模板/skill 命令)会排队,当前任务结束后自动执行。",
|
|
@@ -1109,14 +1117,65 @@ const UNMUTE_ARGS = new Set([
|
|
|
1109
1117
|
"继续汇报",
|
|
1110
1118
|
]);
|
|
1111
1119
|
|
|
1112
|
-
/**
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1120
|
+
/**
|
|
1121
|
+
* 不带斜杠的口令(整句匹配,避免误伤正常聊天)。
|
|
1122
|
+
*
|
|
1123
|
+
* 三类:
|
|
1124
|
+
* 1. 问进度:「汇报一下当前进度」「看一下进度」「进度如何」→ 回一次摘要
|
|
1125
|
+
* 2. 静音:「暂停汇报进度」「别汇报了」「别说了」「闭嘴」「停」→ 暂停自动汇报
|
|
1126
|
+
* 3. 恢复:「恢复汇报」「接着说」→ 重新打开自动汇报
|
|
1127
|
+
*
|
|
1128
|
+
* 注意:「停止/取消/中止」是**中断任务**(RE_CANCEL,更早判定),不是静音;
|
|
1129
|
+
* 「停止汇报」才走静音。
|
|
1130
|
+
*/
|
|
1131
|
+
const REPORT_LEAD = "(?:请|帮我|给我|麻烦|暂时|先)?\\s*";
|
|
1132
|
+
/** 汇报名词的两种语序(进度汇报 / 汇报进度) */
|
|
1133
|
+
const REPORT_NOUN =
|
|
1134
|
+
"(?:(?:进度|进展)(?:汇报|报告|推送|播报|上报)?|(?:汇报|报告|推送|播报|上报)(?:进度|进展)?)";
|
|
1135
|
+
const REPORT_TAIL = "\\s*(?:了|吧|哦|啊|呀|嘛|啦|呗)*";
|
|
1136
|
+
|
|
1137
|
+
/** 问进度(含「汇报一下…」这类祈使句) */
|
|
1138
|
+
const BARE_PROGRESS_RE = new RegExp(
|
|
1139
|
+
"^" +
|
|
1140
|
+
REPORT_LEAD +
|
|
1141
|
+
"(?:(?:汇报|报告|报|说说|讲讲|看|看看|查|查查|查看|显示|展示)(?:一下|下|个|一眼)?\\s*)?" +
|
|
1142
|
+
"(?:当前|现在|目前)?\\s*(?:的)?\\s*(?:progress|进度|进展)" +
|
|
1143
|
+
"(?:\\s*(?:如何|怎么样|怎样|呢|啦|了|吗))?" +
|
|
1144
|
+
"(?:\\s+([\\s\\S]*))?$",
|
|
1145
|
+
"i",
|
|
1146
|
+
);
|
|
1147
|
+
|
|
1148
|
+
/** 静音:带「汇报」名词的 */
|
|
1149
|
+
const RE_REPORTS_OFF = new RegExp(
|
|
1150
|
+
"^" +
|
|
1151
|
+
REPORT_LEAD +
|
|
1152
|
+
"(?:暂停|停止|停下|关闭|关掉|别再|别|不要|不用|甭|闭嘴|安静|打住)\\s*" +
|
|
1153
|
+
"(?:自动|定时|定期)?\\s*(?:的)?\\s*" +
|
|
1154
|
+
REPORT_NOUN +
|
|
1155
|
+
REPORT_TAIL +
|
|
1156
|
+
"$",
|
|
1157
|
+
);
|
|
1158
|
+
/** 静音:不提「汇报」的纯闭嘴类(停/停下 不在此列——它们属于中断任务) */
|
|
1159
|
+
const RE_SILENCE = new RegExp(
|
|
1160
|
+
"^" +
|
|
1161
|
+
REPORT_LEAD +
|
|
1162
|
+
"(?:闭嘴|安静|安静点|安静下|别说了|别讲了|别吵了?|别推了|别发了|别报了|打住)" +
|
|
1163
|
+
REPORT_TAIL +
|
|
1164
|
+
"$",
|
|
1165
|
+
);
|
|
1166
|
+
/** 恢复:说清楚要恢复汇报,或者「接着说」 */
|
|
1167
|
+
const RE_REPORTS_ON = new RegExp(
|
|
1168
|
+
"^" +
|
|
1169
|
+
REPORT_LEAD +
|
|
1170
|
+
"(?:恢复|继续|开启|打开|开始|接着说|接着说吧|说下去|接着报)\\s*" +
|
|
1171
|
+
"(?:自动|定时|定期)?\\s*(?:的)?\\s*" +
|
|
1172
|
+
REPORT_NOUN +
|
|
1173
|
+
REPORT_TAIL +
|
|
1174
|
+
"$",
|
|
1175
|
+
);
|
|
1176
|
+
const RE_RESUME_TALK = new RegExp("^" + REPORT_LEAD + "(?:接着说|说下去|接着报)" + REPORT_TAIL + "$");
|
|
1117
1177
|
|
|
1118
|
-
/**
|
|
1119
|
-
const BARE_PROGRESS_RE = /^(?:progress|(?:当前|现在|目前)?的?(?:进度|进展))(?:\s+([\s\S]*))?$/i;
|
|
1178
|
+
/** 不带斜杠的进度问询:「进度」「当前进度」「汇报一下当前进度」(可带子命令) */
|
|
1120
1179
|
|
|
1121
1180
|
function parseCommand(text: string): { name: "reset" | "status" | "help" | "queue" | "progress"; args: string } | null {
|
|
1122
1181
|
// 注意:/new 现在属于 pi 的内置命令(由 slash 路由接管,真的开新会话),
|
|
@@ -1132,11 +1191,11 @@ function parseCommand(text: string): { name: "reset" | "status" | "help" | "queu
|
|
|
1132
1191
|
args: (slash[2] ?? "").trim(),
|
|
1133
1192
|
};
|
|
1134
1193
|
}
|
|
1135
|
-
//
|
|
1194
|
+
// 裸文本:先认「问进度」,再认「静音/恢复」
|
|
1136
1195
|
const bare = BARE_PROGRESS_RE.exec(t);
|
|
1137
1196
|
if (bare) return { name: "progress", args: (bare[1] ?? "").trim() };
|
|
1138
|
-
if (RE_REPORTS_OFF.test(t)) return { name: "progress", args: "off" };
|
|
1139
|
-
if (RE_REPORTS_ON.test(t)) return { name: "progress", args: "on" };
|
|
1197
|
+
if (RE_REPORTS_OFF.test(t) || RE_SILENCE.test(t)) return { name: "progress", args: "off" };
|
|
1198
|
+
if (RE_REPORTS_ON.test(t) || RE_RESUME_TALK.test(t)) return { name: "progress", args: "on" };
|
|
1140
1199
|
return null;
|
|
1141
1200
|
}
|
|
1142
1201
|
|