koishi-plugin-chatluna-toolbox 0.0.17 → 0.0.18
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 +4 -4
- package/client/constants.ts +2 -2
- package/dist/index.js +2 -2
- package/lib/index.js +61 -71
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
为 ChatLuna 提供可组合的工具能力,当前包含三类功能:
|
|
4
4
|
|
|
5
5
|
- 原生工具(Native Tools)
|
|
6
|
-
- XML 工具(XML Actions)
|
|
6
|
+
- Character XML 工具(XML Actions)
|
|
7
7
|
- 变量扩展(Variables)
|
|
8
8
|
|
|
9
9
|
插件目标是把常用的群聊动作能力(如戳一戳、消息表情、撤回消息)和上下文变量能力拆分为可配置模块,便于在 Koishi + ChatLuna 场景中按需启用。
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
QQ 头像工具会把 HTTP/HTTPS 图片先转为 OneBot `base64://` 文件再提交,避免 OneBot 端无法访问 Koishi 临时图片地址。
|
|
23
23
|
|
|
24
|
-
### 2) XML 工具
|
|
24
|
+
### 2) Character XML 工具
|
|
25
25
|
支持从模型输出中解析 XML 动作标签并执行:
|
|
26
26
|
|
|
27
27
|
- `<poke id="..."/>`
|
|
@@ -49,11 +49,11 @@ QQ 头像工具会把 HTTP/HTTPS 图片先转为 OneBot `base64://` 文件再提
|
|
|
49
49
|
|
|
50
50
|
- 开启一个 OneBot 协议(NapCat 或 LLBot)
|
|
51
51
|
- 按需开启原生工具
|
|
52
|
-
- 按需开启 XML 工具
|
|
52
|
+
- 按需开启 Character XML 工具
|
|
53
53
|
- 按需配置变量项
|
|
54
54
|
|
|
55
55
|
### 3. 配置 XML 参考提示词
|
|
56
|
-
在 `XML 工具` 分组中找到 `参考提示词`,可直接使用默认模板,或根据你的 Bot 规则进行调整。
|
|
56
|
+
在 `Character XML 工具` 分组中找到 `参考提示词`,可直接使用默认模板,或根据你的 Bot 规则进行调整。
|
|
57
57
|
|
|
58
58
|
### 4. 构建
|
|
59
59
|
|
package/client/constants.ts
CHANGED
|
@@ -8,8 +8,8 @@ import type { SharedNavSection } from "shared-nav";
|
|
|
8
8
|
export const NAV_SECTIONS: SharedNavSection[] = [
|
|
9
9
|
{ title: "基础设置", key: "basic" },
|
|
10
10
|
{ title: "原生工具", key: "nativeTools" },
|
|
11
|
-
{ title: "XML 工具", key: "xmlTools" },
|
|
12
|
-
{ title: "
|
|
11
|
+
{ title: "Character XML 工具", key: "xmlTools" },
|
|
12
|
+
{ title: "变量", key: "variables" },
|
|
13
13
|
{ title: "其他设置", key: "other" },
|
|
14
14
|
];
|
|
15
15
|
|
package/dist/index.js
CHANGED
|
@@ -234,8 +234,8 @@ const st = /* @__PURE__ */ b({
|
|
|
234
234
|
}, gt = /* @__PURE__ */ M(st, [["__cssModules", ht]]), pt = [
|
|
235
235
|
{ title: "基础设置", key: "basic" },
|
|
236
236
|
{ title: "原生工具", key: "nativeTools" },
|
|
237
|
-
{ title: "XML 工具", key: "xmlTools" },
|
|
238
|
-
{ title: "
|
|
237
|
+
{ title: "Character XML 工具", key: "xmlTools" },
|
|
238
|
+
{ title: "变量", key: "variables" },
|
|
239
239
|
{ title: "其他设置", key: "other" }
|
|
240
240
|
], mt = [
|
|
241
241
|
"chatluna-toolbox",
|
package/lib/index.js
CHANGED
|
@@ -447,7 +447,8 @@ __export(index_exports, {
|
|
|
447
447
|
sendSetGroupCard: () => sendSetGroupCard,
|
|
448
448
|
sendSetGroupSpecialTitle: () => sendSetGroupSpecialTitle,
|
|
449
449
|
sendSetProfile: () => sendSetProfile,
|
|
450
|
-
sendSetQQAvatar: () => sendSetQQAvatar
|
|
450
|
+
sendSetQQAvatar: () => sendSetQQAvatar,
|
|
451
|
+
usage: () => usage
|
|
451
452
|
});
|
|
452
453
|
module.exports = __toCommonJS(index_exports);
|
|
453
454
|
|
|
@@ -477,95 +478,68 @@ var DEFAULT_SET_MSG_EMOJI_TOOL_DESCRIPTION = "\u5BF9\u6307\u5B9A\u6D88\u606F\u6D
|
|
|
477
478
|
var DEFAULT_DELETE_MESSAGE_TOOL_DESCRIPTION = "\u6839\u636E\u6D88\u606F ID \u64A4\u56DE\u6307\u5B9A\u6D88\u606F\u3002";
|
|
478
479
|
|
|
479
480
|
// src/schema/native-tools.ts
|
|
480
|
-
var
|
|
481
|
+
var EnabledNativeToolsSchema = import_koishi2.Schema.array(
|
|
482
|
+
import_koishi2.Schema.union([
|
|
483
|
+
import_koishi2.Schema.const("poke").description("\u6233\u4E00\u6233"),
|
|
484
|
+
import_koishi2.Schema.const("setSelfProfile").description("\u4FEE\u6539\u81EA\u8EAB\u8D26\u6237\u4FE1\u606F"),
|
|
485
|
+
import_koishi2.Schema.const("setQQAvatar").description("\u4FEE\u6539 QQ \u5934\u50CF"),
|
|
486
|
+
import_koishi2.Schema.const("setGroupCard").description("\u4FEE\u6539\u7FA4\u6210\u5458\u6635\u79F0"),
|
|
487
|
+
import_koishi2.Schema.const("setGroupBan").description("\u7981\u8A00\u7FA4\u6210\u5458"),
|
|
488
|
+
import_koishi2.Schema.const("setGroupSpecialTitle").description("\u4FEE\u6539\u7FA4\u6210\u5458\u4E13\u5C5E\u5934\u8854"),
|
|
489
|
+
import_koishi2.Schema.const("setMsgEmoji").description("\u6D88\u606F\u8868\u60C5"),
|
|
490
|
+
import_koishi2.Schema.const("deleteMessage").description("\u64A4\u56DE\u6D88\u606F")
|
|
491
|
+
])
|
|
492
|
+
).role("checkbox").extra("default", void 0).description(
|
|
493
|
+
"\u9009\u62E9\u8981\u6CE8\u518C\u5230 ChatLuna \u7684\u539F\u751F\u5DE5\u5177\uFF0C\u5DE5\u5177\u540D\u79F0\u548C\u63CF\u8FF0\u901A\u5E38\u65E0\u9700\u4FEE\u6539\uFF0C\u53EF\u5728\u4E0B\u65B9\u9AD8\u7EA7\u8BBE\u7F6E\u4E2D\u8C03\u6574"
|
|
494
|
+
);
|
|
495
|
+
var NativeToolAdvancedSettingsSchema = import_koishi2.Schema.object({
|
|
481
496
|
poke: import_koishi2.Schema.object({
|
|
482
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
497
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
483
498
|
toolName: import_koishi2.Schema.string().default("poke_user").description("\u5DE5\u5177\u540D\u79F0"),
|
|
484
499
|
description: import_koishi2.Schema.string().default(DEFAULT_POKE_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
485
500
|
}).description("\u6233\u4E00\u6233\u5DE5\u5177").collapse(),
|
|
486
501
|
setSelfProfile: import_koishi2.Schema.object({
|
|
487
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
488
|
-
`\u6CE8\u518C ChatLuna \u539F\u751F\u5DE5\u5177\uFF1A\u4FEE\u6539\u81EA\u8EAB\u8D26\u6237\u4FE1\u606F\uFF0C\u652F\u6301\u6635\u79F0 / \u7B7E\u540D / \u6027\u522B`
|
|
489
|
-
),
|
|
502
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
490
503
|
toolName: import_koishi2.Schema.string().default("set_self_profile").description("\u5DE5\u5177\u540D\u79F0"),
|
|
491
504
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_SELF_PROFILE_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
492
505
|
}).description("\u4FEE\u6539\u81EA\u8EAB\u8D26\u6237\u4FE1\u606F\u5DE5\u5177").collapse(),
|
|
493
506
|
setQQAvatar: import_koishi2.Schema.object({
|
|
494
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
507
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
495
508
|
toolName: import_koishi2.Schema.string().default("set_qq_avatar").description("\u5DE5\u5177\u540D\u79F0"),
|
|
496
509
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_QQ_AVATAR_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
497
510
|
}).description("\u4FEE\u6539 QQ \u5934\u50CF\u5DE5\u5177").collapse(),
|
|
498
511
|
setGroupCard: import_koishi2.Schema.object({
|
|
499
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
512
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
500
513
|
toolName: import_koishi2.Schema.string().default("set_group_card").description("\u5DE5\u5177\u540D\u79F0"),
|
|
501
514
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_GROUP_CARD_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
502
515
|
}).description("\u4FEE\u6539\u7FA4\u6210\u5458\u6635\u79F0\u5DE5\u5177").collapse(),
|
|
503
516
|
setGroupBan: import_koishi2.Schema.object({
|
|
504
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
517
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
505
518
|
toolName: import_koishi2.Schema.string().default("set_group_ban").description("\u5DE5\u5177\u540D\u79F0"),
|
|
506
519
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_GROUP_BAN_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
507
520
|
}).description("\u7981\u8A00\u5DE5\u5177").collapse(),
|
|
508
521
|
setGroupSpecialTitle: import_koishi2.Schema.object({
|
|
509
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
522
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
510
523
|
toolName: import_koishi2.Schema.string().default("set_group_special_title").description("\u5DE5\u5177\u540D\u79F0"),
|
|
511
524
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_GROUP_SPECIAL_TITLE_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
512
525
|
}).description("\u4FEE\u6539\u7FA4\u6210\u5458\u4E13\u5C5E\u5934\u8854\u5DE5\u5177").collapse(),
|
|
513
526
|
setMsgEmoji: import_koishi2.Schema.object({
|
|
514
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
515
|
-
`\u6CE8\u518C ChatLuna \u539F\u751F\u5DE5\u5177\uFF1A\u7ED9\u6D88\u606F\u6DFB\u52A0\u8868\u60C5\uFF0C\u9700\`chatluna-character\`\u5F00\u542F\`enableMessageId\`\uFF0C\u4E0E**XML \u8868\u60C5\u56DE\u5E94\u8C03\u7528**\u4E8C\u9009\u4E00\uFF0C\u70B9\u51FB\u67E5\u770B[\u8868\u60C5\u5BF9\u7167\u8868](https://bot.q.qq.com/wiki/develop/pythonsdk/model/emoji.html)`
|
|
516
|
-
),
|
|
527
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
517
528
|
toolName: import_koishi2.Schema.string().default("set_msg_emoji").description("\u5DE5\u5177\u540D\u79F0"),
|
|
518
529
|
description: import_koishi2.Schema.string().default(DEFAULT_SET_MSG_EMOJI_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
519
530
|
}).description("\u6D88\u606F\u8868\u60C5\u5DE5\u5177").collapse(),
|
|
520
531
|
deleteMessage: import_koishi2.Schema.object({
|
|
521
|
-
enabled: import_koishi2.Schema.boolean().default(false).
|
|
522
|
-
`\u6CE8\u518C ChatLuna \u539F\u751F\u5DE5\u5177\uFF1A\u64A4\u56DE\u6D88\u606F\uFF0C\u9700\`chatluna-character\`\u5F00\u542F\`enableMessageId\`\uFF0C\u4E0E**XML \u6D88\u606F\u64A4\u56DE\u8C03\u7528**\u4E8C\u9009\u4E00`
|
|
523
|
-
),
|
|
532
|
+
enabled: import_koishi2.Schema.boolean().default(false).hidden(),
|
|
524
533
|
toolName: import_koishi2.Schema.string().default("delete_msg").description("\u5DE5\u5177\u540D\u79F0"),
|
|
525
534
|
description: import_koishi2.Schema.string().default(DEFAULT_DELETE_MESSAGE_TOOL_DESCRIPTION).description("\u5DE5\u5177\u63CF\u8FF0")
|
|
526
535
|
}).description("\u64A4\u56DE\u6D88\u606F\u5DE5\u5177").collapse()
|
|
527
|
-
}).
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
enabled: false,
|
|
535
|
-
toolName: "set_self_profile",
|
|
536
|
-
description: DEFAULT_SET_SELF_PROFILE_TOOL_DESCRIPTION
|
|
537
|
-
},
|
|
538
|
-
setQQAvatar: {
|
|
539
|
-
enabled: false,
|
|
540
|
-
toolName: "set_qq_avatar",
|
|
541
|
-
description: DEFAULT_SET_QQ_AVATAR_TOOL_DESCRIPTION
|
|
542
|
-
},
|
|
543
|
-
setGroupCard: {
|
|
544
|
-
enabled: false,
|
|
545
|
-
toolName: "set_group_card",
|
|
546
|
-
description: DEFAULT_SET_GROUP_CARD_TOOL_DESCRIPTION
|
|
547
|
-
},
|
|
548
|
-
setGroupBan: {
|
|
549
|
-
enabled: false,
|
|
550
|
-
toolName: "set_group_ban",
|
|
551
|
-
description: DEFAULT_SET_GROUP_BAN_TOOL_DESCRIPTION
|
|
552
|
-
},
|
|
553
|
-
setGroupSpecialTitle: {
|
|
554
|
-
enabled: false,
|
|
555
|
-
toolName: "set_group_special_title",
|
|
556
|
-
description: DEFAULT_SET_GROUP_SPECIAL_TITLE_TOOL_DESCRIPTION
|
|
557
|
-
},
|
|
558
|
-
setMsgEmoji: {
|
|
559
|
-
enabled: false,
|
|
560
|
-
toolName: "set_msg_emoji",
|
|
561
|
-
description: DEFAULT_SET_MSG_EMOJI_TOOL_DESCRIPTION
|
|
562
|
-
},
|
|
563
|
-
deleteMessage: {
|
|
564
|
-
enabled: false,
|
|
565
|
-
toolName: "delete_msg",
|
|
566
|
-
description: DEFAULT_DELETE_MESSAGE_TOOL_DESCRIPTION
|
|
567
|
-
}
|
|
568
|
-
}).description("\u539F\u751F\u5DE5\u5177");
|
|
536
|
+
}).description("\u9AD8\u7EA7\u8BBE\u7F6E").collapse();
|
|
537
|
+
var NativeToolsSchema = import_koishi2.Schema.intersect([
|
|
538
|
+
import_koishi2.Schema.object({
|
|
539
|
+
enabledNativeTools: EnabledNativeToolsSchema
|
|
540
|
+
}).description(""),
|
|
541
|
+
NativeToolAdvancedSettingsSchema
|
|
542
|
+
]).description("\u539F\u751F\u5DE5\u5177");
|
|
569
543
|
|
|
570
544
|
// src/schema/xml-tools.ts
|
|
571
545
|
var import_koishi3 = require("koishi");
|
|
@@ -620,7 +594,7 @@ var XmlToolsSchema = import_koishi3.Schema.object({
|
|
|
620
594
|
`\u542F\u7528 XML \u7FA4\u6210\u5458\u7981\u8A00\u8C03\u7528\uFF0C\u4E0E**\u7981\u8A00\u5DE5\u5177**\u4E8C\u9009\u4E00`
|
|
621
595
|
),
|
|
622
596
|
referencePrompt: import_koishi3.Schema.string().role("textarea").default(DEFAULT_XML_REFERENCE_PROMPT).description("\u6A21\u578B\u56DE\u590D XML \u53C2\u8003\u63D0\u793A\u8BCD\u3002\u81EA\u884C\u5199\u5165\u63D0\u793A\u8BCD\u4E2D\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6CE8\u5165\uFF1B\u82E5\u5F00\u542F\u201C\u5C06 XML \u5DE5\u5177\u6CE8\u5165\u5B9E\u9A8C\u6027[\u5DE5\u5177\u8C03\u7528\u56DE\u590D](https://chatluna.chat/ecosystem/other/character.html#%E9%A2%84%E8%AE%BE)\u7684\u53C2\u6570\u4E2D\u201D\uFF0C\u5219\u65E0\u9700\u589E\u52A0\u989D\u5916\u63D0\u793A\u8BCD")
|
|
623
|
-
}).description("XML \u5DE5\u5177");
|
|
597
|
+
}).description("Character XML \u5DE5\u5177");
|
|
624
598
|
|
|
625
599
|
// src/schema/variables.ts
|
|
626
600
|
var import_koishi4 = require("koishi");
|
|
@@ -716,7 +690,7 @@ var VariablesSchema = import_koishi4.Schema.object({
|
|
|
716
690
|
},
|
|
717
691
|
groupShutList: { variableName: "groupShutList" },
|
|
718
692
|
random: { variableName: "random", min: 0, max: 100 }
|
|
719
|
-
}).description("\
|
|
693
|
+
}).description("\u53D8\u91CF");
|
|
720
694
|
|
|
721
695
|
// src/schema/index.ts
|
|
722
696
|
var OtherSettingsSchema = import_koishi5.Schema.object({
|
|
@@ -1325,12 +1299,18 @@ function resolveToolDescription(value, fallback) {
|
|
|
1325
1299
|
const trimmedValue = value.trim();
|
|
1326
1300
|
return trimmedValue || fallback;
|
|
1327
1301
|
}
|
|
1302
|
+
function isNativeToolEnabled(config, toolKey) {
|
|
1303
|
+
if (config.enabledNativeTools) {
|
|
1304
|
+
return config.enabledNativeTools.includes(toolKey);
|
|
1305
|
+
}
|
|
1306
|
+
return config[toolKey].enabled ?? false;
|
|
1307
|
+
}
|
|
1328
1308
|
function resolveOneBotProtocol(config, log) {
|
|
1329
1309
|
return config.oneBotProtocol;
|
|
1330
1310
|
}
|
|
1331
1311
|
function registerNativeTools(deps) {
|
|
1332
1312
|
const { ctx, config, plugin, protocol, log } = deps;
|
|
1333
|
-
if (config
|
|
1313
|
+
if (isNativeToolEnabled(config, "poke")) {
|
|
1334
1314
|
const toolName = resolveToolName(config.poke.toolName, "poke_user");
|
|
1335
1315
|
const description = resolveToolDescription(
|
|
1336
1316
|
config.poke.description,
|
|
@@ -1345,7 +1325,7 @@ function registerNativeTools(deps) {
|
|
|
1345
1325
|
});
|
|
1346
1326
|
log?.("info", `\u6233\u4E00\u6233\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1347
1327
|
}
|
|
1348
|
-
if (config
|
|
1328
|
+
if (isNativeToolEnabled(config, "setSelfProfile")) {
|
|
1349
1329
|
const toolName = resolveToolName(
|
|
1350
1330
|
config.setSelfProfile.toolName,
|
|
1351
1331
|
"set_self_profile"
|
|
@@ -1363,7 +1343,7 @@ function registerNativeTools(deps) {
|
|
|
1363
1343
|
});
|
|
1364
1344
|
log?.("info", `\u8BBE\u7F6E\u8D44\u6599\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1365
1345
|
}
|
|
1366
|
-
if (config
|
|
1346
|
+
if (isNativeToolEnabled(config, "setQQAvatar")) {
|
|
1367
1347
|
const toolName = resolveToolName(
|
|
1368
1348
|
config.setQQAvatar.toolName,
|
|
1369
1349
|
"set_qq_avatar"
|
|
@@ -1381,7 +1361,7 @@ function registerNativeTools(deps) {
|
|
|
1381
1361
|
});
|
|
1382
1362
|
log?.("info", `QQ \u5934\u50CF\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1383
1363
|
}
|
|
1384
|
-
if (config
|
|
1364
|
+
if (isNativeToolEnabled(config, "setGroupCard")) {
|
|
1385
1365
|
const toolName = resolveToolName(
|
|
1386
1366
|
config.setGroupCard.toolName,
|
|
1387
1367
|
"set_group_card"
|
|
@@ -1399,7 +1379,7 @@ function registerNativeTools(deps) {
|
|
|
1399
1379
|
});
|
|
1400
1380
|
log?.("info", `\u7FA4\u6635\u79F0\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1401
1381
|
}
|
|
1402
|
-
if (config
|
|
1382
|
+
if (isNativeToolEnabled(config, "setGroupBan")) {
|
|
1403
1383
|
const toolName = resolveToolName(
|
|
1404
1384
|
config.setGroupBan.toolName,
|
|
1405
1385
|
"set_group_ban"
|
|
@@ -1417,7 +1397,7 @@ function registerNativeTools(deps) {
|
|
|
1417
1397
|
});
|
|
1418
1398
|
log?.("info", `\u7FA4\u6210\u5458\u7981\u8A00\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1419
1399
|
}
|
|
1420
|
-
if (config
|
|
1400
|
+
if (isNativeToolEnabled(config, "setGroupSpecialTitle")) {
|
|
1421
1401
|
const toolName = resolveToolName(
|
|
1422
1402
|
config.setGroupSpecialTitle.toolName,
|
|
1423
1403
|
"set_group_special_title"
|
|
@@ -1440,7 +1420,7 @@ function registerNativeTools(deps) {
|
|
|
1440
1420
|
});
|
|
1441
1421
|
log?.("info", `\u7FA4\u4E13\u5C5E\u5934\u8854\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1442
1422
|
}
|
|
1443
|
-
if (config
|
|
1423
|
+
if (isNativeToolEnabled(config, "setMsgEmoji")) {
|
|
1444
1424
|
const toolName = resolveToolName(
|
|
1445
1425
|
config.setMsgEmoji.toolName,
|
|
1446
1426
|
"set_msg_emoji"
|
|
@@ -1458,7 +1438,7 @@ function registerNativeTools(deps) {
|
|
|
1458
1438
|
});
|
|
1459
1439
|
log?.("info", `\u6D88\u606F\u8868\u60C5\u5DE5\u5177\u5DF2\u6CE8\u518C: ${toolName}`);
|
|
1460
1440
|
}
|
|
1461
|
-
if (config
|
|
1441
|
+
if (isNativeToolEnabled(config, "deleteMessage")) {
|
|
1462
1442
|
const toolName = resolveToolName(
|
|
1463
1443
|
config.deleteMessage.toolName,
|
|
1464
1444
|
"delete_msg"
|
|
@@ -2824,7 +2804,7 @@ function apply(ctx, config) {
|
|
|
2824
2804
|
registerNativeTools({ ctx, config, plugin, protocol, log });
|
|
2825
2805
|
xmlRuntime = enableXmlRuntime ? registerXmlTools({ ctx, config, protocol, log }) : null;
|
|
2826
2806
|
if (characterCtx && xmlRuntime?.start()) {
|
|
2827
|
-
log("info", "XML \u5DE5\u5177\u5DF2\u542F\u7528");
|
|
2807
|
+
log("info", "Character XML \u5DE5\u5177\u5DF2\u542F\u7528");
|
|
2828
2808
|
}
|
|
2829
2809
|
log("info", "toolbox \u521D\u59CB\u5316\u5B8C\u6210");
|
|
2830
2810
|
};
|
|
@@ -2853,7 +2833,7 @@ function apply(ctx, config) {
|
|
|
2853
2833
|
});
|
|
2854
2834
|
if (!xmlRuntime) return;
|
|
2855
2835
|
const started = xmlRuntime.start();
|
|
2856
|
-
if (started) log("info", "XML \u5DE5\u5177\u5DF2\u542F\u7528");
|
|
2836
|
+
if (started) log("info", "Character XML \u5DE5\u5177\u5DF2\u542F\u7528");
|
|
2857
2837
|
});
|
|
2858
2838
|
}
|
|
2859
2839
|
ctx.on("dispose", dispose);
|
|
@@ -2865,6 +2845,15 @@ function apply(ctx, config) {
|
|
|
2865
2845
|
});
|
|
2866
2846
|
}
|
|
2867
2847
|
}
|
|
2848
|
+
|
|
2849
|
+
// src/index.ts
|
|
2850
|
+
var usage = `
|
|
2851
|
+
## \u4F7F\u7528\u8BF4\u660E
|
|
2852
|
+
|
|
2853
|
+
Character XML \u5DE5\u5177\u4EC5\u4F9B [koishi-plugin-chatluna-character](https://github.com/ChatLunaLab/chatluna-character) \u4F7F\u7528\uFF1B\u5982\u679C\u4F60\u53EA\u5B89\u88C5\u4E86 ChatLuna \u4E3B\u63D2\u4EF6\uFF0C\u8BF7\u4E0D\u8981\u5F00\u542F\u8FD9\u4E00\u9879\u3002
|
|
2854
|
+
|
|
2855
|
+
\u5982\u679C\u4F60\u4E0D\u786E\u5B9A\u5F53\u524D\u73AF\u5883\u662F\u5426\u9700\u8981\u8FD9\u7EC4\u80FD\u529B\uFF0C\u4F18\u5148\u4FDD\u6301\u5173\u95ED\uFF0C\u6309 README \u7684\u8BF4\u660E\u9010\u9879\u542F\u7528\u5373\u53EF\u3002
|
|
2856
|
+
`;
|
|
2868
2857
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2869
2858
|
0 && (module.exports = {
|
|
2870
2859
|
BasicSettingsSchema,
|
|
@@ -2912,5 +2901,6 @@ function apply(ctx, config) {
|
|
|
2912
2901
|
sendSetGroupCard,
|
|
2913
2902
|
sendSetGroupSpecialTitle,
|
|
2914
2903
|
sendSetProfile,
|
|
2915
|
-
sendSetQQAvatar
|
|
2904
|
+
sendSetQQAvatar,
|
|
2905
|
+
usage
|
|
2916
2906
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-chatluna-toolbox",
|
|
3
|
-
"description": "为 ChatLuna 提供更多原生工具、XML 工具与变量,仅支持 onebot 平台。",
|
|
4
|
-
"version": "0.0.
|
|
3
|
+
"description": "为 ChatLuna 提供更多原生工具、Character XML 工具与变量,仅支持 onebot 平台。",
|
|
4
|
+
"version": "0.0.18",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|