feat: 飞书知识库工具集:wiki 节点 CRUD、早报/总结/踩坑写入(修复 wiki_delete 支持 bitable 节点删除)

This commit is contained in:
NightStar
2026-08-03 18:49:35 +08:00
commit 4105f8521a
13 changed files with 1030 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# 飞书知识库鉴权配置
## 配置来源
所有飞书维度的配置统一从 `~/.openclaw/openclaw.json` 的 `channels.feishu` 读取:
| 字段 | 说明 |
|------|------|
| `appId` | 应用 App ID |
| `appSecret` | 应用 App Secret(敏感) |
| `botOpenId` | 机器人的 Open ID |
脚本通过 `init_token.py` 读取配置并获取 `tenant_access_token`(有效期 2 小时,自动续期)。
## 完整配置步骤
1. 在飞书开放平台为应用开通权限:
- `wiki:wiki` — 知识库读写
- `wiki:member:create` — 添加成员
- `docx:document` — 文档读写
- `docx:document:readonly` — 文档只读
- `drive:drive` — 云盘操作
- `space:document:delete` — 删除文档
2. 应用 Bot ID / Open ID
- 从配置文件读取 `channels.feishu.appId` 和 `channels.feishu.botOpenId`
3. 添加机器人为知识库成员(需管理员 OAuth):
- 走 OAuth 获取 user_access_token
- 调 `POST /wiki/v2/spaces/{space_id}/members`
- `member_type: openid`, `member_role: member`
4. 授予编辑权限(需管理员 OAuth + 用户同意):
- 调 `POST /drive/v1/permissions/{obj_token}/members?type=docx`
- `perm: full_access`
5. 日常操作:直接用 `tenant_access_token`
- 从 `~/.openclaw/openclaw.json` 读取 app_id/app_secret
- 调 `POST /auth/v3/tenant_access_token/internal` 获取 token
- 有效期 2 小时,自动续期