koishi-plugin-chatluna-toolbox 0.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/README.md +70 -0
- package/lib/index.js +1480 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# koishi-plugin-chatluna-toolbox
|
|
2
|
+
|
|
3
|
+
为 ChatLuna 提供可组合的工具能力,当前包含三类功能:
|
|
4
|
+
|
|
5
|
+
- 原生工具(Native Tools)
|
|
6
|
+
- XML 工具(XML Actions)
|
|
7
|
+
- 变量扩展(Variables)
|
|
8
|
+
|
|
9
|
+
插件目标是把常用的群聊动作能力(如戳一戳、消息表情、撤回消息)和上下文变量能力拆分为可配置模块,便于在 Koishi + ChatLuna 场景中按需启用。
|
|
10
|
+
|
|
11
|
+
## 功能概览
|
|
12
|
+
|
|
13
|
+
### 1) 原生工具
|
|
14
|
+
- 戳一戳
|
|
15
|
+
- 设置自身资料
|
|
16
|
+
- 设置群名片
|
|
17
|
+
- 给消息添加表情
|
|
18
|
+
- 撤回消息
|
|
19
|
+
|
|
20
|
+
### 2) XML 工具
|
|
21
|
+
支持从模型输出中解析 XML 动作标签并执行:
|
|
22
|
+
|
|
23
|
+
- `<poke id="..."/>`
|
|
24
|
+
- `<emoji message_id="..." emoji_id="..."/>`
|
|
25
|
+
- `<delete message_id="..."/>`
|
|
26
|
+
|
|
27
|
+
### 3) 变量扩展
|
|
28
|
+
- `userInfo`
|
|
29
|
+
- `botInfo`
|
|
30
|
+
- `groupInfo`
|
|
31
|
+
- `random`
|
|
32
|
+
|
|
33
|
+
确保你的 Koishi 环境已安装并启用:
|
|
34
|
+
|
|
35
|
+
- `koishi-plugin-chatluna`
|
|
36
|
+
- (可选)`koishi-plugin-chatluna-character`
|
|
37
|
+
|
|
38
|
+
## 快速上手
|
|
39
|
+
|
|
40
|
+
### 1. 在 Koishi 配置中启用插件
|
|
41
|
+
在 Koishi 控制台或配置文件中添加并启用 `chatluna-toolbox`。
|
|
42
|
+
|
|
43
|
+
### 2. 打开需要的能力开关
|
|
44
|
+
建议先最小化启用:
|
|
45
|
+
|
|
46
|
+
- 开启一个 OneBot 协议(NapCat 或 LLBot)
|
|
47
|
+
- 按需开启原生工具
|
|
48
|
+
- 按需开启 XML 工具
|
|
49
|
+
- 按需配置变量项
|
|
50
|
+
|
|
51
|
+
### 3. 配置 XML 参考提示词
|
|
52
|
+
在 `XML 工具` 分组中找到 `参考提示词`,可直接使用默认模板,或根据你的 Bot 规则进行调整。
|
|
53
|
+
|
|
54
|
+
### 4. 构建
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 开发命令
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm run typecheck
|
|
64
|
+
npm run build
|
|
65
|
+
npm run test
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 仓库地址
|
|
69
|
+
|
|
70
|
+
- https://github.com/Sor85/koishi-plugin-chatluna-toolbox
|