@bobotu/feishu-fork 0.1.0

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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +922 -0
  3. package/index.ts +65 -0
  4. package/openclaw.plugin.json +10 -0
  5. package/package.json +72 -0
  6. package/skills/feishu-doc/SKILL.md +161 -0
  7. package/skills/feishu-doc/references/block-types.md +102 -0
  8. package/skills/feishu-drive/SKILL.md +96 -0
  9. package/skills/feishu-perm/SKILL.md +90 -0
  10. package/skills/feishu-task/SKILL.md +210 -0
  11. package/skills/feishu-wiki/SKILL.md +96 -0
  12. package/src/accounts.ts +140 -0
  13. package/src/bitable-tools/actions.ts +199 -0
  14. package/src/bitable-tools/common.ts +90 -0
  15. package/src/bitable-tools/index.ts +1 -0
  16. package/src/bitable-tools/meta.ts +80 -0
  17. package/src/bitable-tools/register.ts +195 -0
  18. package/src/bitable-tools/schemas.ts +221 -0
  19. package/src/bot.ts +1125 -0
  20. package/src/channel.ts +334 -0
  21. package/src/client.ts +114 -0
  22. package/src/config-schema.ts +237 -0
  23. package/src/dedup.ts +54 -0
  24. package/src/directory.ts +165 -0
  25. package/src/doc-tools/actions.ts +341 -0
  26. package/src/doc-tools/common.ts +33 -0
  27. package/src/doc-tools/index.ts +2 -0
  28. package/src/doc-tools/register.ts +90 -0
  29. package/src/doc-tools/schemas.ts +85 -0
  30. package/src/doc-write-service.ts +711 -0
  31. package/src/drive-tools/actions.ts +182 -0
  32. package/src/drive-tools/common.ts +18 -0
  33. package/src/drive-tools/index.ts +2 -0
  34. package/src/drive-tools/register.ts +71 -0
  35. package/src/drive-tools/schemas.ts +67 -0
  36. package/src/dynamic-agent.ts +135 -0
  37. package/src/external-keys.ts +19 -0
  38. package/src/media.ts +510 -0
  39. package/src/mention.ts +121 -0
  40. package/src/monitor.ts +323 -0
  41. package/src/onboarding.ts +449 -0
  42. package/src/outbound.ts +40 -0
  43. package/src/perm-tools/actions.ts +111 -0
  44. package/src/perm-tools/common.ts +18 -0
  45. package/src/perm-tools/index.ts +2 -0
  46. package/src/perm-tools/register.ts +65 -0
  47. package/src/perm-tools/schemas.ts +52 -0
  48. package/src/policy.ts +117 -0
  49. package/src/probe.ts +147 -0
  50. package/src/reactions.ts +160 -0
  51. package/src/reply-dispatcher.ts +240 -0
  52. package/src/runtime.ts +14 -0
  53. package/src/send.ts +391 -0
  54. package/src/streaming-card.ts +211 -0
  55. package/src/targets.ts +58 -0
  56. package/src/task-tools/actions.ts +590 -0
  57. package/src/task-tools/common.ts +18 -0
  58. package/src/task-tools/constants.ts +13 -0
  59. package/src/task-tools/index.ts +1 -0
  60. package/src/task-tools/register.ts +263 -0
  61. package/src/task-tools/schemas.ts +567 -0
  62. package/src/text/markdown-links.ts +104 -0
  63. package/src/tools-common/feishu-api.ts +184 -0
  64. package/src/tools-common/tool-context.ts +23 -0
  65. package/src/tools-common/tool-exec.ts +73 -0
  66. package/src/tools-config.ts +22 -0
  67. package/src/types.ts +79 -0
  68. package/src/typing.ts +75 -0
  69. package/src/wiki-tools/actions.ts +166 -0
  70. package/src/wiki-tools/common.ts +18 -0
  71. package/src/wiki-tools/index.ts +2 -0
  72. package/src/wiki-tools/register.ts +66 -0
  73. package/src/wiki-tools/schemas.ts +55 -0
