@openclaw/feishu 2026.2.2 → 2026.2.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/index.ts CHANGED
@@ -1,14 +1,62 @@
1
1
  import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
2
2
  import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
+ import { registerFeishuBitableTools } from "./src/bitable.js";
3
4
  import { feishuPlugin } from "./src/channel.js";
5
+ import { registerFeishuDocTools } from "./src/docx.js";
6
+ import { registerFeishuDriveTools } from "./src/drive.js";
7
+ import { registerFeishuPermTools } from "./src/perm.js";
8
+ import { setFeishuRuntime } from "./src/runtime.js";
9
+ import { registerFeishuWikiTools } from "./src/wiki.js";
10
+
11
+ export { monitorFeishuProvider } from "./src/monitor.js";
12
+ export {
13
+ sendMessageFeishu,
14
+ sendCardFeishu,
15
+ updateCardFeishu,
16
+ editMessageFeishu,
17
+ getMessageFeishu,
18
+ } from "./src/send.js";
19
+ export {
20
+ uploadImageFeishu,
21
+ uploadFileFeishu,
22
+ sendImageFeishu,
23
+ sendFileFeishu,
24
+ sendMediaFeishu,
25
+ } from "./src/media.js";
26
+ export { probeFeishu } from "./src/probe.js";
27
+ export {
28
+ addReactionFeishu,
29
+ removeReactionFeishu,
30
+ listReactionsFeishu,
31
+ FeishuEmoji,
32
+ } from "./src/reactions.js";
33
+ export {
34
+ extractMentionTargets,
35
+ extractMessageBody,
36
+ isMentionForwardRequest,
37
+ formatMentionForText,
38
+ formatMentionForCard,
39
+ formatMentionAllForText,
40
+ formatMentionAllForCard,
41
+ buildMentionedMessage,
42
+ buildMentionedCardContent,
43
+ type MentionTarget,
44
+ } from "./src/mention.js";
45
+ export { feishuPlugin } from "./src/channel.js";
4
46
 
5
47
  const plugin = {
6
48
  id: "feishu",
7
49
  name: "Feishu",
8
- description: "Feishu (Lark) channel plugin",
50
+ description: "Feishu/Lark channel plugin",
9
51
  configSchema: emptyPluginConfigSchema(),
10
52
  register(api: OpenClawPluginApi) {
53
+ setFeishuRuntime(api.runtime);
11
54
  api.registerChannel({ plugin: feishuPlugin });
55
+ registerFeishuDocTools(api);
56
+ registerFeishuWikiTools(api);
57
+ registerFeishuDriveTools(api);
58
+ registerFeishuPermTools(api);
59
+ registerFeishuBitableTools(api);
12
60
  },
13
61
  };
14
62
 
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "id": "feishu",
3
3
  "channels": ["feishu"],
