@m1heng-clawd/feishu 0.1.13 → 0.1.15
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 +82 -2
- package/index.ts +7 -2
- package/package.json +5 -4
- package/skills/feishu-chat/SKILL.md +139 -0
- package/skills/feishu-urgent/SKILL.md +107 -0
- package/src/bot.ts +569 -59
- package/src/channel.ts +2 -0
- package/src/chat-tools/actions.ts +433 -0
- package/src/chat-tools/common.ts +13 -0
- package/src/chat-tools/index.ts +2 -0
- package/src/chat-tools/register.ts +72 -0
- package/src/chat-tools/schemas.ts +66 -0
- package/src/client.ts +13 -0
- package/src/config-schema.ts +6 -0
- package/src/drive-tools/actions.ts +57 -21
- package/src/drive-tools/schemas.ts +2 -2
- package/src/media-duration.ts +190 -0
- package/src/media.ts +60 -5
- package/src/mention.ts +1 -1
- package/src/monitor.ts +32 -8
- package/src/policy.ts +7 -3
- package/src/reply-dispatcher.ts +97 -13
- package/src/send.ts +360 -42
- package/src/streaming-card.ts +32 -4
- package/src/tools-config.ts +9 -2
- package/src/types.ts +8 -1
- package/src/typing.ts +115 -5
- package/src/urgent-tools/actions.ts +84 -0
- package/src/urgent-tools/index.ts +3 -0
- package/src/urgent-tools/register.ts +64 -0
- package/src/urgent-tools/schemas.ts +25 -0
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ openclaw plugins list | rg -i feishu
|
|
|
91
91
|
| Permission | Scope | Description |
|
|
92
92
|
|------------|-------|-------------|
|
|
93
93
|
| `contact:user.base:readonly` | User info | Get basic user info (required to resolve sender display names for speaker attribution) |
|
|
94
|
-
| `im:message.group_msg` | Group | Read all group messages (sensitive) |
|
|
94
|
+
| `im:message.group_msg` | Group | Read all group messages (sensitive). Required when you want `requireMention: false` to work for non-@ group messages |
|
|
95
95
|
| `im:message:readonly` | Read | Get message history |
|
|
96
96
|
| `im:message:update` | Edit | Update/edit sent messages |
|
|
97
97
|
| `im:message:recall` | Recall | Recall sent messages |
|
|
@@ -111,6 +111,8 @@ openclaw plugins list | rg -i feishu
|
|
|
111
111
|
| `task:tasklist:read` | `feishu_tasklist_get`, `feishu_tasklist_list` | Get/list tasklists |
|
|
112
112
|
| `task:comment:read` | `feishu_task_comment_list`, `feishu_task_comment_get` | List/get task comments |
|
|
113
113
|
| `task:attachment:read` | `feishu_task_attachment_list`, `feishu_task_attachment_get` | List/get task attachments |
|
|
114
|
+
| `im:chat.announcement:read` | `feishu_chat` | Read group announcement |
|
|
115
|
+
| `im:chat:readonly` | `feishu_chat` | Get chat info, check bot membership |
|
|
114
116
|
|
|
115
117
|
**Read-write** (optional, for create/edit/delete operations):
|
|
116
118
|
|
|
@@ -125,6 +127,10 @@ openclaw plugins list | rg -i feishu
|
|
|
125
127
|
| `task:tasklist:write` | `feishu_tasklist_create`, `feishu_tasklist_update`, `feishu_tasklist_delete`, `feishu_tasklist_add_members`, `feishu_tasklist_remove_members`, `feishu_task_add_tasklist`, `feishu_task_remove_tasklist` | Create/update/delete tasklists and manage membership |
|
|
126
128
|
| `task:comment:write` | `feishu_task_comment_create`, `feishu_task_comment_update`, `feishu_task_comment_delete` | Create/update/delete task comments |
|
|
127
129
|
| `task:attachment:write` | `feishu_task_attachment_upload`, `feishu_task_attachment_delete` | Upload/delete task attachments |
|
|
130
|
+
| `im:message.urgent` | `feishu_urgent` | Send urgent (buzz) notifications via app (in-app). Use `sms` and `phone` variants (`im:message.urgent:sms`, `im:message.urgent:phone`) for SMS and voice call. |
|
|
131
|
+
| `im:chat.announcement` | `feishu_chat` | Write/update group announcement |
|
|
132
|
+
| `im:chat` | `feishu_chat` | Create and delete group chats |
|
|
133
|
+
| `im:chat.members` | `feishu_chat` | Add members to group chats |
|
|
128
134
|
|
|
129
135
|
> Task scope names may vary slightly in Feishu console UI. If needed, search for Task / Tasklist / Comment / Attachment-related permissions and grant read/write accordingly.
|
|
130
136
|
|
|
@@ -243,6 +249,10 @@ channels:
|
|
|
243
249
|
groupPolicy: "allowlist"
|
|
244
250
|
# Require @mention in groups
|
|
245
251
|
requireMention: true
|
|
252
|
+
# Safety default for mention-free mode (`requireMention: false`):
|
|
253
|
+
# only allow non-@ messages in groups with <= 1 bot.
|
|
254
|
+
# Set true to also allow mention-free messages in multi-bot groups.
|
|
255
|
+
allowMentionlessInMultiBotGroup: false
|
|
246
256
|
# Group command mention bypass: "never" | "single_bot" | "always"
|
|
247
257
|
# Default "single_bot": allow authorized command-only messages without @
|
|
248
258
|
# only when the group has a single bot.
|
|
@@ -343,6 +353,19 @@ Notes:
|
|
|
343
353
|
- If any user is explicitly `@`-mentioned in the same message, bypass is disabled.
|
|
344
354
|
- In DMs, this setting does not apply.
|
|
345
355
|
|
|
356
|
+
#### Group Mention-Free Behavior (`requireMention: false`)
|
|
357
|
+
|
|
358
|
+
When `requireMention: false`, non-@ group messages are handled with a safety default:
|
|
359
|
+
|
|
360
|
+
| `allowMentionlessInMultiBotGroup` | Behavior for non-@ group messages |
|
|
361
|
+
|-----------------------------------|-----------------------------------|
|
|
362
|
+
| `false` (default) | Only accepted when the group has at most one bot. In multi-bot groups, explicit `@bot` is still required. |
|
|
363
|
+
| `true` | Accepted even in multi-bot groups (use only if you accept duplicate-trigger risk). |
|
|
364
|
+
|
|
365
|
+
Important:
|
|
366
|
+
- `im:message.group_msg` is required for receiving non-@ group messages and this is a **sensitive permission** in Feishu.
|
|
367
|
+
- If this scope is not approved, Feishu usually only delivers `@bot` group messages (`im:message.group_at_msg:readonly`).
|
|
368
|
+
|
|
346
369
|
#### Connection Mode
|
|
347
370
|
|
|
348
371
|
Two connection modes are available for receiving events from Feishu:
|
|
@@ -394,6 +417,14 @@ https://your-domain.com/feishu/events
|
|
|
394
417
|
|
|
395
418
|
When enabled, each DM user automatically gets their own isolated agent instance with a dedicated workspace. This provides complete isolation including separate conversation history, memory (MEMORY.md), and workspace files.
|
|
396
419
|
|
|
420
|
+
#### Chat Management Limitations ⚠️
|
|
421
|
+
|
|
422
|
+
> **Important:** `delete_chat` requires the bot to be the **group owner**. If the bot was added to an existing chat as a member (not the owner), it cannot disband it.
|
|
423
|
+
>
|
|
424
|
+
> If you need to disband a chat that the bot does not own:
|
|
425
|
+
> 1. The **group owner** transfers ownership to the bot first, or
|
|
426
|
+
> 2. The group owner disbands the group directly in the Feishu app.
|
|
427
|
+
|
|
397
428
|
```yaml
|
|
398
429
|
channels:
|
|
399
430
|
feishu:
|
|
@@ -446,6 +477,8 @@ session:
|
|
|
446
477
|
- **Drive tools**: List folders, get file info, create folders, move/delete files
|
|
447
478
|
- **Bitable tools**: Manage bitable (多维表格) fields and records (read/create/update/delete), supports both `/base/` and `/wiki/` URLs
|
|
448
479
|
- **Task tools**: Create, get details, update, and delete tasks via Feishu Task v2 API
|
|
480
|
+
- **Chat tools**: Read and write group announcements, create group chats, add members, check bot membership, delete chats (`feishu_chat`)
|
|
481
|
+
- **Urgent notification tools**: Send buzz/urgent notifications (app, SMS, voice call) via `feishu_urgent`
|
|
449
482
|
- **@mention forwarding**: When you @mention someone in your message, the bot's reply will automatically @mention them too
|
|
450
483
|
- **Permission error notification**: When the bot encounters a Feishu API permission error, it automatically notifies the user with the permission grant URL
|
|
451
484
|
- **Dynamic agent creation**: Each DM user can have their own isolated agent instance with dedicated workspace (optional)
|
|
@@ -472,6 +505,13 @@ Check the following:
|
|
|
472
505
|
4. Are the permissions approved?
|
|
473
506
|
5. For webhook mode: is your server running and the URL publicly accessible?
|
|
474
507
|
|
|
508
|
+
#### `requireMention: false` but group still needs @
|
|
509
|
+
|
|
510
|
+
Check the following:
|
|
511
|
+
1. Is `im:message.group_msg` approved? (sensitive permission, required for non-@ group messages)
|
|
512
|
+
2. If the group has multiple bots, do you explicitly set `allowMentionlessInMultiBotGroup: true`?
|
|
513
|
+
3. Is `requireMention: false` configured on the effective account/group?
|
|
514
|
+
|
|
475
515
|
#### 403 error when sending messages
|
|
476
516
|
|
|
477
517
|
Ensure `im:message:send_as_bot` permission is approved.
|
|
@@ -567,7 +607,7 @@ openclaw plugins list | rg -i feishu
|
|
|
567
607
|
| 权限 | 范围 | 说明 |
|
|
568
608
|
|------|------|------|
|
|
569
609
|
| `contact:user.base:readonly` | 用户信息 | 获取用户基本信息(用于解析发送者姓名,避免群聊/私聊把不同人当成同一说话者) |
|
|
570
|
-
| `im:message.group_msg` | 群聊 |
|
|
610
|
+
| `im:message.group_msg` | 群聊 | 读取所有群消息(敏感权限)。当你希望 `requireMention: false` 对“未 @ 的群消息”生效时必需 |
|
|
571
611
|
| `im:message:readonly` | 读取 | 获取历史消息 |
|
|
572
612
|
| `im:message:update` | 编辑 | 更新/编辑已发送消息 |
|
|
573
613
|
| `im:message:recall` | 撤回 | 撤回已发送消息 |
|
|
@@ -587,6 +627,8 @@ openclaw plugins list | rg -i feishu
|
|
|
587
627
|
| `task:tasklist:read` | `feishu_tasklist_get`, `feishu_tasklist_list` | 获取/列出任务清单(tasklists) |
|
|
588
628
|
| `task:comment:read` | `feishu_task_comment_list`, `feishu_task_comment_get` | 列出/获取任务评论 |
|
|
589
629
|
| `task:attachment:read` | `feishu_task_attachment_list`, `feishu_task_attachment_get` | 列出/获取任务附件 |
|
|
630
|
+
| `im:chat.announcement:read` | `feishu_chat` | 读取群公告 |
|
|
631
|
+
| `im:chat:readonly` | `feishu_chat` | 获取群信息、检查机器人是否在群内 |
|
|
590
632
|
|
|
591
633
|
**读写权限**(可选,用于创建/编辑/删除操作):
|
|
592
634
|
|
|
@@ -601,6 +643,10 @@ openclaw plugins list | rg -i feishu
|
|
|
601
643
|
| `task:tasklist:write` | `feishu_tasklist_create`, `feishu_tasklist_update`, `feishu_tasklist_delete`, `feishu_tasklist_add_members`, `feishu_tasklist_remove_members`, `feishu_task_add_tasklist`, `feishu_task_remove_tasklist` | 创建/更新/删除任务清单并管理成员/关联任务 |
|
|
602
644
|
| `task:comment:write` | `feishu_task_comment_create`, `feishu_task_comment_update`, `feishu_task_comment_delete` | 创建/更新/删除任务评论 |
|
|
603
645
|
| `task:attachment:write` | `feishu_task_attachment_upload`, `feishu_task_attachment_delete` | 上传/删除任务附件 |
|
|
646
|
+
| `im:message.urgent` | `feishu_urgent` | 发送应用内加急(buzz)通知。使用 `sms` 和 `phone` 变体(`im:message.urgent:sms`、`im:message.urgent:phone`)可发送短信和语音电话加急。 |
|
|
647
|
+
| `im:chat.announcement` | `feishu_chat` | 写入/更新群公告 |
|
|
648
|
+
| `im:chat` | `feishu_chat` | 创建和删除群聊 |
|
|
649
|
+
| `im:chat.members` | `feishu_chat` | 向群聊添加成员 |
|
|
604
650
|
|
|
605
651
|
> 飞书控制台中任务权限的显示名称可能略有差异,必要时可按关键字 `task` / `tasklist` / `comment` / `attachment` 搜索并授予对应读写权限。
|
|
606
652
|
|
|
@@ -719,6 +765,10 @@ channels:
|
|
|
719
765
|
groupPolicy: "allowlist"
|
|
720
766
|
# 群聊是否需要 @机器人
|
|
721
767
|
requireMention: true
|
|
768
|
+
# 免 @ 安全默认策略(requireMention=false 时):
|
|
769
|
+
# 仅在群内机器人数量 <= 1 时处理未 @ 的群消息。
|
|
770
|
+
# 设为 true 可在多 bot 群也放开免 @(需自行承担重复触发风险)。
|
|
771
|
+
allowMentionlessInMultiBotGroup: false
|
|
722
772
|
# 群聊命令绕过 @ 策略: "never" | "single_bot" | "always"
|
|
723
773
|
# 默认 "single_bot":仅当群内机器人数量 <= 1 时,允许已授权命令免 @
|
|
724
774
|
groupCommandMentionBypass: "single_bot"
|
|
@@ -818,6 +868,19 @@ channels:
|
|
|
818
868
|
- 同一条消息里如果显式 `@` 了任意用户,则不会触发命令免 `@`。
|
|
819
869
|
- 私聊场景不受该配置影响。
|
|
820
870
|
|
|
871
|
+
#### 群聊免 @ 行为(`requireMention: false`)
|
|
872
|
+
|
|
873
|
+
当 `requireMention: false` 时,插件对“未 @ 的群消息”采用安全默认策略:
|
|
874
|
+
|
|
875
|
+
| `allowMentionlessInMultiBotGroup` | 未 @ 群消息行为 |
|
|
876
|
+
|-----------------------------------|----------------|
|
|
877
|
+
| `false`(默认) | 仅当群里机器人数量不超过 1 个时处理;多 bot 群仍要求显式 `@bot`。 |
|
|
878
|
+
| `true` | 即使在多 bot 群也处理未 @ 消息(仅建议在可接受重复触发风险时启用)。 |
|
|
879
|
+
|
|
880
|
+
重要说明:
|
|
881
|
+
- 要接收未 @ 的群消息,必须申请并通过 `im:message.group_msg`,且该权限是飞书**敏感权限**。
|
|
882
|
+
- 若未通过该权限,飞书通常只会推送 `@bot` 群消息(`im:message.group_at_msg:readonly`)。
|
|
883
|
+
|
|
821
884
|
#### 连接模式
|
|
822
885
|
|
|
823
886
|
支持两种从飞书接收事件的连接模式:
|
|
@@ -865,6 +928,14 @@ https://your-domain.com/feishu/events
|
|
|
865
928
|
| `raw` | 始终纯文本,表格转为 ASCII |
|
|
866
929
|
| `card` | 始终使用卡片,支持语法高亮、表格、链接等 |
|
|
867
930
|
|
|
931
|
+
#### 群管理限制 ⚠️
|
|
932
|
+
|
|
933
|
+
> **重要提示:** `delete_chat` 需要机器人是该群的**群主**。如果机器人是以成员身份加入现有群聊(非群主),则无法解散该群聊。
|
|
934
|
+
>
|
|
935
|
+
> 如需解散机器人不拥有的群聊:
|
|
936
|
+
> 1. **群主**将群主权限转让给机器人,或
|
|
937
|
+
> 2. 由群主直接在飞书客户端解散群聊。
|
|
938
|
+
|
|
868
939
|
#### 动态 Agent 创建(多用户 Workspace 隔离)
|
|
869
940
|
|
|
870
941
|
启用后,每个私聊用户会自动获得独立的 agent 实例和专属 workspace。这提供完整的隔离,包括独立的对话历史、记忆(MEMORY.md)和工作区文件。
|
|
@@ -921,6 +992,8 @@ session:
|
|
|
921
992
|
- **云空间工具**:列出文件夹、获取文件信息、创建文件夹、移动/删除文件
|
|
922
993
|
- **多维表格工具**:支持多维表格字段与记录的读取/创建/更新/删除,支持 `/base/` 和 `/wiki/` 两种链接格式
|
|
923
994
|
- **任务工具**:基于 Task v2 API 支持任务创建、获取详情、更新和删除
|
|
995
|
+
- **群聊工具**:读写群公告、创建群聊、添加成员、检查机器人是否在群内、删除群聊(`feishu_chat`)
|
|
996
|
+
- **加急通知工具**:发送应用内加急(buzz)、短信、语音电话加急通知(`feishu_urgent`)
|
|
924
997
|
- **@ 转发功能**:在消息中 @ 某人,机器人的回复会自动 @ 该用户
|
|
925
998
|
- **权限错误提示**:当机器人遇到飞书 API 权限错误时,会自动通知用户并提供权限授权链接
|
|
926
999
|
- **动态 Agent 创建**:每个私聊用户可拥有独立的 agent 实例和专属 workspace(可选)
|
|
@@ -947,6 +1020,13 @@ session:
|
|
|
947
1020
|
4. 相关权限是否已申请并审核通过?
|
|
948
1021
|
5. 如果使用 webhook 模式:服务是否正在运行?URL 是否公网可访问?
|
|
949
1022
|
|
|
1023
|
+
#### 已配置 `requireMention: false`,群里仍然必须 @
|
|
1024
|
+
|
|
1025
|
+
请重点检查:
|
|
1026
|
+
1. 是否已申请并审核通过 `im:message.group_msg`(敏感权限,接收未 @ 群消息必需)
|
|
1027
|
+
2. 群里若有多个 bot,是否显式设置了 `allowMentionlessInMultiBotGroup: true`
|
|
1028
|
+
3. `requireMention: false` 是否配置在当前生效的账号/群配置上
|
|
1029
|
+
|
|
950
1030
|
#### 返回消息时 403 错误
|
|
951
1031
|
|
|
952
1032
|
确保已申请 `im:message:send_as_bot` 权限,并且权限已审核通过。
|
package/index.ts
CHANGED
|
@@ -2,12 +2,14 @@ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
|
2
2
|
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
3
3
|
import { feishuPlugin } from "./src/channel.js";
|
|
4
4
|
import { setFeishuRuntime } from "./src/runtime.js";
|
|
5
|
+
import { registerFeishuBitableTools } from "./src/bitable-tools/index.js";
|
|
5
6
|
import { registerFeishuDocTools } from "./src/doc-tools/index.js";
|
|
6
|
-
import { registerFeishuWikiTools } from "./src/wiki-tools/index.js";
|
|
7
7
|
import { registerFeishuDriveTools } from "./src/drive-tools/index.js";
|
|
8
8
|
import { registerFeishuPermTools } from "./src/perm-tools/index.js";
|
|
9
|
-
import { registerFeishuBitableTools } from "./src/bitable-tools/index.js";
|
|
10
9
|
import { registerFeishuTaskTools } from "./src/task-tools/index.js";
|
|
10
|
+
import { registerFeishuChatTools } from "./src/chat-tools/index.js";
|
|
11
|
+
import { registerFeishuUrgentTools } from "./src/urgent-tools/index.js";
|
|
12
|
+
import { registerFeishuWikiTools } from "./src/wiki-tools/index.js";
|
|
11
13
|
|
|
12
14
|
export { monitorFeishuProvider } from "./src/monitor.js";
|
|
13
15
|
export {
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
listReactionsFeishu,
|
|
32
34
|
FeishuEmoji,
|
|
33
35
|
} from "./src/reactions.js";
|
|
36
|
+
export { urgentMessageFeishu, type FeishuUrgentType } from "./src/urgent-tools/index.js";
|
|
34
37
|
export {
|
|
35
38
|
extractMentionTargets,
|
|
36
39
|
extractMessageBody,
|
|
@@ -59,6 +62,8 @@ const plugin = {
|
|
|
59
62
|
registerFeishuPermTools(api);
|
|
60
63
|
registerFeishuBitableTools(api);
|
|
61
64
|
registerFeishuTaskTools(api);
|
|
65
|
+
registerFeishuChatTools(api);
|
|
66
|
+
registerFeishuUrgentTools(api);
|
|
62
67
|
},
|
|
63
68
|
};
|
|
64
69
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m1heng-clawd/feishu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenClaw Feishu/Lark channel plugin",
|
|
6
6
|
"scripts": {
|
|
@@ -56,17 +56,18 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
58
58
|
"@sinclair/typebox": "0.34.48",
|
|
59
|
+
"https-proxy-agent": "^7.0.6",
|
|
59
60
|
"zod": "^4.3.6"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@vitest/coverage-v8": "^2.1.8",
|
|
63
63
|
"@types/node": "^25.0.10",
|
|
64
|
-
"
|
|
64
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
65
|
+
"openclaw": "2026.3.1",
|
|
65
66
|
"tsx": "^4.21.0",
|
|
66
67
|
"typescript": "^5.7.0",
|
|
67
68
|
"vitest": "^2.1.8"
|
|
68
69
|
},
|
|
69
70
|
"peerDependencies": {
|
|
70
|
-
"openclaw": ">=2026.
|
|
71
|
+
"openclaw": ">=2026.3.1"
|
|
71
72
|
}
|
|
72
73
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Feishu Chat Tool
|
|
2
|
+
|
|
3
|
+
Feishu chat operations including group announcement reading/writing and group chat management.
|
|
4
|
+
|
|
5
|
+
## Actions
|
|
6
|
+
|
|
7
|
+
### Get Announcement Info
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{ "action": "get_announcement_info", "chat_id": "oc_abc123def" }
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Returns basic announcement information including type (doc or docx) and metadata.
|
|
14
|
+
|
|
15
|
+
### Get Full Announcement
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "action": "get_announcement", "chat_id": "oc_abc123def" }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Returns complete announcement content. Supports both old (doc) and new (docx) announcement formats.
|
|
22
|
+
|
|
23
|
+
### List Announcement Blocks
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{ "action": "list_announcement_blocks", "chat_id": "oc_abc123def" }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Returns all blocks for a docx-format announcement.
|
|
30
|
+
|
|
31
|
+
### Get Single Announcement Block
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{ "action": "get_announcement_block", "chat_id": "oc_abc123def", "block_id": "block_123" }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Returns a single block from the announcement.
|
|
38
|
+
|
|
39
|
+
### Write Announcement
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{ "action": "write_announcement", "chat_id": "oc_abc123def", "content": "New announcement content" }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For `doc` format: replaces the entire announcement content.
|
|
46
|
+
For `docx` format: appends a new text block under the page root (full replacement is not supported via API; use `update_announcement_block` to edit existing blocks).
|
|
47
|
+
|
|
48
|
+
### Append Announcement
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{ "action": "append_announcement", "chat_id": "oc_abc123def", "content": "Additional content" }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Appends content to the announcement.
|
|
55
|
+
|
|
56
|
+
### Update Announcement Block
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{ "action": "update_announcement_block", "chat_id": "oc_abc123def", "block_id": "block_123", "content": "New text content" }
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Updates a single block's text content in a docx-format announcement.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Group Chat Management
|
|
67
|
+
|
|
68
|
+
### Create Group Chat
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{ "action": "create_chat", "name": "My Group", "user_ids": ["ou_123", "ou_456"], "description": "Group description" }
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Creates a new group chat with optional initial members and description.
|
|
75
|
+
|
|
76
|
+
### Add Members to Group
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{ "action": "add_members", "chat_id": "oc_abc123def", "user_ids": ["ou_123", "ou_456"] }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Adds specified users to an existing group chat.
|
|
83
|
+
|
|
84
|
+
### Check Bot in Chat
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{ "action": "check_bot_in_chat", "chat_id": "oc_abc123def" }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Checks if the bot is a member of the specified chat.
|
|
91
|
+
|
|
92
|
+
### Delete Chat
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{ "action": "delete_chat", "chat_id": "oc_abc123def" }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Deletes/disbands a group chat. The bot must have appropriate permissions (typically needs to be the group owner or have admin privileges).
|
|
99
|
+
|
|
100
|
+
**Note**: Deleting a chat will remove all members and the chat history will no longer be accessible. Use with caution.
|
|
101
|
+
|
|
102
|
+
### Create Session Chat (One-Step)
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"action": "create_session_chat",
|
|
107
|
+
"name": "Project Discussion",
|
|
108
|
+
"user_ids": ["ou_123", "ou_456"],
|
|
109
|
+
"greeting": "Hi everyone! Let's discuss the project here.",
|
|
110
|
+
"description": "Group for project collaboration"
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
One-step operation that creates a group chat, adds users, and sends a greeting message.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Configuration
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
channels:
|
|
122
|
+
feishu:
|
|
123
|
+
tools:
|
|
124
|
+
chat: true # default: true
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Permissions
|
|
128
|
+
|
|
129
|
+
Required for announcements:
|
|
130
|
+
- `im:chat.announcement:read` - View group announcement information
|
|
131
|
+
- `im:chat.announcement` - Edit group announcement information (for write operations)
|
|
132
|
+
|
|
133
|
+
Required for group management:
|
|
134
|
+
- `im:chat:readonly` - Get chat info, check bot membership (`check_bot_in_chat`)
|
|
135
|
+
- `im:chat` - Create and delete group chats (`create_chat`, `delete_chat`)
|
|
136
|
+
- `im:chat.members` - Add members to group chats (`add_members`)
|
|
137
|
+
- `im:message:send_as_bot` - Send messages as bot (for `create_session_chat` greeting)
|
|
138
|
+
|
|
139
|
+
**Note for delete_chat**: Requires the bot to be the group owner or have admin privileges to disband the chat.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feishu-urgent
|
|
3
|
+
description: |
|
|
4
|
+
Feishu urgent message (buzz) notifications. Activate when user mentions urgent, buzz, remind, or escalation for messages.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feishu Urgent Tool
|
|
8
|
+
|
|
9
|
+
Single tool `feishu_urgent` for sending urgent (buzz) notifications to recipients for an already-sent message.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Urgent notifications (also called "buzz" in Feishu) send a strong push notification to specified recipients. Use this to escalate important messages that require immediate attention.
|
|
14
|
+
|
|
15
|
+
**Important**: The message must already be sent before sending an urgent notification. You need the `message_id` from a previously sent message.
|
|
16
|
+
|
|
17
|
+
## Urgency Types
|
|
18
|
+
|
|
19
|
+
| Type | Description | Cost |
|
|
20
|
+
|------|-------------|------|
|
|
21
|
+
| `app` | In-app buzz notification (popup + sound) | Free |
|
|
22
|
+
| `sms` | SMS push to recipient's phone | May incur cost |
|
|
23
|
+
| `phone` | Voice call to recipient's phone | May incur cost |
|
|
24
|
+
|
|
25
|
+
## Send App Urgent (Default)
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"message_id": "om_xxx",
|
|
30
|
+
"user_ids": ["ou_xxx"],
|
|
31
|
+
"urgent_type": "app"
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Send SMS Urgent
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"message_id": "om_xxx",
|
|
40
|
+
"user_ids": ["ou_xxx"],
|
|
41
|
+
"urgent_type": "sms"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Send Phone Call Urgent
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"message_id": "om_xxx",
|
|
50
|
+
"user_ids": ["ou_xxx"],
|
|
51
|
+
"urgent_type": "phone"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Multiple Recipients
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"message_id": "om_xxx",
|
|
60
|
+
"user_ids": ["ou_xxx", "ou_yyy", "ou_zzz"],
|
|
61
|
+
"urgent_type": "app"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Parameters
|
|
66
|
+
|
|
67
|
+
| Parameter | Required | Description |
|
|
68
|
+
|-----------|----------|-------------|
|
|
69
|
+
| `message_id` | Yes | Message ID to send urgent notification for (e.g., `om_xxx`). The message must already be sent. |
|
|
70
|
+
| `user_ids` | Yes | List of `open_id` values to buzz. Minimum 1 recipient. Recipients must be members of the chat where the message was sent. |
|
|
71
|
+
| `urgent_type` | No | Urgency delivery method: `app` (default), `sms`, or `phone`. |
|
|
72
|
+
|
|
73
|
+
## Response
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"ok": true,
|
|
78
|
+
"message_id": "om_xxx",
|
|
79
|
+
"urgent_type": "app",
|
|
80
|
+
"invalid_user_list": []
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- `invalid_user_list`: List of user IDs that could not receive the urgent notification (e.g., not in the chat, or invalid ID).
|
|
85
|
+
|
|
86
|
+
## Configuration
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
channels:
|
|
90
|
+
feishu:
|
|
91
|
+
tools:
|
|
92
|
+
urgent: true # default: true
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Permissions
|
|
96
|
+
|
|
97
|
+
- `im:message.urgent` - Send in-app urgent notifications
|
|
98
|
+
- `im:message.urgent:sms` - Send SMS urgent notifications (may incur cost)
|
|
99
|
+
- `im:message.urgent:phone` - Send phone call urgent notifications (may incur cost)
|
|
100
|
+
|
|
101
|
+
## Notes
|
|
102
|
+
|
|
103
|
+
- **Message must exist**: The `message_id` must be from a message that has already been sent. You cannot send urgent notifications for messages being composed.
|
|
104
|
+
- **Recipients must be chat members**: Users in `user_ids` must be members of the chat where the original message was sent.
|
|
105
|
+
- **Quota limits**: Urgent notifications have quotas (especially `sms` and `phone`). Error `230024` ("Reach the upper limit of urgent message") indicates quota exhausted. Contact your tenant admin or check Feishu admin console > Cost Center > Quota.
|
|
106
|
+
- **Invalid user IDs**: Returns HTTP 400 error if any user_id is invalid (not found or not in the chat).
|
|
107
|
+
- **Cost warning**: `sms` and `phone` types may incur costs on the tenant. Use `app` (default) for free notifications.
|