cx-feishu 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +36 -2
- package/package.json +54 -4
- package/skills/cx-feishu/SKILL.md +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ComChatX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# cx-feishu
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A [pi](https://pi.dev) package for sending messages to a Feishu (飞书) group bot from a [ComChatX](https://comchatx.com) box with [pi-channels](https://www.npmjs.com/package/@amaster.ai/pi-channels) (`@amaster.ai/pi-channels`) and its `notify` tool. It sends nothing itself and neither bundles nor lists pi-channels: the seller installs pi-channels beside it.
|
|
4
|
+
|
|
5
|
+
It is one skill, `cx-feishu`, telling the model what pi-channels' own words miss here: where a bot's address comes from and what overrides it, that a Feishu bot reads only the raw `json` body (`notify`'s default envelope, and its `test` action without `json`, are refused), what keywords, 签名校验 and IP whitelists do to a send, that `Sent` means an HTTP 2xx and Feishu refuses with HTTP 200 and a nonzero `code`, that replies come back to no conversation, and that a listener keeps the box awake.
|
|
6
|
+
|
|
7
|
+
## A bot
|
|
8
|
+
|
|
9
|
+
One `webhook` adapter and one route, in the `pi-channels` section of pi's settings:
|
|
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 expands `${VAR}` in the global and agent-directory settings, not in a project's `.pi/settings.json`; a project's `pi-channels` section replaces the others' key by key — `adapters`, `routes` and `bridge` each — so a section meant to stop another layer's bot carries all three.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
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 is named at 0.1.28, the version this package is checked against, so pi keeps that version. Run in `/tenant`; without `-l` the install is gone at the box's next start. On ComChatX, a seller installs both from the Plugins page once they are listed.
|
|
30
|
+
|
|
31
|
+
## Develop
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm ci
|
|
35
|
+
npm run typecheck
|
|
36
|
+
npm test # loads the package with the pinned pi, and sends through pi-channels 0.1.28 to a stub on 127.0.0.1
|
|
37
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cx-feishu",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
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
|
+
"license": "MIT",
|
|
6
|
+
"author": "ComChatX",
|
|
7
|
+
"comchatx": {
|
|
8
|
+
"about": "让 cx 通过你的飞书机器人给你发消息。",
|
|
9
|
+
"description": "cx 会在你的机器人所在的飞书群里发消息,比如某个 listing 丢失 Buy Box 时。在飞书里回复的消息不会传给 cx。\n\n安装后,在它的设置里填写机器人的 Webhook 地址。",
|
|
10
|
+
"mark": {
|
|
11
|
+
"line": "megaphone"
|
|
12
|
+
},
|
|
13
|
+
"section": "extensions",
|
|
14
|
+
"order": 40,
|
|
15
|
+
"builds": [
|
|
16
|
+
"@amaster.ai/pi-channels"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/comchatx/cx-feishu#readme",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/comchatx/cx-feishu.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": "https://github.com/comchatx/cx-feishu/issues",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"pi-package"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"pi": {
|
|
30
|
+
"skills": [
|
|
31
|
+
"./skills"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"skills"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "vitest run"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@earendil-works/pi-coding-agent": "1.1.0",
|
|
43
|
+
"@types/node": "26.2.0",
|
|
44
|
+
"typescript": "7.0.2",
|
|
45
|
+
"vitest": "4.1.11"
|
|
46
|
+
},
|
|
47
|
+
"overrides": {
|
|
48
|
+
"@earendil-works/chord": "1.1.0",
|
|
49
|
+
"@earendil-works/pi-ai": "1.1.0",
|
|
50
|
+
"@earendil-works/pi-mcp": "1.1.0",
|
|
51
|
+
"@earendil-works/pi-tui": "1.1.0",
|
|
52
|
+
"@earendil-works/pi-codemode": "1.1.0",
|
|
53
|
+
"@earendil-works/pi-agent-core": "1.1.0",
|
|
54
|
+
"@earendil-works/pi-telemetry": "1.1.0"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cx-feishu
|
|
3
|
+
description: "Sending a message to a Feishu (飞书) group bot from a ComChatX box - a report, an alert, a heartbeat's result - with pi-channels (`@amaster.ai/pi-channels`) and its `notify` tool; what pi-channels' own words miss here. Needs @amaster.ai/pi-channels; if no notify tool is offered, it is not installed, and the seller installs it in Plugins once it is listed there, or it is installed with `pi install -l npm:@amaster.ai/pi-channels@0.1.28` run in /tenant (without -l it is gone at the box's next start). cx-feishu itself installs the same way: Plugins once listed, or `pi install -l npm:cx-feishu` in /tenant."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Where the bot's address comes from
|
|
7
|
+
|
|
8
|
+
- A bot is a route in pi-channels' settings: `notify action:"list"` shows the routes and hides their addresses. Send to a route by its name as `adapter`.
|
|
9
|
+
- An address the seller gives on the Plugins page works from the box's next open, not in the conversation already open.
|
|
10
|
+
- A `pi-channels` section in `/tenant/.pi/settings.json` replaces the one from Plugins key by key: its `adapters`, `routes` and `bridge` each replace the Plugins ones, and a key it leaves out keeps the Plugins value. A section meant to stop the Plugins bot carries all three.
|
|
11
|
+
- An address the seller says in chat, or one passed as `recipient`, is kept in the conversation's file. A `recipient` passed with a route replaces the route's own address for that send. Use the route and pass no `recipient`.
|
|
12
|
+
|
|
13
|
+
## What a send needs
|
|
14
|
+
|
|
15
|
+
- Pass the message as `json`, the body a Feishu bot reads, for example `{"msg_type":"text","content":{"text":"..."}}`. Without `json`, `notify` posts its own envelope (`text`, `source`, `metadata`, `timestamp`), which Feishu takes no text from and refuses.
|
|
16
|
+
- `action:"test"` without `json` posts that envelope: a bot refuses it. Test with a short `json` text.
|
|
17
|
+
- A bot with keywords refuses any message whose text lacks one of them; ask the seller for the bot's keywords and put one in the text. A bot with 签名校验 (signature check) or an IP whitelist refuses every send from here.
|
|
18
|
+
|
|
19
|
+
## What "Sent" means
|
|
20
|
+
|
|
21
|
+
- `notify` says `Sent` on any HTTP 2xx and never reads the reply. Feishu refuses with HTTP 200 and a nonzero `code` in the body (a missing keyword is `19024`), so `Sent` does not mean the message was shown. When it matters, ask the seller whether it arrived; if it did not, the cause is one of those above.
|
|
22
|
+
|
|
23
|
+
## What does not come back
|
|
24
|
+
|
|
25
|
+
- Replies in the Feishu group reach no conversation here: a webhook bot only receives.
|
|
26
|
+
- pi-channels' `feishu` and `dingtalk` adapters listen for replies unless their `eventMode` is `off`. A listener holds a connection open and keeps the box awake, and awake time is billed; the `webhook` adapter holds nothing open.
|