package/index.ts ADDED
@@ -0,0 +1,65 @@
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
2
+ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
+ import { feishuPlugin } from "./src/channel.js";
4
+ import { setFeishuRuntime } from "./src/runtime.js";
5
+ import { registerFeishuDocTools } from "./src/doc-tools/index.js";
6
+ import { registerFeishuWikiTools } from "./src/wiki-tools/index.js";
7
+ import { registerFeishuDriveTools } from "./src/drive-tools/index.js";
8
+ import { registerFeishuPermTools } from "./src/perm-tools/index.js";
9
+ import { registerFeishuBitableTools } from "./src/bitable-tools/index.js";
10
+ import { registerFeishuTaskTools } from "./src/task-tools/index.js";
11
+
12
+ export { monitorFeishuProvider } from "./src/monitor.js";
13
+ export {
14
+ sendMessageFeishu,
15
+ sendCardFeishu,
16
+ updateCardFeishu,
17
+ editMessageFeishu,
18
+ getMessageFeishu,
19
+ } from "./src/send.js";
20
+ export {
21
+ uploadImageFeishu,
22
+ uploadFileFeishu,
23
+ sendImageFeishu,
24
+ sendFileFeishu,
25
+ sendMediaFeishu,
26
+ } from "./src/media.js";
27
+ export { probeFeishu, clearProbeCache } from "./src/probe.js";
28
+ export {
29
+ addReactionFeishu,
30
+ removeReactionFeishu,
31
+ listReactionsFeishu,
32
+ FeishuEmoji,
33
+ } from "./src/reactions.js";
34
+ export {
35
+ extractMentionTargets,
36
+ extractMessageBody,
37
+ isMentionForwardRequest,
38
+ formatMentionForText,
39
+ formatMentionForCard,
40
+ formatMentionAllForText,
41
+ formatMentionAllForCard,
42
+ buildMentionedMessage,
43
+ buildMentionedCardContent,
44
+ type MentionTarget,
45
+ } from "./src/mention.js";
46
+ export { feishuPlugin } from "./src/channel.js";
47
+
48
+ const plugin = {
49
+ id: "feishu",
50
+ name: "Feishu",
51
+ description: "Feishu/Lark channel plugin",
52
+ configSchema: emptyPluginConfigSchema(),
53
+ register(api: OpenClawPluginApi) {
54
+ setFeishuRuntime(api.runtime);
55
+ api.registerChannel({ plugin: feishuPlugin });
56
+ registerFeishuDocTools(api);
57
+ registerFeishuWikiTools(api);
58
+ registerFeishuDriveTools(api);
59
+ registerFeishuPermTools(api);
60
+ registerFeishuBitableTools(api);
61
+ registerFeishuTaskTools(api);
62
+ },
63
+ };
64
+
65
+ export default plugin;
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "feishu-fork",
3
+ "channels": ["feishu"],
4
+ "skills": ["./skills"],
5
+ "configSchema": {
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {}
9
+ }
10
+ }
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@bobotu/feishu-fork",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "OpenClaw Feishu/Lark channel plugin (fork)",
6
+ "scripts": {
7
+ "test:unit": "vitest run",
8
+ "test:unit:watch": "vitest",
9
+ "test:coverage": "vitest run --coverage",
10
+ "ci:check": "npx tsc --noEmit && npm run test:coverage"
11
+ },
12
+ "license": "MIT",
13
+ "files": [
14
+ "index.ts",
15
+ "src/**/*.ts",
16
+ "!src/**/__tests__/**",
17
+ "!src/**/*.test.ts",
18
+ "skills",
19
+ "openclaw.plugin.json"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/bobotu/clawdbot-feishu.git"
24
+ },
25
+ "keywords": [
26
+ "openclaw",
27
+ "feishu",
28
+ "lark",
29
+ "飞书",
30
+ "chatbot",
31
+ "ai",
32
+ "claude"
33
+ ],
34
+ "openclaw": {
35
+ "extensions": [
36
+ "./index.ts"
37
+ ],
38
+ "channel": {
39
+ "id": "feishu",
40
+ "label": "Feishu",
41
+ "selectionLabel": "Feishu/Lark (飞书)",
42
+ "docsPath": "/channels/feishu",
43
+ "docsLabel": "feishu",
44
+ "blurb": "飞书/Lark enterprise messaging.",
45
+ "aliases": [
46
+ "lark"
47
+ ],
48
+ "order": 70
49
+ },
50
+ "install": {
51
+ "npmSpec": "@bobotu/feishu-fork",
52
+ "localPaths": ".",
53
+ "defaultChoice": "pnpm"
54
+ }
55
+ },
56
+ "dependencies": {
57
+ "@larksuiteoapi/node-sdk": "^1.59.0",
58
+ "@sinclair/typebox": "0.34.48",
59
+ "zod": "^4.3.6"
60
+ },
61
+ "devDependencies": {
62
+ "@vitest/coverage-v8": "^2.1.8",
63
+ "@types/node": "^25.0.10",
64
+ "openclaw": "2026.2.24",
65
+ "tsx": "^4.21.0",
66
+ "typescript": "^5.7.0",
67
+ "vitest": "^2.1.8"
68
+ },
69
+ "peerDependencies": {
70
+ "openclaw": ">=2026.2.24"
71
+ }
72
+ }
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: feishu-doc
3
+ description: |
4
+ Feishu document read/write operations + comment management. Activate when user mentions Feishu docs, cloud docs, docx links, or document comments.
5
+ ---
6
+
7
+ # Feishu Document Tool
8
+
9
+ Single tool `feishu_doc` with action parameter for all document operations including comment management.
10
+
11
+ ## Token Extraction
12
+
13
+ From URL `https://xxx.feishu.cn/docx/ABC123def` → `doc_token` = `ABC123def`
14
+ From URL `https://xxx.feishu.cn/docs/doccn123c` → `doc_token` = `doccn123c`
15
+
16
+ ## Actions
17
+
18
+ ### Read Document
19
+
20
+ ```json
21
+ { "action": "read", "doc_token": "ABC123def" }
22
+ ```
23
+
24
+ Returns: title, plain text content, block statistics. Check `hint` field - if present, structured content (tables, images) exists that requires `list_blocks`.
25
+
26
+ ### Write Document (Replace All)
27
+
28
+ ```json
29
+ { "action": "write", "doc_token": "ABC123def", "content": "# Title\n\nMarkdown content..." }
30
+ ```
31
+
32
+ Replaces entire document with markdown content. Supports: headings, lists, code blocks, quotes, links, images (`![](url)` auto-uploaded), bold/italic/strikethrough.
33
+
34
+ **Limitation:** Markdown tables are NOT supported.
35
+
36
+ ### Create + Write (Atomic, Recommended)
37
+
38
+ ```json
39
+ {
40
+ "action": "create_and_write",
41
+ "title": "New Document",
42
+ "content": "# Title\n\nMarkdown content..."
43
+ }
44
+ ```
45
+
46
+ With folder:
47
+ ```json
48
+ {
49
+ "action": "create_and_write",
50
+ "title": "New Document",
51
+ "content": "# Title\n\nMarkdown content...",
52
+ "folder_token": "fldcnXXX"
53
+ }
54
+ ```
55
+
56
+ Creates the document and writes content in one call. Prefer this over separate `create` + `write`.
57
+
58
+ ### Append Content
59
+
60
+ ```json
61
+ { "action": "append", "doc_token": "ABC123def", "content": "Additional content" }
62
+ ```
63
+
64
+ Appends markdown to end of document.
65
+
66
+ ### Create Document
67
+
68
+ ```json
69
+ { "action": "create", "title": "New Document" }
70
+ ```
71
+
72
+ With folder:
73
+ ```json
74
+ { "action": "create", "title": "New Document", "folder_token": "fldcnXXX" }
75
+ ```
76
+
77
+ Creates an empty document (title only).
78
+
79
+ ### List Blocks
80
+
81
+ ```json
82
+ { "action": "list_blocks", "doc_token": "ABC123def" }
83
+ ```
84
+
85
+ Returns full block data including tables, images. Use this to read structured content.
86
+
87
+ ### Get Single Block
88
+
89
+ ```json
90
+ { "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
91
+ ```
92
+
93
+ ### Update Block Text
94
+
95
+ ```json
96
+ { "action": "update_block", "doc_token": "ABC123def", "block_id": "doxcnXXX", "content": "New text" }
97
+ ```
98
+
99
+ ### Delete Block
100
+
101
+ ```json
102
+ { "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
103
+ ```
104
+
105
+ ### List Comments
106
+
107
+ ```json
108
+ { "action": "list_comments", "doc_token": "ABC123def", "page_size": 50 }
109
+ ```
110
+
111
+ Returns all comments for the document. Use `page_token` for pagination. Comments include `is_whole` field to distinguish between whole-document comments (true) and block-level comments (false).
112
+
113
+ ### Get Single Comment
114
+
115
+ ```json
116
+ { "action": "get_comment", "doc_token": "ABC123def", "comment_id": "comment_xxx" }
117
+ ```
118
+
119
+ ### Create Comment
120
+
121
+ ```json
122
+ { "action": "create_comment", "doc_token": "ABC123def", "content": "Comment text" }
123
+ ```
124
+
125
+ ### List Comment Replies
126
+
127
+ ```json
128
+ { "action": "list_comment_replies", "doc_token": "ABC123def", "comment_id": "comment_xxx", "page_size": 50 }
129
+ ```
130
+
131
+ `page_size` should be a positive integer. If omitted, tool defaults to `50`.
132
+
133
+ ### Comment Write Scope
134
+
135
+ Current tool provides documented comment write action `create_comment` (global comment creation).
136
+ For replies, use `list_comment_replies` for retrieval; the reply creation endpoint is not exposed in current SDK surface.
137
+
138
+ ## Reading Workflow
139
+
140
+ 1. Start with `action: "read"` - get plain text + statistics
141
+ 2. Check `block_types` in response for Table, Image, Code, etc.
142
+ 3. If structured content exists, use `action: "list_blocks"` for full data
143
+
144
+ ## Configuration
145
+
146
+ ```yaml
147
+ channels:
148
+ feishu:
149
+ tools:
150
+ doc: true # default: true
151
+ ```
152
+
153
+ **Note:** `feishu_wiki` depends on this tool - wiki page content is read/written via `feishu_doc`.
154
+
155
+ ## Permissions
156
+
157
+ Required: `docx:document`, `docx:document:readonly`, `docx:document.block:convert`, `drive:drive`
158
+
159
+ For comment operations:
160
+ - Read comments: `docx:document.comment:read`
161
+ - Write comments: `docx:document.comment` (optional, for create_comment)
@@ -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`