4
+ "skills": ["./skills"],
4
5
  "configSchema": {
5
6
  "type": "object",
6
7
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.2.2",
4
- "description": "OpenClaw Feishu channel plugin",
3
+ "version": "2026.2.6",
4
+ "description": "OpenClaw Feishu/Lark channel plugin (community maintained by @m1heng)",
5
5
  "type": "module",
6
+ "dependencies": {
7
+ "@larksuiteoapi/node-sdk": "^1.58.0",
8
+ "@sinclair/typebox": "0.34.48",
9
+ "zod": "^4.3.6"
10
+ },
6
11
  "devDependencies": {
7
12
  "openclaw": "workspace:*"
8
13
  },
@@ -13,11 +18,10 @@
13
18
  "channel": {
14
19
  "id": "feishu",
15
20
  "label": "Feishu",
16
- "selectionLabel": "Feishu (Lark Open Platform)",
17
- "detailLabel": "Feishu Bot",
21
+ "selectionLabel": "Feishu/Lark (飞书)",
18
22
  "docsPath": "/channels/feishu",
19
23
  "docsLabel": "feishu",
20
- "blurb": "Feishu/Lark bot via WebSocket.",
24
+ "blurb": "飞书/Lark enterprise messaging with doc/wiki/drive tools.",
21
25
  "aliases": [
22
26
  "lark"
23
27
  ],
@@ -0,0 +1,105 @@
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
+
51
+ ```json
52
+ { "action": "create", "title": "New Document", "folder_token": "fldcnXXX" }
53
+ ```
54
+
55
+ ### List Blocks
56
+
57
+ ```json
58
+ { "action": "list_blocks", "doc_token": "ABC123def" }
59
+ ```
60
+
61
+ Returns full block data including tables, images. Use this to read structured content.
62
+
63
+ ### Get Single Block
64
+
65
+ ```json
66
+ { "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
67
+ ```
68
+
69
+ ### Update Block Text
70
+
71
+ ```json
72
+ {
73
+ "action": "update_block",
74
+ "doc_token": "ABC123def",
75
+ "block_id": "doxcnXXX",
76
+ "content": "New text"
77
+ }
78
+ ```
79
+
80
+ ### Delete Block
81
+
82
+ ```json
83
+ { "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
84
+ ```
85
+
86
+ ## Reading Workflow
87
+
88
+ 1. Start with `action: "read"` - get plain text + statistics
89
+ 2. Check `block_types` in response for Table, Image, Code, etc.
90
+ 3. If structured content exists, use `action: "list_blocks"` for full data
91
+
92
+ ## Configuration
93
+
94
+ ```yaml
95
+ channels:
96
+ feishu:
97
+ tools:
98
+ doc: true # default: true
99
+ ```
100
+
101
+ **Note:** `feishu_wiki` depends on this tool - wiki page content is read/written via `feishu_doc`.
102
+
103
+ ## Permissions
104
+
105
+ Required: `docx:document`, `docx:document:readonly`, `docx:document.block:convert`, `drive:drive`
@@ -0,0 +1,103 @@
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
+
97
+ 1. Read existing content
98
+ 2. Delete affected blocks
99
+ 3. Rewrite with new content in desired order
100
+
101
+ ### Delete multiple blocks
102
+
103
+ Blocks must be deleted one at a time. Delete child blocks before parent containers.
@@ -0,0 +1,97 @@
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
+
49
+ ```json
50
+ { "action": "create_folder", "name": "New Folder", "folder_token": "fldcnXXX" }
51
+ ```
52
+
53
+ ### Move File
54
+
55
+ ```json
56
+ { "action": "move", "file_token": "ABC123", "type": "docx", "folder_token": "fldcnXXX" }
57
+ ```
58
+
59
+ ### Delete File
60
+
61
+ ```json
62
+ { "action": "delete", "file_token": "ABC123", "type": "docx" }
63
+ ```
64
+
65
+ ## File Types
66
+
67
+ | Type | Description |
68
+ | ---------- | ----------------------- |
69
+ | `doc` | Old format document |
70
+ | `docx` | New format document |
71
+ | `sheet` | Spreadsheet |
72
+ | `bitable` | Multi-dimensional table |
73
+ | `folder` | Folder |
74
+ | `file` | Uploaded file |
75
+ | `mindnote` | Mind map |
76
+ | `shortcut` | Shortcut |
77
+
78
+ ## Configuration
79
+
80
+ ```yaml
81
+ channels:
82
+ feishu:
83
+ tools:
84
+ drive: true # default: true
85
+ ```
86
+
87
+ ## Permissions
88
+
89
+ - `drive:drive` - Full access (create, move, delete)
90
+ - `drive:drive:readonly` - Read only (list, info)
91
+
92
+ ## Known Limitations
93
+
94
+ - **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:
95
+ - `create_folder` without `folder_token` will fail (400 error)
96
+ - Bot can only access files/folders that have been **shared with it**
97
+ - **Workaround**: User must first create a folder manually and share it with the bot, then bot can create subfolders inside it
@@ -0,0 +1,119 @@
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
+ {
25
+ "action": "add",
26
+ "token": "ABC123",
27
+ "type": "docx",
28
+ "member_type": "email",
29
+ "member_id": "user@example.com",
30
+ "perm": "edit"
31
+ }
32
+ ```
33
+
34
+ ### Remove Collaborator
35
+
36
+ ```json
37
+ {
38
+ "action": "remove",
39
+ "token": "ABC123",
40
+ "type": "docx",
41
+ "member_type": "email",
42
+ "member_id": "user@example.com"
43
+ }
44
+ ```
45
+
46
+ ## Token Types
47
+
48
+ | Type | Description |
49
+ | ---------- | ----------------------- |
50
+ | `doc` | Old format document |
51
+ | `docx` | New format document |
52
+ | `sheet` | Spreadsheet |
53
+ | `bitable` | Multi-dimensional table |
54
+ | `folder` | Folder |
55
+ | `file` | Uploaded file |
56
+ | `wiki` | Wiki node |
57
+ | `mindnote` | Mind map |
58
+
59
+ ## Member Types
60
+
61
+ | Type | Description |
62
+ | ------------------ | ------------------ |
63
+ | `email` | Email address |
64
+ | `openid` | User open_id |
65
+ | `userid` | User user_id |
66
+ | `unionid` | User union_id |
67
+ | `openchat` | Group chat open_id |
68
+ | `opendepartmentid` | Department open_id |
69
+
70
+ ## Permission Levels
71
+
72
+ | Perm | Description |
73
+ | ------------- | ------------------------------------ |
74
+ | `view` | View only |
75
+ | `edit` | Can edit |
76
+ | `full_access` | Full access (can manage permissions) |
77
+
78
+ ## Examples
79
+
80
+ Share document with email:
81
+
82
+ ```json
83
+ {
84
+ "action": "add",
85
+ "token": "doxcnXXX",
86
+ "type": "docx",
87
+ "member_type": "email",
88
+ "member_id": "alice@company.com",
89
+ "perm": "edit"
90
+ }
91
+ ```
92
+
93
+ Share folder with group:
94
+
95
+ ```json
96
+ {
97
+ "action": "add",
98
+ "token": "fldcnXXX",
99
+ "type": "folder",
100
+ "member_type": "openchat",
101
+ "member_id": "oc_xxx",
102
+ "perm": "view"
103
+ }
104
+ ```
105
+
106
+ ## Configuration
107
+
108
+ ```yaml
109
+ channels:
110
+ feishu:
111
+ tools:
112
+ perm: true # default: false (disabled)
113
+ ```
114
+
115
+ **Note:** This tool is disabled by default because permission management is a sensitive operation. Enable explicitly if needed.
116
+
117
+ ## Permissions
118
+
119
+ Required: `drive:permission`
@@ -0,0 +1,111 @@
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
+
33
+ ```json
34
+ { "action": "nodes", "space_id": "7xxx", "parent_node_token": "wikcnXXX" }
35
+ ```
36
+
37
+ ### Get Node Details
38
+
39
+ ```json
40
+ { "action": "get", "token": "ABC123def" }
41
+ ```
42
+
43
+ Returns: `node_token`, `obj_token`, `obj_type`, etc. Use `obj_token` with `feishu_doc` to read/write the document.
44
+
45
+ ### Create Node
46
+
47
+ ```json
48
+ { "action": "create", "space_id": "7xxx", "title": "New Page" }
49
+ ```
50
+
51
+ With type and parent:
52
+
53
+ ```json
54
+ {
55
+ "action": "create",
56
+ "space_id": "7xxx",
57
+ "title": "Sheet",
58
+ "obj_type": "sheet",
59
+ "parent_node_token": "wikcnXXX"
60
+ }
61
+ ```
62
+
63
+ `obj_type`: `docx` (default), `sheet`, `bitable`, `mindnote`, `file`, `doc`, `slides`
64
+
65
+ ### Move Node
66
+
67
+ ```json
68
+ { "action": "move", "space_id": "7xxx", "node_token": "wikcnXXX" }
69
+ ```
70
+
71
+ To different location:
72
+
73
+ ```json
74
+ {
75
+ "action": "move",
76
+ "space_id": "7xxx",
77
+ "node_token": "wikcnXXX",
78
+ "target_space_id": "7yyy",
79
+ "target_parent_token": "wikcnYYY"
80
+ }
81
+ ```
82
+
83
+ ### Rename Node
84
+
85
+ ```json
86
+ { "action": "rename", "space_id": "7xxx", "node_token": "wikcnXXX", "title": "New Title" }
87
+ ```
88
+
89
+ ## Wiki-Doc Workflow
90
+
91
+ To edit a wiki page:
92
+
93
+ 1. Get node: `{ "action": "get", "token": "wiki_token" }` → returns `obj_token`
94
+ 2. Read doc: `feishu_doc { "action": "read", "doc_token": "obj_token" }`
95
+ 3. Write doc: `feishu_doc { "action": "write", "doc_token": "obj_token", "content": "..." }`
96
+
97
+ ## Configuration
98
+
99
+ ```yaml
100
+ channels:
101
+ feishu:
102
+ tools:
103
+ wiki: true # default: true
104
+ doc: true # required - wiki content uses feishu_doc
105
+ ```
106
+
107
+ **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.
108
+
109
+ ## Permissions
110
+
111
+ Required: `wiki:wiki` or `wiki:wiki:readonly`