dsh-klbq 0.2.1 → 0.3.0
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 +60 -2
- package/lib/index.js +154 -15
- package/lib/qqbot.js +152 -149
- package/lib/render.js +161 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# dsh-klbq
|
|
2
2
|
|
|
3
3
|
卡拉彼丘(Strinova)战绩查询的 DSH 插件:按游戏昵称从 [dakanu.com](https://dakanu.com) 取数,
|
|
4
|
-
|
|
4
|
+
渲染成长图(排位段位 / 总览 / 模式 / 角色 / 最近对局,以及组队胜率榜),
|
|
5
|
+
并把工具 `klbq_query`、`klbq_teammates` 暴露给 agent。
|
|
5
6
|
|
|
6
7
|
## 提供的工具
|
|
7
8
|
|
|
@@ -28,12 +29,58 @@
|
|
|
28
29
|
}
|
|
29
30
|
```
|
|
30
31
|
|
|
32
|
+
### `klbq_teammates`(对应群里的 `/klbq1`)
|
|
33
|
+
|
|
34
|
+
查「组队胜率」:这名玩家和谁一起打过、各多少场、胜负平、对战胜率、最近一起赢过多久。
|
|
35
|
+
|
|
36
|
+
| 参数 | 类型 | 说明 |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `nickname` | string(必填) | 游戏昵称或 UID |
|
|
39
|
+
| `limit` | number | 榜单人数 1~30,默认 10 |
|
|
40
|
+
| `type` | `team` \| `rival` | `team`=组队胜率(默认),`rival`=敌对胜率(老遇到的对手) |
|
|
41
|
+
|
|
42
|
+
```jsonc
|
|
43
|
+
{
|
|
44
|
+
"ok": true,
|
|
45
|
+
"type": "team",
|
|
46
|
+
"nickname": "老牧师iDreamsky",
|
|
47
|
+
"currentRank": "束缚电子 IV",
|
|
48
|
+
"topRank": "无限超弦",
|
|
49
|
+
"count": 8,
|
|
50
|
+
"totalGames": 247,
|
|
51
|
+
"teammates": [
|
|
52
|
+
{ "nickname": "克拉克洛博塔", "games": 77, "wins": 36, "losses": 38, "draws": 3, "winRate": 0.4675 }
|
|
53
|
+
],
|
|
54
|
+
"imagePath": "...\\dsh-klbq-cards\\老牧师iDreamsky-team-1795840591705.png",
|
|
55
|
+
"imageBytes": 314976
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
数据来自 `profile.teamUps` / `profile.rivals`,**和战绩卡共用同一次取数**,不额外发请求。
|
|
60
|
+
`rival` 是顺带的:有些玩家没有敌对记录,此时会返回 `ok:false` 并说明原因。
|
|
61
|
+
|
|
31
62
|
图片写到系统临时目录的 `dsh-klbq-cards/` 下。**工具不返回 base64**——
|
|
32
63
|
一张 500KB 的 PNG 进上下文会非常浪费,所以「模型看摘要、人看图片」。
|
|
33
64
|
|
|
34
65
|
## 安装
|
|
35
66
|
|
|
36
|
-
|
|
67
|
+
本插件有**两条发行通道**,按你用的 QQ 接法选一条:
|
|
68
|
+
|
|
69
|
+
| 通道 | 安装 | 版本线 | 行为 |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| **QQ 官方机器人**(`@tencent-connect/dsh-qqbot`) | `npm i dsh-klbq` | 0.2.x | 工具 + 往 system prompt 注入 `/klbq` 用法,QQ 里发指令可直接出图 |
|
|
72
|
+
| **自建 OneBot 桥接**(SnowLuma / OneBot v11) | `npm i dsh-klbq@sl` | 0.1.x | 纯工具,不碰 system prompt,零额外 token |
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm i dsh-klbq@latest # 官方机器人
|
|
76
|
+
npm i dsh-klbq@sl # 自建桥接 / SnowLuma
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
两条线只差一处:0.2.x 多了 QQ 官方机器人适配层(`lib/qqbot.js`)。
|
|
80
|
+
自建桥接自己就实现了 `/klbq` 指令和发图(见 qq-bridge 的 `src/klbq.js`),
|
|
81
|
+
插件在那边只需要提供工具,不需要注入任何提示词——所以 `sl` 通道停在 0.1.x。
|
|
82
|
+
|
|
83
|
+
也可以本地 link 安装(开发用):
|
|
37
84
|
|
|
38
85
|
```json
|
|
39
86
|
// ~/.dsh/profiles/<profile>/package.json
|
|
@@ -66,6 +113,7 @@
|
|
|
66
113
|
|
|
67
114
|
```
|
|
68
115
|
/klbq 才知道左键能开枪
|
|
116
|
+
/klbq1 才知道左键能开枪
|
|
69
117
|
```
|
|
70
118
|
|
|
71
119
|
图片会作为本轮交付物自动发回聊天。
|
|
@@ -100,6 +148,16 @@
|
|
|
100
148
|
|
|
101
149
|
## 更新日志
|
|
102
150
|
|
|
151
|
+
### 0.3.0 — 新增 /klbq1(组队胜率)
|
|
152
|
+
|
|
153
|
+
- 新增工具 `klbq_teammates`:组队胜率榜(和谁一起打过、场次、胜负平、对战胜率、最近一起赢过多久),
|
|
154
|
+
`type: 'rival'` 可切到敌对胜率
|
|
155
|
+
- 新增卡片渲染 `buildTeamUpsHtml`:深色长图,前三名带奖牌色,胜率按区间着色(绿 / 蓝 / 橙 / 红)
|
|
156
|
+
- 两个工具都同时提供 `execute` 与 `resolve`(dsh-tools 调 `execute`,老宿主调 `resolve`)
|
|
157
|
+
- QQ 官方机器人适配新增 `/klbq1` 指令映射
|
|
158
|
+
- 数据与战绩卡共用同一次取数,不额外请求 dakanu
|
|
159
|
+
|
|
160
|
+
|
|
103
161
|
### 0.2.0 — 适配 QQ 官方机器人
|
|
104
162
|
|
|
105
163
|
- 新增 `lib/qqbot.js`:检测 `@tencent-connect/dsh-qqbot` 是否存在,存在则向
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import os from 'node:os';
|
|
|
13
13
|
import path from 'node:path';
|
|
14
14
|
|
|
15
15
|
import { searchPlayers, fetchSummoner, rankedLabel, rankedTierOf } from './dakanu.js';
|
|
16
|
-
import { buildHtml, renderPng } from './render.js';
|
|
16
|
+
import { buildHtml, buildTeamUpsHtml, normalizeRelations, renderPng } from './render.js';
|
|
17
17
|
import { detectQQBot, installQQBotBridge } from './qqbot.js';
|
|
18
18
|
|
|
19
19
|
export const name = 'dsh-klbq';
|
|
@@ -146,12 +146,149 @@ const DEFINITION = {
|
|
|
146
146
|
schema: OUTPUT_SCHEMA,
|
|
147
147
|
render: (_args, value) => [{ type: 'text', text: summaryText(value) }],
|
|
148
148
|
},
|
|
149
|
+
// dsh-tools 的分派直接调 tool.execute(args, exec);老宿主用 resolve。
|
|
150
|
+
// 两个都挂上,避免出现「tool.execute is not a function」。
|
|
151
|
+
async execute(args) {
|
|
152
|
+
return runQueryTool(() => queryPlayer(args?.nickname, { maxMatches: args?.maxMatches }));
|
|
153
|
+
},
|
|
149
154
|
async resolve(args) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
return runQueryTool(() => queryPlayer(args?.nickname, { maxMatches: args?.maxMatches }));
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const TEAMMATE_DEFAULT_LIMIT = 10;
|
|
160
|
+
|
|
161
|
+
/** 统一的错误兜底:工具不抛异常,只返回 ok:false。 */
|
|
162
|
+
async function runQueryTool(fn) {
|
|
163
|
+
try {
|
|
164
|
+
return await fn();
|
|
165
|
+
} catch (error) {
|
|
166
|
+
return { ok: false, error: String(error?.message ?? error) };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* 组队(或敌对)胜率。数据在 profile.teamUps / profile.rivals,
|
|
172
|
+
* 和战绩卡共用同一次取数,不用额外请求。
|
|
173
|
+
*/
|
|
174
|
+
export async function queryTeammates(nickname, options = {}) {
|
|
175
|
+
const q = String(nickname ?? '').trim();
|
|
176
|
+
if (!q) throw new Error('nickname 不能为空');
|
|
177
|
+
|
|
178
|
+
const type = options.type === 'rival' ? 'rival' : 'team';
|
|
179
|
+
const limit = Math.max(1, Math.min(30, Number(options.limit ?? TEAMMATE_DEFAULT_LIMIT) || TEAMMATE_DEFAULT_LIMIT));
|
|
180
|
+
const width = Number(options.width ?? 900) || 900;
|
|
181
|
+
|
|
182
|
+
const candidates = await searchPlayers(q);
|
|
183
|
+
if (!candidates.length) throw new Error(`没找到玩家「${q}」,检查游戏昵称是否正确(玩家改过名的话要用新昵称)`);
|
|
184
|
+
|
|
185
|
+
const lower = q.toLowerCase();
|
|
186
|
+
const pick = candidates.find((c) => c.nickname.toLowerCase() === lower)
|
|
187
|
+
?? candidates.find((c) => c.nickname.toLowerCase().startsWith(lower))
|
|
188
|
+
?? candidates[0];
|
|
189
|
+
|
|
190
|
+
const profile = await fetchSummoner(pick.playerId, pick.nickname);
|
|
191
|
+
const relations = normalizeRelations(type === 'rival' ? profile.rivals : profile.teamUps, type)
|
|
192
|
+
.sort((a, b) => b.games - a.games);
|
|
193
|
+
|
|
194
|
+
if (!relations.length) {
|
|
195
|
+
throw new Error(type === 'rival'
|
|
196
|
+
? `「${profile.player?.nickname ?? pick.nickname}」还没有读到敌对记录`
|
|
197
|
+
: `「${profile.player?.nickname ?? pick.nickname}」还没有读到组队记录`);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const shown = relations.slice(0, limit);
|
|
201
|
+
const html = buildTeamUpsHtml(profile, { width, limit, type });
|
|
202
|
+
const buffer = await renderPng(html, { width, browserPath: options.browserPath });
|
|
203
|
+
|
|
204
|
+
const safeName = String(profile.player?.nickname ?? pick.nickname).replace(/[\\/:*?"<>|\s]+/g, '_').slice(0, 40);
|
|
205
|
+
const file = path.join(cardDir(), `${safeName}-${type === 'rival' ? 'rival' : 'team'}-${Date.now()}.png`);
|
|
206
|
+
fs.writeFileSync(file, buffer);
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
ok: true,
|
|
210
|
+
type,
|
|
211
|
+
nickname: profile.player?.nickname ?? pick.nickname,
|
|
212
|
+
playerId: pick.playerId,
|
|
213
|
+
currentRank: rankedLabel(profile.rank?.segment),
|
|
214
|
+
topRank: rankedLabel(profile.rank?.historicalSegment),
|
|
215
|
+
count: shown.length,
|
|
216
|
+
totalGames: shown.reduce((s, r) => s + r.games, 0),
|
|
217
|
+
teammates: shown.map((r) => ({
|
|
218
|
+
nickname: r.nickname ?? null,
|
|
219
|
+
playerId: r.playerId ?? null,
|
|
220
|
+
games: r.games,
|
|
221
|
+
wins: r.wins,
|
|
222
|
+
losses: r.losses,
|
|
223
|
+
draws: r.draws,
|
|
224
|
+
winRate: r.winRate,
|
|
225
|
+
})),
|
|
226
|
+
imagePath: file,
|
|
227
|
+
imageBytes: buffer.length,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const TEAMMATE_SCHEMA = {
|
|
232
|
+
type: 'object',
|
|
233
|
+
properties: {
|
|
234
|
+
ok: { type: 'boolean' },
|
|
235
|
+
error: { type: 'string' },
|
|
236
|
+
type: { type: 'string' },
|
|
237
|
+
nickname: { type: 'string' },
|
|
238
|
+
playerId: { type: 'string' },
|
|
239
|
+
currentRank: { type: 'string' },
|
|
240
|
+
topRank: { type: 'string' },
|
|
241
|
+
count: { type: 'number' },
|
|
242
|
+
totalGames: { type: 'number' },
|
|
243
|
+
imagePath: { type: 'string' },
|
|
244
|
+
imageBytes: { type: 'number' },
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
function teammateSummaryText(value) {
|
|
249
|
+
if (!value?.ok) return `查询失败:${value?.error ?? '未知错误'}`;
|
|
250
|
+
const isTeam = value.type !== 'rival';
|
|
251
|
+
const lines = [
|
|
252
|
+
`${value.nickname} ${isTeam ? '组队胜率' : '敌对胜率'}(${value.count} 位${isTeam ? '队友' : '对手'},共 ${value.totalGames} 场)`,
|
|
253
|
+
`段位:${value.currentRank} 历史最高:${value.topRank}`,
|
|
254
|
+
`图片:${value.imagePath}`,
|
|
255
|
+
];
|
|
256
|
+
const top = (value.teammates ?? []).slice(0, 5);
|
|
257
|
+
if (top.length) {
|
|
258
|
+
lines.push(isTeam ? '同队最多的几位:' : '交手最多的几位:');
|
|
259
|
+
for (const t of top) {
|
|
260
|
+
lines.push(` ${t.nickname ?? t.playerId} ${t.games} 场 ${t.wins}胜${t.losses}负${t.draws ? `${t.draws}平` : ''} 胜率 ${pct(t.winRate)}`);
|
|
154
261
|
}
|
|
262
|
+
}
|
|
263
|
+
return lines.join('\n');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const TEAMMATE_DEFINITION = {
|
|
267
|
+
name: 'klbq_teammates',
|
|
268
|
+
description:
|
|
269
|
+
'查询卡拉彼丘(Strinova)玩家的组队胜率榜:列出和这名玩家一起打过的队友,'
|
|
270
|
+
+ '含同队场次、胜负平、对战胜率、最近一起赢过多久,并渲染成一张长图。'
|
|
271
|
+
+ '把 type 设为 rival 可以改看「敌对胜率」(经常排到的对手)。'
|
|
272
|
+
+ '在 QQ 机器人等即时通讯通道里,拿到 imagePath 后应调用 present 把它声明为交付物。',
|
|
273
|
+
parameters: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
properties: {
|
|
276
|
+
nickname: { type: 'string', description: '游戏昵称或 UID' },
|
|
277
|
+
limit: { type: 'number', description: `榜单人数 1~30,默认 ${TEAMMATE_DEFAULT_LIMIT}` },
|
|
278
|
+
type: { type: 'string', enum: ['team', 'rival'], description: 'team=组队胜率(默认),rival=敌对胜率' },
|
|
279
|
+
},
|
|
280
|
+
required: ['nickname'],
|
|
281
|
+
additionalProperties: false,
|
|
282
|
+
},
|
|
283
|
+
output: {
|
|
284
|
+
schema: TEAMMATE_SCHEMA,
|
|
285
|
+
render: (_args, value) => [{ type: 'text', text: teammateSummaryText(value) }],
|
|
286
|
+
},
|
|
287
|
+
async execute(args) {
|
|
288
|
+
return runQueryTool(() => queryTeammates(args?.nickname, { limit: args?.limit, type: args?.type }));
|
|
289
|
+
},
|
|
290
|
+
async resolve(args) {
|
|
291
|
+
return runQueryTool(() => queryTeammates(args?.nickname, { limit: args?.limit, type: args?.type }));
|
|
155
292
|
},
|
|
156
293
|
};
|
|
157
294
|
|
|
@@ -164,16 +301,18 @@ export function apply(ctx, config = {}) {
|
|
|
164
301
|
};
|
|
165
302
|
note('apply() 已执行');
|
|
166
303
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
304
|
+
for (const def of [DEFINITION, TEAMMATE_DEFINITION]) {
|
|
305
|
+
try {
|
|
306
|
+
const dispose = ctx.tools.register(def);
|
|
307
|
+
note(`${def.name} 注册成功`);
|
|
308
|
+
ctx.effect(() => () => {
|
|
309
|
+
try { dispose?.(); } catch { /* 卸载失败不该拖垮进程退出 */ }
|
|
310
|
+
}, `dsh-klbq: ${def.name} tool`);
|
|
311
|
+
} catch (error) {
|
|
312
|
+
// 不抛出:插件挂不上也不该让 DSH 启动失败,但必须留下原因。
|
|
313
|
+
note(`${def.name} 注册失败:${error?.message ?? error}`);
|
|
314
|
+
ctx.logger?.warn?.(`dsh-klbq: ${def.name} 注册失败:${error?.message ?? error}`);
|
|
315
|
+
}
|
|
177
316
|
}
|
|
178
317
|
|
|
179
318
|
// ── QQ 官方机器人通道适配 ──
|
package/lib/qqbot.js
CHANGED
|
@@ -1,150 +1,153 @@
|
|
|
1
|
-
// 与 @tencent-connect/dsh-qqbot(QQ 官方机器人通道)的适配层。
|
|
2
|
-
//
|
|
3
|
-
// 为什么是「提示词注入」而不是注册斜杠命令:
|
|
4
|
-
// dsh-qqbot 的命令表是硬编码的(dist/commands/index.js 的 buildCommandList),
|
|
5
|
-
// 没有对外扩展点,第三方插件加不进 /klbq。但它的 slashCommand 中间件对
|
|
6
|
-
// **未注册**的命令是 `await next()` 放行的(qqbot-nodejs/dist/middleware/
|
|
7
|
-
// slash-command.js 第 124-128 行),所以 `/klbq 昵称` 不会被吞掉,会照常
|
|
8
|
-
// 进入 agent 回合。于是我们要做的只是教会 agent 收到这类消息该干什么。
|
|
9
|
-
//
|
|
10
|
-
// 代价:注入的段落会出现在每个回合的 system prompt 里(约 150 token)。
|
|
11
|
-
// 不需要的话可以在插件配置里关掉:integrations.qqbot.promptInjection = false。
|
|
12
|
-
|
|
13
|
-
import fs from 'node:fs';
|
|
14
|
-
import os from 'node:os';
|
|
15
|
-
import path from 'node:path';
|
|
16
|
-
import { createRequire } from 'node:module';
|
|
17
|
-
import { fileURLToPath } from 'node:url';
|
|
18
|
-
|
|
19
|
-
const QQ_BOT_PACKAGE = '@tencent-connect/dsh-qqbot';
|
|
20
|
-
const SECTION_NAME = 'dsh-klbq:qqbot-usage';
|
|
21
|
-
const PKG_ENTRY = QQ_BOT_PACKAGE + '/package.json';
|
|
22
|
-
|
|
23
|
-
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
-
|
|
25
|
-
let detected; // undefined = 未探测过
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 在 node_modules 里按目录结构逐级向上找这个包。
|
|
29
|
-
*
|
|
30
|
-
* 插件常常以 `link:` 方式挂在 `~/.dsh/plugins/<name>`,而依赖装在
|
|
31
|
-
* `~/.dsh/profiles/<profile>/node_modules`——不是它的祖先目录,
|
|
32
|
-
* 单靠 require.resolve 会漏判。所以这里同时扫 profile 目录。
|
|
33
|
-
*/
|
|
34
|
-
function existsAsPackage(dir) {
|
|
35
|
-
try {
|
|
36
|
-
return fs.existsSync(path.join(dir, QQ_BOT_PACKAGE, 'package.json'));
|
|
37
|
-
} catch {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function probeFileSystem() {
|
|
43
|
-
// 1) 从插件自身目录逐级向上找 node_modules(npm 安装时的常规情况)
|
|
44
|
-
let dir = HERE;
|
|
45
|
-
for (let i = 0; i < 6; i += 1) {
|
|
46
|
-
if (existsAsPackage(path.join(dir, 'node_modules'))) return true;
|
|
47
|
-
const parent = path.dirname(dir);
|
|
48
|
-
if (parent === dir) break;
|
|
49
|
-
dir = parent;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// 2) 扫 DSH profile:要求「同一个 profile 里既有本插件、又有 qqbot」。
|
|
53
|
-
//
|
|
54
|
-
// 只判断有没有 qqbot 会误判——用户可能在别的 profile 装了它,而当前
|
|
55
|
-
// profile 根本没跑 QQ 通道,那样会白白往 system prompt 里塞 150 token。
|
|
56
|
-
// 本插件以 link: 装时会出现在 profile 的 node_modules 里(软链),
|
|
57
|
-
// 所以「同目录两者都在」是可靠的判据。
|
|
58
|
-
try {
|
|
59
|
-
const profilesDir = path.join(os.homedir(), '.dsh', 'profiles');
|
|
60
|
-
for (const profile of fs.readdirSync(profilesDir).slice(0, 20)) {
|
|
61
|
-
const modules = path.join(profilesDir, profile, 'node_modules');
|
|
62
|
-
if (!existsAsPackage(modules)) continue;
|
|
63
|
-
const hasSelf = fs.existsSync(path.join(modules, 'dsh-klbq'));
|
|
64
|
-
if (hasSelf) return true;
|
|
65
|
-
}
|
|
66
|
-
} catch { /* 没有 .dsh 目录就用别的手段 */ }
|
|
67
|
-
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** 判断 DSH 里有没有装 QQ 机器人通道(装了就认为需要适配)。结果会缓存。 */
|
|
72
|
-
export function detectQQBot() {
|
|
73
|
-
if (detected !== undefined) return detected;
|
|
74
|
-
|
|
75
|
-
const require = createRequire(import.meta.url);
|
|
76
|
-
for (const spec of [PKG_ENTRY, QQ_BOT_PACKAGE]) {
|
|
77
|
-
try {
|
|
78
|
-
require.resolve(spec);
|
|
79
|
-
detected = true;
|
|
80
|
-
return detected;
|
|
81
|
-
} catch { /* 继续试下一种手段 */ }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
detected = probeFileSystem();
|
|
85
|
-
return detected;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** 测试用:清掉探测缓存 */
|
|
89
|
-
export function resetQQBotDetection() {
|
|
90
|
-
detected = undefined;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** 注入给 agent 的使用说明(保持简短,它每轮都在上下文里) */
|
|
94
|
-
export const QQBOT_PROMPT = [
|
|
95
|
-
'## 卡拉彼丘战绩查询(dsh-klbq)',
|
|
96
|
-
'',
|
|
97
|
-
'当用户消息以 `/klbq`
|
|
98
|
-
'1. 昵称 = 命令后面的**全部**文字,可能含空格,不要去头去尾随意截断。',
|
|
99
|
-
'2.
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
//
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
1
|
+
// 与 @tencent-connect/dsh-qqbot(QQ 官方机器人通道)的适配层。
|
|
2
|
+
//
|
|
3
|
+
// 为什么是「提示词注入」而不是注册斜杠命令:
|
|
4
|
+
// dsh-qqbot 的命令表是硬编码的(dist/commands/index.js 的 buildCommandList),
|
|
5
|
+
// 没有对外扩展点,第三方插件加不进 /klbq。但它的 slashCommand 中间件对
|
|
6
|
+
// **未注册**的命令是 `await next()` 放行的(qqbot-nodejs/dist/middleware/
|
|
7
|
+
// slash-command.js 第 124-128 行),所以 `/klbq 昵称` 不会被吞掉,会照常
|
|
8
|
+
// 进入 agent 回合。于是我们要做的只是教会 agent 收到这类消息该干什么。
|
|
9
|
+
//
|
|
10
|
+
// 代价:注入的段落会出现在每个回合的 system prompt 里(约 150 token)。
|
|
11
|
+
// 不需要的话可以在插件配置里关掉:integrations.qqbot.promptInjection = false。
|
|
12
|
+
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import os from 'node:os';
|
|
15
|
+
import path from 'node:path';
|
|
16
|
+
import { createRequire } from 'node:module';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
|
|
19
|
+
const QQ_BOT_PACKAGE = '@tencent-connect/dsh-qqbot';
|
|
20
|
+
const SECTION_NAME = 'dsh-klbq:qqbot-usage';
|
|
21
|
+
const PKG_ENTRY = QQ_BOT_PACKAGE + '/package.json';
|
|
22
|
+
|
|
23
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
|
|
25
|
+
let detected; // undefined = 未探测过
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 在 node_modules 里按目录结构逐级向上找这个包。
|
|
29
|
+
*
|
|
30
|
+
* 插件常常以 `link:` 方式挂在 `~/.dsh/plugins/<name>`,而依赖装在
|
|
31
|
+
* `~/.dsh/profiles/<profile>/node_modules`——不是它的祖先目录,
|
|
32
|
+
* 单靠 require.resolve 会漏判。所以这里同时扫 profile 目录。
|
|
33
|
+
*/
|
|
34
|
+
function existsAsPackage(dir) {
|
|
35
|
+
try {
|
|
36
|
+
return fs.existsSync(path.join(dir, QQ_BOT_PACKAGE, 'package.json'));
|
|
37
|
+
} catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function probeFileSystem() {
|
|
43
|
+
// 1) 从插件自身目录逐级向上找 node_modules(npm 安装时的常规情况)
|
|
44
|
+
let dir = HERE;
|
|
45
|
+
for (let i = 0; i < 6; i += 1) {
|
|
46
|
+
if (existsAsPackage(path.join(dir, 'node_modules'))) return true;
|
|
47
|
+
const parent = path.dirname(dir);
|
|
48
|
+
if (parent === dir) break;
|
|
49
|
+
dir = parent;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 2) 扫 DSH profile:要求「同一个 profile 里既有本插件、又有 qqbot」。
|
|
53
|
+
//
|
|
54
|
+
// 只判断有没有 qqbot 会误判——用户可能在别的 profile 装了它,而当前
|
|
55
|
+
// profile 根本没跑 QQ 通道,那样会白白往 system prompt 里塞 150 token。
|
|
56
|
+
// 本插件以 link: 装时会出现在 profile 的 node_modules 里(软链),
|
|
57
|
+
// 所以「同目录两者都在」是可靠的判据。
|
|
58
|
+
try {
|
|
59
|
+
const profilesDir = path.join(os.homedir(), '.dsh', 'profiles');
|
|
60
|
+
for (const profile of fs.readdirSync(profilesDir).slice(0, 20)) {
|
|
61
|
+
const modules = path.join(profilesDir, profile, 'node_modules');
|
|
62
|
+
if (!existsAsPackage(modules)) continue;
|
|
63
|
+
const hasSelf = fs.existsSync(path.join(modules, 'dsh-klbq'));
|
|
64
|
+
if (hasSelf) return true;
|
|
65
|
+
}
|
|
66
|
+
} catch { /* 没有 .dsh 目录就用别的手段 */ }
|
|
67
|
+
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** 判断 DSH 里有没有装 QQ 机器人通道(装了就认为需要适配)。结果会缓存。 */
|
|
72
|
+
export function detectQQBot() {
|
|
73
|
+
if (detected !== undefined) return detected;
|
|
74
|
+
|
|
75
|
+
const require = createRequire(import.meta.url);
|
|
76
|
+
for (const spec of [PKG_ENTRY, QQ_BOT_PACKAGE]) {
|
|
77
|
+
try {
|
|
78
|
+
require.resolve(spec);
|
|
79
|
+
detected = true;
|
|
80
|
+
return detected;
|
|
81
|
+
} catch { /* 继续试下一种手段 */ }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
detected = probeFileSystem();
|
|
85
|
+
return detected;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** 测试用:清掉探测缓存 */
|
|
89
|
+
export function resetQQBotDetection() {
|
|
90
|
+
detected = undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** 注入给 agent 的使用说明(保持简短,它每轮都在上下文里) */
|
|
94
|
+
export const QQBOT_PROMPT = [
|
|
95
|
+
'## 卡拉彼丘战绩查询(dsh-klbq)',
|
|
96
|
+
'',
|
|
97
|
+
'当用户消息以 `/klbq`、`/klbq1` 开头,或直接要求查卡拉彼丘(Strinova)战绩时:',
|
|
98
|
+
'1. 昵称 = 命令后面的**全部**文字,可能含空格,不要去头去尾随意截断。',
|
|
99
|
+
'2. 指令对应关系:',
|
|
100
|
+
' - `/klbq 昵称` 或「查战绩」→ 调 `klbq_query`(段位 / 总览 / 模式 / 角色 / 最近对局)',
|
|
101
|
+
' - `/klbq1 昵称` 或「组队胜率、队友」→ 调 `klbq_teammates`(和谁一起打过、各多少场、胜率多少)',
|
|
102
|
+
' - 「敌对胜率、老遇到的对手」→ 调 `klbq_teammates` 并把 `type` 设为 `rival`',
|
|
103
|
+
'3. 工具返回 `imagePath`(本地 PNG 绝对路径)。若当前通道支持发文件,',
|
|
104
|
+
' 紧接着调用 `present` 把该路径声明为交付物,图片会自动发到聊天里;',
|
|
105
|
+
' 同时用一两句话点出段位、场次、胜率这几个关键数字,不要复述整张图。',
|
|
106
|
+
'4. 返回 `ok:false` 时把 `error` 原样告诉用户,**不要**编造数据。',
|
|
107
|
+
].join('\n');
|
|
108
|
+
|
|
109
|
+
/** 判断 DSH 里有没有装 QQ 机器人通道(装了就认为需要适配) */
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 把 /klbq 的使用说明挂到 system prompt 上。
|
|
113
|
+
*
|
|
114
|
+
* 契约与 dsh-qqbot 自身一致(dist/session/session-manager.js 的
|
|
115
|
+
* registerScopePromptInjection):`(assembly, context, next)` 瀑布流,
|
|
116
|
+
* 先 await next() 拿到下游组装结果,再追加 section。
|
|
117
|
+
*
|
|
118
|
+
* @param {any} ctx cordis 上下文
|
|
119
|
+
* @param {{logger?: any, prompt?: string, enabled?: boolean}} [options]
|
|
120
|
+
* @returns {boolean} 是否成功挂载
|
|
121
|
+
*/
|
|
122
|
+
export function installQQBotBridge(ctx, options = {}) {
|
|
123
|
+
if (typeof ctx?.on !== 'function') return false;
|
|
124
|
+
|
|
125
|
+
const text = options.prompt ?? QQBOT_PROMPT;
|
|
126
|
+
const logger = options.logger;
|
|
127
|
+
|
|
128
|
+
const handler = async (assembly, context, next) => {
|
|
129
|
+
const assembled = await next();
|
|
130
|
+
// 只在有 agent 的回合注入;非 agent 的组装(如摘要压缩)不动。
|
|
131
|
+
if (!context?.agent) return assembled;
|
|
132
|
+
const sections = Array.isArray(assembled?.sections) ? assembled.sections : [];
|
|
133
|
+
// 幂等:同一个组装里已经有我们的段落就不再叠加。
|
|
134
|
+
if (sections.some((s) => s?.name === SECTION_NAME)) return assembled;
|
|
135
|
+
return { ...assembled, sections: [...sections, { name: SECTION_NAME, order: 95, text }] };
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const dispose = ctx.on('system-prompt/assemble', handler);
|
|
140
|
+
logger?.info?.('dsh-klbq: 已注入 QQ 机器人(/klbq)使用说明');
|
|
141
|
+
if (typeof ctx.effect === 'function') {
|
|
142
|
+
ctx.effect(() => () => {
|
|
143
|
+
try { dispose?.(); } catch { /* 卸载失败不影响进程 */ }
|
|
144
|
+
}, 'dsh-klbq: qqbot system-prompt hook');
|
|
145
|
+
}
|
|
146
|
+
return true;
|
|
147
|
+
} catch (error) {
|
|
148
|
+
logger?.warn?.(`dsh-klbq: QQ 机器人适配挂载失败:${error?.message ?? error}`);
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
150
153
|
export { SECTION_NAME };
|
package/lib/render.js
CHANGED
|
@@ -210,6 +210,167 @@ export function buildHtml(profile, { width = 900, maxMatches = 10 } = {}) {
|
|
|
210
210
|
</div></body></html>`;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
/** 相对时间:最近一起赢过 X 天前 */
|
|
214
|
+
const fmtAgo = (unix) => {
|
|
215
|
+
const t = Number(unix);
|
|
216
|
+
if (!Number.isFinite(t) || t <= 0) return '-';
|
|
217
|
+
const diff = Date.now() - t * 1000;
|
|
218
|
+
if (diff <= 0) return '刚刚';
|
|
219
|
+
const min = Math.floor(diff / 60000);
|
|
220
|
+
if (min < 1) return '刚刚';
|
|
221
|
+
if (min < 60) return `${min} 分钟前`;
|
|
222
|
+
const hours = Math.floor(min / 60);
|
|
223
|
+
if (hours < 24) return `${hours} 小时前`;
|
|
224
|
+
return `${Math.floor(hours / 24)} 天前`;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** 从一条关系记录里按候选字段名取值(team 用 teamed*,rival 用 faced*) */
|
|
228
|
+
const pickField = (row, keys) => {
|
|
229
|
+
if (!row || typeof row !== 'object') return undefined;
|
|
230
|
+
for (const k of keys) {
|
|
231
|
+
const v = row[k];
|
|
232
|
+
if (v !== undefined && v !== null && v !== '') return v;
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/** 把 dakanu 的 teamUps / rivals 归一化成统一结构 */
|
|
238
|
+
export function normalizeRelations(list, type = 'team') {
|
|
239
|
+
const arr = Array.isArray(list) ? list : [];
|
|
240
|
+
return arr.map((row) => {
|
|
241
|
+
const games = Number(pickField(row, ['teamedGames', 'facedGames', 'games', 'count']) ?? 0);
|
|
242
|
+
const wins = Number(pickField(row, ['teamedWins', 'facedWins', 'wins']) ?? 0);
|
|
243
|
+
const losses = Number(pickField(row, ['teamedLosses', 'facedLosses', 'losses']) ?? 0);
|
|
244
|
+
const draws = Number(pickField(row, ['teamedDraws', 'facedDraws', 'draws']) ?? 0);
|
|
245
|
+
const rawRate = pickField(row, ['teamedWinRate', 'facedWinRate', 'winRate']);
|
|
246
|
+
const rate = Number.isFinite(Number(rawRate)) && rawRate !== undefined
|
|
247
|
+
? Number(rawRate)
|
|
248
|
+
: (games > 0 ? wins / games : 0);
|
|
249
|
+
return {
|
|
250
|
+
playerId: pickField(row, ['playerId', 'id', 'otherPlayerId']),
|
|
251
|
+
nickname: pickField(row, ['nickname', 'name', 'playerName', 'displayName']),
|
|
252
|
+
avatarId: pickField(row, ['avatarId', 'avatar', 'icon']),
|
|
253
|
+
games,
|
|
254
|
+
wins,
|
|
255
|
+
losses,
|
|
256
|
+
draws,
|
|
257
|
+
winRate: rate,
|
|
258
|
+
lastAt: pickField(row, ['lastWinAt', 'lastTeamedWinAt', 'lastFacedAt', 'lastPlayedAt', 'lastAt']),
|
|
259
|
+
type,
|
|
260
|
+
};
|
|
261
|
+
}).filter((r) => r.games > 0 || r.nickname);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 组队胜率 / 敌对胜率 长图。
|
|
266
|
+
* 数据来自 profile.teamUps(同队)与 profile.rivals(敌对),字段见 normalizeRelations。
|
|
267
|
+
*/
|
|
268
|
+
export function buildTeamUpsHtml(profile, { width = 900, limit = 10, type = 'team' } = {}) {
|
|
269
|
+
const p = profile ?? {};
|
|
270
|
+
const player = p.player ?? {};
|
|
271
|
+
const isTeam = type !== 'rival';
|
|
272
|
+
const list = normalizeRelations(isTeam ? p.teamUps : p.rivals, type)
|
|
273
|
+
.sort((a, b) => b.games - a.games)
|
|
274
|
+
.slice(0, Math.max(1, Math.min(30, Number(limit) || 10)));
|
|
275
|
+
|
|
276
|
+
const curTier = rankedTierOf(p.rank?.segment);
|
|
277
|
+
const topTier = rankedTierOf(p.rank?.historicalSegment);
|
|
278
|
+
const label = (t) => (t ? (t.division ? `${t.name} ${t.division}` : t.name) : '未定级');
|
|
279
|
+
const title = isTeam ? '组队胜率' : '敌对胜率';
|
|
280
|
+
const sortHint = isTeam ? '按同队次数排序' : '按交手次数排序';
|
|
281
|
+
const unit = isTeam ? '同队' : '交手';
|
|
282
|
+
const lastLabel = isTeam ? '最近一起赢过' : '最近交手';
|
|
283
|
+
|
|
284
|
+
const totalGames = list.reduce((s, r) => s + r.games, 0);
|
|
285
|
+
const totalWins = list.reduce((s, r) => s + r.wins, 0);
|
|
286
|
+
|
|
287
|
+
const rateColor = (r) => {
|
|
288
|
+
const v = Number(r) || 0;
|
|
289
|
+
if (v >= 0.55) return '#3ddc9a';
|
|
290
|
+
if (v >= 0.45) return '#7fd6ff';
|
|
291
|
+
if (v >= 0.35) return '#ffc06a';
|
|
292
|
+
return '#ff7b8a';
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const medal = (i) => {
|
|
296
|
+
if (i === 0) return '#ffd76a';
|
|
297
|
+
if (i === 1) return '#cfd8e6';
|
|
298
|
+
if (i === 2) return '#e0a273';
|
|
299
|
+
return '#4d5b73';
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const rows = list.map((r, i) => {
|
|
303
|
+
const name = r.nickname ?? (r.playerId != null ? `#${r.playerId}` : '未知玩家');
|
|
304
|
+
const initial = String(name).trim().slice(0, 1) || '?';
|
|
305
|
+
return `
|
|
306
|
+
<div class="row">
|
|
307
|
+
<div class="idx" style="color:${medal(i)}">${i + 1}</div>
|
|
308
|
+
<div class="ava">${esc(initial)}</div>
|
|
309
|
+
<div class="main">
|
|
310
|
+
<div class="name">${esc(name)}</div>
|
|
311
|
+
<div class="meta">${unit} ${num(r.games)} 场 <span class="w">${num(r.wins)}</span> 胜 <span class="l">${num(r.losses)}</span> 负${r.draws ? ` <span class="d">${num(r.draws)}</span> 平` : ''}</div>
|
|
312
|
+
<div class="time">${lastLabel} ${esc(fmtAgo(r.lastAt))}</div>
|
|
313
|
+
</div>
|
|
314
|
+
<div class="rate">
|
|
315
|
+
<div class="rate-v" style="color:${rateColor(r.winRate)}">${pct(r.winRate)}</div>
|
|
316
|
+
<div class="rate-k">对战胜率</div>
|
|
317
|
+
<div class="rate-bar"><i style="width:${Math.min(100, (Number(r.winRate) || 0) * 100).toFixed(1)}%;background:${rateColor(r.winRate)}"></i></div>
|
|
318
|
+
</div>
|
|
319
|
+
</div>`;
|
|
320
|
+
}).join('');
|
|
321
|
+
|
|
322
|
+
return `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><style>
|
|
323
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
324
|
+
body{width:${width}px;background:#0b1018;color:#e8eefc;font-family:"Microsoft YaHei UI","Microsoft YaHei",sans-serif;padding:26px}
|
|
325
|
+
.card{background:#111a27;border:1px solid #1e2a3d;border-radius:18px;padding:26px 26px 20px}
|
|
326
|
+
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;border-bottom:1px solid #1b2637;padding-bottom:18px}
|
|
327
|
+
.nick{font-size:38px;font-weight:800;line-height:1.15;word-break:break-all}
|
|
328
|
+
.sub{font-size:15px;color:#8ea0bf;margin-top:8px}
|
|
329
|
+
.rank{text-align:right;font-size:14px;color:#8ea0bf;line-height:1.7;flex:none}
|
|
330
|
+
.rank b{font-size:19px;display:block}
|
|
331
|
+
.titlebar{display:flex;align-items:center;justify-content:space-between;margin:20px 2px 10px}
|
|
332
|
+
.title{font-size:21px;font-weight:800}
|
|
333
|
+
.hint{font-size:14px;color:#6f7f9c}
|
|
334
|
+
.row{display:flex;align-items:center;gap:14px;padding:13px 10px;border-radius:12px;border-bottom:1px solid #17202f}
|
|
335
|
+
.row:last-child{border-bottom:none}
|
|
336
|
+
.idx{width:22px;text-align:center;font-size:17px;font-weight:800;flex:none}
|
|
337
|
+
.ava{width:44px;height:44px;border-radius:50%;background:#1c2941;border:1px solid #26364f;display:flex;
|
|
338
|
+
align-items:center;justify-content:center;font-size:19px;font-weight:700;color:#9fc0e8;flex:none}
|
|
339
|
+
.main{flex:1;min-width:0}
|
|
340
|
+
.name{font-size:21px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
341
|
+
.meta{font-size:15px;color:#9fb0cf;margin-top:5px}
|
|
342
|
+
.meta .w{color:#3ddc9a}.meta .l{color:#ff7b8a}.meta .d{color:#ffc06a}
|
|
343
|
+
.time{font-size:13px;color:#64748b;margin-top:4px}
|
|
344
|
+
.rate{text-align:right;flex:none;width:120px}
|
|
345
|
+
.rate-v{font-size:26px;font-weight:800;line-height:1.1}
|
|
346
|
+
.rate-k{font-size:12px;color:#6f7f9c;margin-top:2px}
|
|
347
|
+
.rate-bar{height:4px;background:#1b2637;border-radius:3px;overflow:hidden;margin-top:6px}
|
|
348
|
+
.rate-bar i{display:block;height:100%;border-radius:3px}
|
|
349
|
+
.empty{color:#8ea0bf;font-size:17px;padding:26px 4px;text-align:center}
|
|
350
|
+
.foot{margin-top:16px;text-align:center;font-size:13px;color:#4d5b73}
|
|
351
|
+
</style></head><body><div class="card">
|
|
352
|
+
<div class="head">
|
|
353
|
+
<div>
|
|
354
|
+
<div class="nick">${esc(player.nickname ?? '-')}</div>
|
|
355
|
+
<div class="sub">${title} · 共 ${num(list.length)} 位${isTeam ? '队友' : '对手'} · ${num(totalGames)} 场${isTeam ? '同队' : '交手'}</div>
|
|
356
|
+
</div>
|
|
357
|
+
<div class="rank">
|
|
358
|
+
<b style="color:${curTier?.color ?? '#9aa7b5'}">${esc(label(curTier))}</b>
|
|
359
|
+
历史最高 <span style="color:${topTier?.color ?? '#cdd8ee'}">${esc(label(topTier))}</span>
|
|
360
|
+
</div>
|
|
361
|
+
</div>
|
|
362
|
+
<div class="titlebar">
|
|
363
|
+
<div class="title">${title}</div>
|
|
364
|
+
<div class="hint">${sortHint}</div>
|
|
365
|
+
</div>
|
|
366
|
+
${rows || '<div class="empty">还没有读到任何记录</div>'}
|
|
367
|
+
<div class="foot">数据来源 dakanu.com · 仅供参考</div>
|
|
368
|
+
</div>
|
|
369
|
+
<div id="__h" style="display:none"></div>
|
|
370
|
+
<script>document.getElementById('__h').textContent = String(Math.ceil(document.body.getBoundingClientRect().height));</script>
|
|
371
|
+
</body></html>`;
|
|
372
|
+
}
|
|
373
|
+
|
|
213
374
|
function runBrowser(bin, args, { timeoutMs = 60000 } = {}) {
|
|
214
375
|
return new Promise((resolve, reject) => {
|
|
215
376
|
execFile(bin, args, { timeout: timeoutMs, windowsHide: true, maxBuffer: 8 * 1024 * 1024 }, (error, stdout, stderr) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-klbq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "閸椻剝濯鸿ぐ闂寸瑴閿涘湯trinova閿涘鍨紒鈺傜叀鐠囶澁绱伴幐澶嬫█缁夐绮?dakanu.com 閸欐牗鏆熼獮鑸佃閺屾捇鏆遍崶鎾呯礄閹烘帊缍呭▓鍏哥秴/閹槒顫?濡€崇础/鐟欐帟澹?閺堚偓鏉╂垵顕仦鈧敍澶涚礉娴f粈璐?DSH 瀹搞儱鍙?klbq_query 閺嗘挳婀剁紒?agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|