cx-feishu 0.1.0 → 0.1.2
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.zh-CN.md +37 -0
- package/package.json +14 -2
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# cx-feishu
|
|
2
|
+
|
|
3
|
+
一个 [pi](https://pi.dev) 包,让 [ComChatX](https://comchatx.com) 上 cx 的电脑通过 [pi-channels](https://www.npmjs.com/package/@amaster.ai/pi-channels)(`@amaster.ai/pi-channels`)及其 `notify` 工具,向飞书群机器人发送消息。它本身不发送任何消息,既不打包 pi-channels,也不将它列为依赖:pi-channels 由卖家另外安装。
|
|
4
|
+
|
|
5
|
+
它只有一个技能 `cx-feishu`,告诉模型 pi-channels 自己的说明在这里没有讲到的内容:机器人的地址从哪里来、什么会覆盖它;飞书机器人只读取原始的 `json` 正文(`notify` 默认的封装,以及不带 `json` 的 `test` 操作,都会被拒绝);关键词、签名校验和 IP 白名单对发送有什么影响;`Sent` 表示 HTTP 2xx,而飞书拒绝时也返回 HTTP 200 和非零的 `code`;回复不会回到任何对话;以及监听器会让 cx 的电脑保持开机。
|
|
6
|
+
|
|
7
|
+
## 机器人
|
|
8
|
+
|
|
9
|
+
一个 `webhook` 适配器和一条路由,写在 pi 设置的 `pi-channels` 部分:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"pi-channels": {
|
|
14
|
+
"adapters": { "feishu": { "type": "webhook" } },
|
|
15
|
+
"routes": { "team": { "adapter": "feishu", "recipient": "${FEISHU_HOOK}" } }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
pi-channels 会展开全局设置和 agent 文件夹设置中的 `${VAR}`,但不展开项目的 `.pi/settings.json`。项目的 `pi-channels` 部分会按 `adapters`、`routes` 和 `bridge` 三个键逐个替换其他层的设置,所以用来停用另一层机器人的部分,要把这三个键都写上。
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pi install -l npm:@amaster.ai/pi-channels@0.1.28
|
|
26
|
+
pi install -l npm:cx-feishu
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
安装时指定 pi-channels 0.1.28,这是这个包测试所用的版本,这样 pi 会保持这个版本。请在 `/tenant` 中运行;不加 `-l` 的话,安装的内容会在 cx 的电脑下次启动时消失。在 ComChatX 上,两者上架后,卖家在「插件」页安装。
|
|
30
|
+
|
|
31
|
+
## 开发
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm ci
|
|
35
|
+
npm run typecheck
|
|
36
|
+
npm test # 用锁定版本的 pi 加载这个包,并通过 pi-channels 0.1.28 向 127.0.0.1 上的桩服务发送
|
|
37
|
+
```
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cx-feishu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A pi package that tells the model what pi-channels' notify needs to reach a Feishu group bot from a ComChatX box, and what its answer means.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ComChatX",
|
|
7
|
+
"comchatx": {
|
|
8
|
+
"about": "让 cx 通过你的飞书机器人给你发消息。",
|
|
9
|
+
"mark": {
|
|
10
|
+
"line": "megaphone"
|
|
11
|
+
},
|
|
12
|
+
"section": "extensions",
|
|
13
|
+
"order": 40,
|
|
14
|
+
"builds": [
|
|
15
|
+
"@amaster.ai/pi-channels"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
7
18
|
"homepage": "https://github.com/comchatx/cx-feishu#readme",
|
|
8
19
|
"repository": {
|
|
9
20
|
"type": "git",
|
|
@@ -20,7 +31,8 @@
|
|
|
20
31
|
]
|
|
21
32
|
},
|
|
22
33
|
"files": [
|
|
23
|
-
"skills"
|
|
34
|
+
"skills",
|
|
35
|
+
"README.zh-CN.md"
|
|
24
36
|
],
|
|
25
37
|
"scripts": {
|
|
26
38
|
"typecheck": "tsc --noEmit",
|