@m1heng-clawd/feishu 0.1.4 → 0.1.6

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 CHANGED
@@ -49,17 +49,48 @@ npm install @m1heng-clawd/feishu
49
49
  | `im:message:recall` | Recall | Recall sent messages |
50
50
  | `im:message.reactions:read` | Reactions | View message reactions |
51
51
 
52
- #### Document Tools Permissions
52
+ #### Tool Permissions
53
53
 
54
- Required if using Feishu document tools (`feishu_doc_*`):
54
+ **Read-only** (minimum required):
55
55
 
56
- | Permission | Description |
57
- |------------|-------------|
58
- | `docx:document` | Create/edit documents |
59
- | `docx:document:readonly` | Read documents |
60
- | `docx:document.block:convert` | Markdown to blocks conversion (required for write/append) |
61
- | `drive:drive` | Upload images to documents |
62
- | `drive:drive:readonly` | List folders |
56
+ | Permission | Tool | Description |
57
+ |------------|------|-------------|
58
+ | `docx:document:readonly` | `feishu_doc` | Read documents |
59
+ | `drive:drive:readonly` | `feishu_drive` | List folders, get file info |
60
+ | `wiki:wiki:readonly` | `feishu_wiki` | List spaces, list nodes, get node info, search |
61
+
62
+ **Read-write** (optional, for create/edit/delete operations):
63
+
64
+ | Permission | Tool | Description |
65
+ |------------|------|-------------|
66
+ | `docx:document` | `feishu_doc` | Create/edit documents |
67
+ | `docx:document.block:convert` | `feishu_doc` | Markdown to blocks conversion (required for write/append) |
68
+ | `drive:drive` | `feishu_doc`, `feishu_drive` | Upload images to documents, create folders, move/delete files |
69
+ | `wiki:wiki` | `feishu_wiki` | Create/move/rename wiki nodes |
70
+
71
+ #### Drive Access ⚠️
72
+
73
+ > **Important:** Bots don't have their own "My Space" (root folder). Bots can only access files/folders that have been **shared with them**.
74
+
75
+ To let the bot manage files:
76
+ 1. Create a folder in your Feishu Drive
77
+ 2. Right-click the folder → **Share** → search for your bot name
78
+ 3. Grant appropriate permission (view/edit)
79
+
80
+ Without this step, `feishu_drive` operations like `create_folder` will fail because the bot has no root folder to create in.
81
+
82
+ #### Wiki Space Access ⚠️
83
+
84
+ > **Important:** API permissions alone are not enough for wiki access. You must also add the bot to each wiki space.
85
+
86
+ 1. Open the wiki space you want the bot to access
87
+ 2. Click **Settings** (gear icon) → **Members**
88
+ 3. Click **Add Member** → search for your bot name
89
+ 4. Select appropriate permission level (view/edit)
90
+
91
+ Without this step, `feishu_wiki` will return empty results even with correct API permissions.
92
+
93
+ Reference: [Wiki FAQ - How to add app to wiki](https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa#a40ad4ca)
63
94
 
64
95
  #### Event Subscriptions ⚠️
65
96
 
@@ -129,7 +160,10 @@ channels:
129
160
  - User and group directory lookup
130
161
  - **Card render mode**: Optional markdown rendering with syntax highlighting
131
162
  - **Document tools**: Read, create, and write Feishu documents with markdown (tables not supported due to API limitations)
163
+ - **Wiki tools**: Navigate knowledge bases, list spaces, get node details, search, create/move/rename nodes
164
+ - **Drive tools**: List folders, get file info, create folders, move/delete files
132
165
  - **@mention forwarding**: When you @mention someone in your message, the bot's reply will automatically @mention them too
166
+ - **Permission error notification**: When the bot encounters a Feishu API permission error, it automatically notifies the user with the permission grant URL
133
167
 
134
168
  #### @Mention Forwarding
135
169
 
@@ -225,17 +259,48 @@ npm install @m1heng-clawd/feishu
225
259
  | `im:message:recall` | 撤回 | 撤回已发送消息 |
226
260
  | `im:message.reactions:read` | 表情 | 查看消息表情回复 |
227
261
 
228
- #### 文档工具权限
262
+ #### 工具权限
229
263
 
230
- 使用飞书文档工具(`feishu_doc_*`)需要以下权限:
264
+ **只读权限**(最低要求):
231
265
 
232
- | 权限 | 说明 |
233
- |------|------|
234
- | `docx:document` | 创建/编辑文档 |
235
- | `docx:document:readonly` | 读取文档 |
236
- | `docx:document.block:convert` | Markdown blocks(write/append 必需) |
237
- | `drive:drive` | 上传图片到文档 |
238
- | `drive:drive:readonly` | 列出文件夹 |
266
+ | 权限 | 工具 | 说明 |
267
+ |------|------|------|
268
+ | `docx:document:readonly` | `feishu_doc` | 读取文档 |
269
+ | `drive:drive:readonly` | `feishu_drive` | 列出文件夹、获取文件信息 |
270
+ | `wiki:wiki:readonly` | `feishu_wiki` | 列出空间、列出节点、获取节点详情、搜索 |
271
+
272
+ **读写权限**(可选,用于创建/编辑/删除操作):
273
+
274
+ | 权限 | 工具 | 说明 |
275
+ |------|------|------|
276
+ | `docx:document` | `feishu_doc` | 创建/编辑文档 |
277
+ | `docx:document.block:convert` | `feishu_doc` | Markdown 转 blocks(write/append 必需) |
278
+ | `drive:drive` | `feishu_doc`, `feishu_drive` | 上传图片到文档、创建文件夹、移动/删除文件 |
279
+ | `wiki:wiki` | `feishu_wiki` | 创建/移动/重命名知识库节点 |
280
+
281
+ #### 云空间访问权限 ⚠️
282
+
283
+ > **重要:** 机器人没有自己的"我的空间"(根目录)。机器人只能访问**被分享给它的文件/文件夹**。
284
+
285
+ 要让机器人管理文件:
286
+ 1. 在你的飞书云空间创建一个文件夹
287
+ 2. 右键文件夹 → **分享** → 搜索机器人名称
288
+ 3. 授予相应权限(查看/编辑)
289
+
290
+ 如果不做这一步,`feishu_drive` 的 `create_folder` 等操作会失败,因为机器人没有根目录可以创建文件夹。
291
+
292
+ #### 知识库空间权限 ⚠️
293
+
294
+ > **重要:** 仅有 API 权限不够,还需要将机器人添加到知识库空间。
295
+
296
+ 1. 打开需要机器人访问的知识库空间
297
+ 2. 点击 **设置**(齿轮图标)→ **成员管理**
298
+ 3. 点击 **添加成员** → 搜索机器人名称
299
+ 4. 选择权限级别(查看/编辑)
300
+
301
+ 如果不做这一步,即使 API 权限正确,`feishu_wiki` 也会返回空结果。
302
+
303
+ 参考文档:[知识库常见问题 - 如何将应用添加为知识库成员](https://open.feishu.cn/document/server-docs/docs/wiki-v2/wiki-qa#a40ad4ca)
239
304
 
240
305
  #### 事件订阅 ⚠️
241
306
 
@@ -305,7 +370,10 @@ channels:
305
370
  - 用户和群组目录查询
306
371
  - **卡片渲染模式**:支持语法高亮的 Markdown 渲染
307
372
  - **文档工具**:读取、创建、用 Markdown 写入飞书文档(表格因 API 限制不支持)
373
+ - **知识库工具**:浏览知识库、列出空间、获取节点详情、搜索、创建/移动/重命名节点
374
+ - **云空间工具**:列出文件夹、获取文件信息、创建文件夹、移动/删除文件
308
375
  - **@ 转发功能**:在消息中 @ 某人,机器人的回复会自动 @ 该用户
376
+ - **权限错误提示**:当机器人遇到飞书 API 权限错误时,会自动通知用户并提供权限授权链接
309
377
 
310
378
  #### @ 转发功能
311
379
 
package/index.ts CHANGED
@@ -3,6 +3,9 @@ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
3
  import { feishuPlugin } from "./src/channel.js";
4
4
  import { setFeishuRuntime } from "./src/runtime.js";
5
5
  import { registerFeishuDocTools } from "./src/docx.js";
6
+ import { registerFeishuWikiTools } from "./src/wiki.js";
7
+ import { registerFeishuDriveTools } from "./src/drive.js";
8
+ import { registerFeishuPermTools } from "./src/perm.js";
6
9
 
7
10
  export { monitorFeishuProvider } from "./src/monitor.js";
8
11
  export {
@@ -49,6 +52,9 @@ const plugin = {
49
52
  setFeishuRuntime(api.runtime);
50
53
  api.registerChannel({ plugin: feishuPlugin });
51
54
  registerFeishuDocTools(api);
55
+ registerFeishuWikiTools(api);
56
+ registerFeishuDriveTools(api);
57
+ registerFeishuPermTools(api);
52
58
  },
53
59
  };
54
60
 
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@m1heng-clawd/feishu",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Feishu/Lark channel plugin",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "index.ts",
9
9
  "src",
10
+ "skills",
10
11
  "openclaw.plugin.json"
11
12
  ],
12
13
  "repository": {
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: feishu-doc
3
+ description: |
4
+ Feishu document read/write operations. Activate when user mentions Feishu docs, cloud docs, or docx links.
5
+ ---
6
+
7
+ # Feishu Document Tool
8
+
9
+ Single tool `feishu_doc` with action parameter for all document operations.
10
+
11
+ ## Token Extraction
12
+
13
+ From URL `https://xxx.feishu.cn/docx/ABC123def` → `doc_token` = `ABC123def`
14
+
15
+ ## Actions
16
+
17
+ ### Read Document
18
+
19
+ ```json
20
+ { "action": "read", "doc_token": "ABC123def" }
21
+ ```
22
+
23
+ Returns: title, plain text content, block statistics. Check `hint` field - if present, structured content (tables, images) exists that requires `list_blocks`.
24
+
25
+ ### Write Document (Replace All)
26
+
27
+ ```json
28
+ { "action": "write", "doc_token": "ABC123def", "content": "# Title\n\nMarkdown content..." }
29
+ ```
30
+
31
+ Replaces entire document with markdown content. Supports: headings, lists, code blocks, quotes, links, images (`![](url)` auto-uploaded), bold/italic/strikethrough.
32
+
33
+ **Limitation:** Markdown tables are NOT supported.
34
+
35
+ ### Append Content
36
+
37
+ ```json
38
+ { "action": "append", "doc_token": "ABC123def", "content": "Additional content" }
39
+ ```
40
+
41
+ Appends markdown to end of document.
42
+
43
+ ### Create Document
44
+
45
+ ```json
46
+ { "action": "create", "title": "New Document" }
47
+ ```
48
+
49
+ With folder:
50
+ ```json
51
+ { "action": "create", "title": "New Document", "folder_token": "fldcnXXX" }
52
+ ```
53
+
54
+ ### List Blocks
55
+
56
+ ```json
57
+ { "action": "list_blocks", "doc_token": "ABC123def" }
58
+ ```
59
+
60
+ Returns full block data including tables, images. Use this to read structured content.
61
+
62
+ ### Get Single Block
63
+
64
+ ```json
65
+ { "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
66
+ ```
67
+
68
+ ### Update Block Text
69
+
70
+ ```json
71
+ { "action": "update_block", "doc_token": "ABC123def", "block_id": "doxcnXXX", "content": "New text" }
72
+ ```
73
+
74
+ ### Delete Block
75
+
76
+ ```json
77
+ { "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
78
+ ```
79
+
80
+ ## Reading Workflow
81
+
82
+ 1. Start with `action: "read"` - get plain text + statistics
83
+ 2. Check `block_types` in response for Table, Image, Code, etc.
84
+ 3. If structured content exists, use `action: "list_blocks"` for full data
85
+
86
+ ## Configuration
87
+
88
+ ```yaml
89
+ channels:
90
+ feishu:
91
+ tools:
92
+ doc: true # default: true
93
+ ```
94
+
95
+ **Note:** `feishu_wiki` depends on this tool - wiki page content is read/written via `feishu_doc`.
96
+
97
+ ## Permissions
98
+
99
+ Required: `docx:document`, `docx:document:readonly`, `docx:document.block:convert`, `drive:drive`
@@ -0,0 +1,102 @@
1
+ # Feishu Block Types Reference
2
+
3
+ Complete reference for Feishu document block types. Use with `feishu_doc_list_blocks`, `feishu_doc_update_block`, and `feishu_doc_delete_block`.
4
+
5
+ ## Block Type Table
6
+
7
+ | block_type | Name | Description | Editable |
8
+ |------------|------|-------------|----------|
9
+ | 1 | Page | Document root (contains title) | No |
10
+ | 2 | Text | Plain text paragraph | Yes |
11
+ | 3 | Heading1 | H1 heading | Yes |
12
+ | 4 | Heading2 | H2 heading | Yes |
13
+ | 5 | Heading3 | H3 heading | Yes |
14
+ | 6 | Heading4 | H4 heading | Yes |
15
+ | 7 | Heading5 | H5 heading | Yes |
16
+ | 8 | Heading6 | H6 heading | Yes |
17
+ | 9 | Heading7 | H7 heading | Yes |
18
+ | 10 | Heading8 | H8 heading | Yes |
19
+ | 11 | Heading9 | H9 heading | Yes |
20
+ | 12 | Bullet | Unordered list item | Yes |
21
+ | 13 | Ordered | Ordered list item | Yes |
22
+ | 14 | Code | Code block | Yes |
23
+ | 15 | Quote | Blockquote | Yes |
24
+ | 16 | Equation | LaTeX equation | Partial |
25
+ | 17 | Todo | Checkbox / task item | Yes |
26
+ | 18 | Bitable | Multi-dimensional table | No |
27
+ | 19 | Callout | Highlight block | Yes |
28
+ | 20 | ChatCard | Chat card embed | No |
29
+ | 21 | Diagram | Diagram embed | No |
30
+ | 22 | Divider | Horizontal rule | No |
31
+ | 23 | File | File attachment | No |
32
+ | 24 | Grid | Grid layout container | No |
33
+ | 25 | GridColumn | Grid column | No |
34
+ | 26 | Iframe | Embedded iframe | No |
35
+ | 27 | Image | Image | Partial |
36
+ | 28 | ISV | Third-party widget | No |
37
+ | 29 | MindnoteBlock | Mindmap embed | No |
38
+ | 30 | Sheet | Spreadsheet embed | No |
39
+ | 31 | Table | Table | Partial |
40
+ | 32 | TableCell | Table cell | Yes |
41
+ | 33 | View | View embed | No |
42
+ | 34 | Undefined | Unknown type | No |
43
+ | 35 | QuoteContainer | Quote container | No |
44
+ | 36 | Task | Lark Tasks integration | No |
45
+ | 37 | OKR | OKR integration | No |
46
+ | 38 | OKRObjective | OKR objective | No |
47
+ | 39 | OKRKeyResult | OKR key result | No |
48
+ | 40 | OKRProgress | OKR progress | No |
49
+ | 41 | AddOns | Add-ons block | No |
50
+ | 42 | JiraIssue | Jira issue embed | No |
51
+ | 43 | WikiCatalog | Wiki catalog | No |
52
+ | 44 | Board | Board embed | No |
53
+ | 45 | Agenda | Agenda block | No |
54
+ | 46 | AgendaItem | Agenda item | No |
55
+ | 47 | AgendaItemTitle | Agenda item title | No |
56
+ | 48 | SyncedBlock | Synced block reference | No |
57
+
58
+ ## Editing Guidelines
59
+
60
+ ### Text-based blocks (2-17, 19)
61
+
62
+ Update text content using `feishu_doc_update_block`:
63
+
64
+ ```json
65
+ {
66
+ "doc_token": "ABC123",
67
+ "block_id": "block_xxx",
68
+ "content": "New text content"
69
+ }
70
+ ```
71
+
72
+ ### Image blocks (27)
73
+
74
+ Images cannot be updated directly via `update_block`. Use `feishu_doc_write` or `feishu_doc_append` with markdown to add new images.
75
+
76
+ ### Table blocks (31)
77
+
78
+ **Important:** Table blocks CANNOT be created via the `documentBlockChildren.create` API (error 1770029). This affects `feishu_doc_write` and `feishu_doc_append` - markdown tables will be skipped with a warning.
79
+
80
+ Tables can only be read (via `list_blocks`) and individual cells (type 32) can be updated, but new tables cannot be inserted programmatically via markdown.
81
+
82
+ ### Container blocks (24, 25, 35)
83
+
84
+ Grid and QuoteContainer are layout containers. Edit their child blocks instead.
85
+
86
+ ## Common Patterns
87
+
88
+ ### Replace specific paragraph
89
+
90
+ 1. `feishu_doc_list_blocks` - find the block_id
91
+ 2. `feishu_doc_update_block` - update its content
92
+
93
+ ### Insert content at specific location
94
+
95
+ Currently, the API only supports appending to document end. For insertion at specific positions, consider:
96
+ 1. Read existing content
97
+ 2. Delete affected blocks
98
+ 3. Rewrite with new content in desired order
99
+
100
+ ### Delete multiple blocks
101
+
102
+ Blocks must be deleted one at a time. Delete child blocks before parent containers.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: feishu-drive
3
+ description: |
4
+ Feishu cloud storage file management. Activate when user mentions cloud space, folders, drive.
5
+ ---
6
+
7
+ # Feishu Drive Tool
8
+
9
+ Single tool `feishu_drive` for cloud storage operations.
10
+
11
+ ## Token Extraction
12
+
13
+ From URL `https://xxx.feishu.cn/drive/folder/ABC123` → `folder_token` = `ABC123`
14
+
15
+ ## Actions
16
+
17
+ ### List Folder Contents
18
+
19
+ ```json
20
+ { "action": "list" }
21
+ ```
22
+
23
+ Root directory (no folder_token).
24
+
25
+ ```json
26
+ { "action": "list", "folder_token": "fldcnXXX" }
27
+ ```
28
+
29
+ Returns: files with token, name, type, url, timestamps.
30
+
31
+ ### Get File Info
32
+
33
+ ```json
34
+ { "action": "info", "file_token": "ABC123", "type": "docx" }
35
+ ```
36
+
37
+ Searches for the file in the root directory. Note: file must be in root or use `list` to browse folders first.
38
+
39
+ `type`: `doc`, `docx`, `sheet`, `bitable`, `folder`, `file`, `mindnote`, `shortcut`
40
+
41
+ ### Create Folder
42
+
43
+ ```json
44
+ { "action": "create_folder", "name": "New Folder" }
45
+ ```
46
+
47
+ In parent folder:
48
+ ```json
49
+ { "action": "create_folder", "name": "New Folder", "folder_token": "fldcnXXX" }
50
+ ```
51
+
52
+ ### Move File
53
+
54
+ ```json
55
+ { "action": "move", "file_token": "ABC123", "type": "docx", "folder_token": "fldcnXXX" }
56
+ ```
57
+
58
+ ### Delete File
59
+
60
+ ```json
61
+ { "action": "delete", "file_token": "ABC123", "type": "docx" }
62
+ ```
63
+
64
+ ## File Types
65
+
66
+ | Type | Description |
67
+ |------|-------------|
68
+ | `doc` | Old format document |
69
+ | `docx` | New format document |
70
+ | `sheet` | Spreadsheet |
71
+ | `bitable` | Multi-dimensional table |
72
+ | `folder` | Folder |
73
+ | `file` | Uploaded file |
74
+ | `mindnote` | Mind map |
75
+ | `shortcut` | Shortcut |
76
+
77
+ ## Configuration
78
+
79
+ ```yaml
80
+ channels:
81
+ feishu:
82
+ tools:
83
+ drive: true # default: true
84
+ ```
85
+
86
+ ## Permissions
87
+
88
+ - `drive:drive` - Full access (create, move, delete)
89
+ - `drive:drive:readonly` - Read only (list, info)
90
+
91
+ ## Known Limitations
92
+
93
+ - **Bots have no root folder**: Feishu bots use `tenant_access_token` and don't have their own "My Space". The root folder concept only exists for user accounts. This means:
94
+ - `create_folder` without `folder_token` will fail (400 error)
95
+ - Bot can only access files/folders that have been **shared with it**
96
+ - **Workaround**: User must first create a folder manually and share it with the bot, then bot can create subfolders inside it
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: feishu-perm
3
+ description: |
4
+ Feishu permission management for documents and files. Activate when user mentions sharing, permissions, collaborators.
5
+ ---
6
+
7
+ # Feishu Permission Tool
8
+
9
+ Single tool `feishu_perm` for managing file/document permissions.
10
+
11
+ ## Actions
12
+
13
+ ### List Collaborators
14
+
15
+ ```json
16
+ { "action": "list", "token": "ABC123", "type": "docx" }
17
+ ```
18
+
19
+ Returns: members with member_type, member_id, perm, name.
20
+
21
+ ### Add Collaborator
22
+
23
+ ```json
24
+ { "action": "add", "token": "ABC123", "type": "docx", "member_type": "email", "member_id": "user@example.com", "perm": "edit" }
25
+ ```
26
+
27
+ ### Remove Collaborator
28
+
29
+ ```json
30
+ { "action": "remove", "token": "ABC123", "type": "docx", "member_type": "email", "member_id": "user@example.com" }
31
+ ```
32
+
33
+ ## Token Types
34
+
35
+ | Type | Description |
36
+ |------|-------------|
37
+ | `doc` | Old format document |
38
+ | `docx` | New format document |
39
+ | `sheet` | Spreadsheet |
40
+ | `bitable` | Multi-dimensional table |
41
+ | `folder` | Folder |
42
+ | `file` | Uploaded file |
43
+ | `wiki` | Wiki node |
44
+ | `mindnote` | Mind map |
45
+
46
+ ## Member Types
47
+
48
+ | Type | Description |
49
+ |------|-------------|
50
+ | `email` | Email address |
51
+ | `openid` | User open_id |
52
+ | `userid` | User user_id |
53
+ | `unionid` | User union_id |
54
+ | `openchat` | Group chat open_id |
55
+ | `opendepartmentid` | Department open_id |
56
+
57
+ ## Permission Levels
58
+
59
+ | Perm | Description |
60
+ |------|-------------|
61
+ | `view` | View only |
62
+ | `edit` | Can edit |
63
+ | `full_access` | Full access (can manage permissions) |
64
+
65
+ ## Examples
66
+
67
+ Share document with email:
68
+ ```json
69
+ { "action": "add", "token": "doxcnXXX", "type": "docx", "member_type": "email", "member_id": "alice@company.com", "perm": "edit" }
70
+ ```
71
+
72
+ Share folder with group:
73
+ ```json
74
+ { "action": "add", "token": "fldcnXXX", "type": "folder", "member_type": "openchat", "member_id": "oc_xxx", "perm": "view" }
75
+ ```
76
+
77
+ ## Configuration
78
+
79
+ ```yaml
80
+ channels:
81
+ feishu:
82
+ tools:
83
+ perm: true # default: false (disabled)
84
+ ```
85
+
86
+ **Note:** This tool is disabled by default because permission management is a sensitive operation. Enable explicitly if needed.
87
+
88
+ ## Permissions
89
+
90
+ Required: `drive:permission`
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: feishu-wiki
3
+ description: |
4
+ Feishu knowledge base navigation. Activate when user mentions knowledge base, wiki, or wiki links.
5
+ ---
6
+
7
+ # Feishu Wiki Tool
8
+
9
+ Single tool `feishu_wiki` for knowledge base operations.
10
+
11
+ ## Token Extraction
12
+
13
+ From URL `https://xxx.feishu.cn/wiki/ABC123def` → `token` = `ABC123def`
14
+
15
+ ## Actions
16
+
17
+ ### List Knowledge Spaces
18
+
19
+ ```json
20
+ { "action": "spaces" }
21
+ ```
22
+
23
+ Returns all accessible wiki spaces.
24
+
25
+ ### List Nodes
26
+
27
+ ```json
28
+ { "action": "nodes", "space_id": "7xxx" }
29
+ ```
30
+
31
+ With parent:
32
+ ```json
33
+ { "action": "nodes", "space_id": "7xxx", "parent_node_token": "wikcnXXX" }
34
+ ```
35
+
36
+ ### Get Node Details
37
+
38
+ ```json
39
+ { "action": "get", "token": "ABC123def" }
40
+ ```
41
+
42
+ Returns: `node_token`, `obj_token`, `obj_type`, etc. Use `obj_token` with `feishu_doc` to read/write the document.
43
+
44
+ ### Create Node
45
+
46
+ ```json
47
+ { "action": "create", "space_id": "7xxx", "title": "New Page" }
48
+ ```
49
+
50
+ With type and parent:
51
+ ```json
52
+ { "action": "create", "space_id": "7xxx", "title": "Sheet", "obj_type": "sheet", "parent_node_token": "wikcnXXX" }
53
+ ```
54
+
55
+ `obj_type`: `docx` (default), `sheet`, `bitable`, `mindnote`, `file`, `doc`, `slides`
56
+
57
+ ### Move Node
58
+
59
+ ```json
60
+ { "action": "move", "space_id": "7xxx", "node_token": "wikcnXXX" }
61
+ ```
62
+
63
+ To different location:
64
+ ```json
65
+ { "action": "move", "space_id": "7xxx", "node_token": "wikcnXXX", "target_space_id": "7yyy", "target_parent_token": "wikcnYYY" }
66
+ ```
67
+
68
+ ### Rename Node
69
+
70
+ ```json
71
+ { "action": "rename", "space_id": "7xxx", "node_token": "wikcnXXX", "title": "New Title" }
72
+ ```
73
+
74
+ ## Wiki-Doc Workflow
75
+
76
+ To edit a wiki page:
77
+
78
+ 1. Get node: `{ "action": "get", "token": "wiki_token" }` → returns `obj_token`
79
+ 2. Read doc: `feishu_doc { "action": "read", "doc_token": "obj_token" }`
80
+ 3. Write doc: `feishu_doc { "action": "write", "doc_token": "obj_token", "content": "..." }`
81
+
82
+ ## Configuration
83
+
84
+ ```yaml
85
+ channels:
86
+ feishu:
87
+ tools:
88
+ wiki: true # default: true
89
+ doc: true # required - wiki content uses feishu_doc
90
+ ```
91
+
92
+ **Dependency:** This tool requires `feishu_doc` to be enabled. Wiki pages are documents - use `feishu_wiki` to navigate, then `feishu_doc` to read/edit content.
93
+
94
+ ## Permissions
95
+
96
+ Required: `wiki:wiki` or `wiki:wiki:readonly`