qq-bot-roost 1.0.7 → 1.0.8
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.md +1 -1
- package/package.json +57 -57
- package/src/instance.js +9 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="零依赖">
|
|
11
11
|
<img src="https://img.shields.io/badge/tests-813%20passed-brightgreen" alt="测试 813 项">
|
|
12
12
|
<img src="https://img.shields.io/badge/plugins-JS%20%7C%20Python%20%7C%20Go%20%7C%20any-blue" alt="多语言插件">
|
|
13
|
-
<img src="https://img.shields.io/badge/version-1.0.
|
|
13
|
+
<img src="https://img.shields.io/badge/version-1.0.8-blueviolet" alt="版本 1.0.8">
|
|
14
14
|
<img src="https://img.shields.io/badge/license-Non--Commercial-red" alt="禁止商用">
|
|
15
15
|
<a href="https://github.com/tdcq9594/qq-bot-roost/actions"><img src="https://img.shields.io/github/actions/workflow/status/tdcq9594/qq-bot-roost/ci.yml?branch=master" alt="CI"></a>
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "qq-bot-roost",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "栖 Roost:零依赖的 QQ 官方机器人框架,填 AppID/AppSecret 即连,插件可写任意语言",
|
|
6
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/tdcq9594/qq-bot-roost.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/tdcq9594/qq-bot-roost/issues"
|
|
13
|
-
},
|
|
14
|
-
"homepage": "https://github.com/tdcq9594/qq-bot-roost#readme",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"qq-bot",
|
|
17
|
-
"qqbot",
|
|
18
|
-
"bot-framework",
|
|
19
|
-
"qq-official-bot",
|
|
20
|
-
"roost",
|
|
21
|
-
"multi-bot",
|
|
22
|
-
"plugin",
|
|
23
|
-
"zero-dependency"
|
|
24
|
-
],
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">=22.13"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"start": "node src/main.js",
|
|
30
|
-
"mock": "node src/main.js --mock",
|
|
31
|
-
"check": "node src/main.js --check",
|
|
32
|
-
"test": "node test/selftest.mjs && node test/qrlogin.mjs && node test/deps.mjs && node --test test/trust.mjs && node --test test/manifest.mjs && node --test test/trace.mjs && node --test test/fuzz-tar.mjs && node --test test/group-name.mjs && node --test test/identity.mjs && node --test test/identity-commands.mjs && node --test test/mail.mjs && node --test test/ledger-outbound.mjs && node --test test/api-record.mjs",
|
|
33
|
-
"test:e2e": "node test/e2e.mjs",
|
|
34
|
-
"test:all": "node test/selftest.mjs && node test/qrlogin.mjs && node test/deps.mjs && node --test test/trust.mjs && node --test test/manifest.mjs && node --test test/trace.mjs && node --test test/fuzz-tar.mjs && node --test test/group-name.mjs && node --test test/identity.mjs && node --test test/identity-commands.mjs && node --test test/mail.mjs && node --test test/ledger-outbound.mjs && node --test test/api-record.mjs && node test/e2e.mjs && node test/live-driver.mjs",
|
|
35
|
-
"check:secrets": "node scripts/check-secrets.mjs",
|
|
36
|
-
"create": "node scripts/create-plugin.mjs",
|
|
37
|
-
"test:plugin": "node scripts/test-plugin.mjs",
|
|
38
|
-
"live": "node scripts/live-test.mjs",
|
|
39
|
-
"market:index": "node scripts/build-market-index.mjs",
|
|
40
|
-
"sums": "node scripts/build-sums.mjs",
|
|
41
|
-
"sums:check": "node scripts/build-sums.mjs --check",
|
|
42
|
-
"sums:verify": "node scripts/build-sums.mjs --verify",
|
|
43
|
-
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=95 --test-coverage-branches=80 --test-coverage-include=src/trust.js --test-coverage-include=src/plugin/manifest.js --test-coverage-include=src/trace.js --test test/trust.mjs test/manifest.mjs test/trace.mjs"
|
|
44
|
-
},
|
|
45
|
-
"author": {
|
|
46
|
-
"name": "倦飞之鸟"
|
|
47
|
-
},
|
|
48
|
-
"files": [
|
|
49
|
-
"src",
|
|
50
|
-
"web",
|
|
51
|
-
"sdk",
|
|
52
|
-
"types",
|
|
53
|
-
"config/*.example.json",
|
|
54
|
-
"README.md",
|
|
55
|
-
"LICENSE"
|
|
56
|
-
]
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "qq-bot-roost",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "栖 Roost:零依赖的 QQ 官方机器人框架,填 AppID/AppSecret 即连,插件可写任意语言",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/tdcq9594/qq-bot-roost.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/tdcq9594/qq-bot-roost/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/tdcq9594/qq-bot-roost#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"qq-bot",
|
|
17
|
+
"qqbot",
|
|
18
|
+
"bot-framework",
|
|
19
|
+
"qq-official-bot",
|
|
20
|
+
"roost",
|
|
21
|
+
"multi-bot",
|
|
22
|
+
"plugin",
|
|
23
|
+
"zero-dependency"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22.13"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"start": "node src/main.js",
|
|
30
|
+
"mock": "node src/main.js --mock",
|
|
31
|
+
"check": "node src/main.js --check",
|
|
32
|
+
"test": "node test/selftest.mjs && node test/qrlogin.mjs && node test/deps.mjs && node --test test/trust.mjs && node --test test/manifest.mjs && node --test test/trace.mjs && node --test test/fuzz-tar.mjs && node --test test/group-name.mjs && node --test test/identity.mjs && node --test test/identity-commands.mjs && node --test test/mail.mjs && node --test test/ledger-outbound.mjs && node --test test/api-record.mjs",
|
|
33
|
+
"test:e2e": "node test/e2e.mjs",
|
|
34
|
+
"test:all": "node test/selftest.mjs && node test/qrlogin.mjs && node test/deps.mjs && node --test test/trust.mjs && node --test test/manifest.mjs && node --test test/trace.mjs && node --test test/fuzz-tar.mjs && node --test test/group-name.mjs && node --test test/identity.mjs && node --test test/identity-commands.mjs && node --test test/mail.mjs && node --test test/ledger-outbound.mjs && node --test test/api-record.mjs && node test/e2e.mjs && node test/live-driver.mjs",
|
|
35
|
+
"check:secrets": "node scripts/check-secrets.mjs",
|
|
36
|
+
"create": "node scripts/create-plugin.mjs",
|
|
37
|
+
"test:plugin": "node scripts/test-plugin.mjs",
|
|
38
|
+
"live": "node scripts/live-test.mjs",
|
|
39
|
+
"market:index": "node scripts/build-market-index.mjs",
|
|
40
|
+
"sums": "node scripts/build-sums.mjs",
|
|
41
|
+
"sums:check": "node scripts/build-sums.mjs --check",
|
|
42
|
+
"sums:verify": "node scripts/build-sums.mjs --verify",
|
|
43
|
+
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=95 --test-coverage-branches=80 --test-coverage-include=src/trust.js --test-coverage-include=src/plugin/manifest.js --test-coverage-include=src/trace.js --test test/trust.mjs test/manifest.mjs test/trace.mjs"
|
|
44
|
+
},
|
|
45
|
+
"author": {
|
|
46
|
+
"name": "倦飞之鸟"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"src",
|
|
50
|
+
"web",
|
|
51
|
+
"sdk",
|
|
52
|
+
"types",
|
|
53
|
+
"config/*.example.json",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE"
|
|
56
|
+
]
|
|
57
|
+
}
|
package/src/instance.js
CHANGED
|
@@ -83,6 +83,15 @@ function pidLooksLikeNode(pid) {
|
|
|
83
83
|
/** pid 是否还活着(且确实是 node 进程)。EPERM 说明进程存在但没权限,也算活着 */
|
|
84
84
|
function isAlive(pid) {
|
|
85
85
|
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
86
|
+
/**
|
|
87
|
+
* 问「我自己还活着吗」恒为真,不用查进程名。
|
|
88
|
+
*
|
|
89
|
+
* 「进程名是不是 node」那一步是为了识别 **PID 复用**——系统把回收的 pid 分给了
|
|
90
|
+
* 别的程序。可这件事对自己根本不适用:pid 就是我的,那个进程当然是我。
|
|
91
|
+
* 而多查这一步反而会出错:CI 的 ubuntu + Node 24 上,面板「实例锁」把
|
|
92
|
+
* 本进程自己那条显示成「已退出」(自检里 635/636 就挂在这一条)。
|
|
93
|
+
*/
|
|
94
|
+
if (pid === process.pid) return true;
|
|
86
95
|
try {
|
|
87
96
|
process.kill(pid, 0);
|
|
88
97
|
} catch (e) {
|