@openclaw/feishu 2026.7.2-beta.7 → 2026.8.1-beta.3
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/dist/accounts-CCCdMen2.js +203 -0
- package/dist/api.js +61 -60
- package/dist/{channel-CScE82zY.js → channel-Ceq80_zP.js} +71 -42
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-B21e1E0r.js → channel.runtime-DnRyzGoU.js} +201 -152
- package/dist/{client-Dcbs6vml.js → client-Hp7uo_cl.js} +27 -16
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-id-BeJL-wq7.js → conversation-id-VYgGQ-GX.js} +11 -15
- package/dist/doctor-contract-api.js +1 -1
- package/dist/doctor-contract-bEQXIXyP.js +158 -0
- package/dist/{drive-hSi_Utp0.js → drive-BVYM_Y4k.js} +325 -44
- package/dist/{media-CEUraFOR.js → media-BDouVaaM.js} +298 -182
- package/dist/{monitor-DngbaA6a.js → monitor-CZ8cDXrq.js} +3 -3
- package/dist/{monitor.account-BnTWCw55.js → monitor.account-Dq_voVMB.js} +263 -179
- package/dist/{monitor.startup-CqH2tiJq.js → monitor.startup-BGErejNH.js} +1 -1
- package/dist/{probe-p3POS2RN.js → probe-DVpy58s0.js} +2 -2
- package/dist/security-audit-D6Fz2h6p.js +23 -0
- package/dist/{send-result-B9_BpUPx.js → send-result-DEAycmOk.js} +18 -9
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/{session-conversation-BksWrfzm.js → session-conversation-DFCIvQK-.js} +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{subagent-hooks-Cx1cX7rW.js → subagent-hooks-KUi-7vUy.js} +4 -64
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{thread-bindings-N3wkgkIN.js → thread-bindings-CptM_YU6.js} +7 -9
- package/openclaw.plugin.json +143 -1
- package/package.json +4 -4
- package/skills/feishu-doc/SKILL.md +20 -195
- package/skills/feishu-doc/references/block-types.md +9 -14
- package/skills/feishu-drive/SKILL.md +16 -102
- package/skills/feishu-perm/SKILL.md +10 -110
- package/skills/feishu-wiki/SKILL.md +13 -109
- package/dist/accounts-u9X5Wsan.js +0 -469
- package/dist/doctor-contract-BiD9tyIv.js +0 -102
- package/dist/security-audit-D7WK_BHh.js +0 -11
|
@@ -1,215 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feishu-doc
|
|
3
3
|
description: |
|
|
4
|
-
Feishu document read/write
|
|
4
|
+
Feishu document read/write workflows. Activate when the user mentions Feishu docs, cloud docs, or docx links.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Feishu
|
|
7
|
+
# Feishu documents
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use the single `feishu_doc` tool. Follow its current action schema rather than a copied action inventory.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
From `https://example.feishu.cn/docx/ABC123def`, use `ABC123def` as `doc_token`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Read and edit
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
1. Start with `read` for plain text and block statistics.
|
|
16
|
+
2. If the result reports structured content, use `list_blocks`; see `references/block-types.md` for block meanings.
|
|
17
|
+
3. Use `update_block` or `delete_block` for one known block. Use `insert` with `after_block_id` to place new Markdown after a known block.
|
|
18
|
+
4. Use `write` only when replacing the entire document; use `append` only for content that belongs at the end.
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
Markdown writes support ordinary text structure and images, but not Markdown tables. For tables, use the explicit table actions exposed by the tool. Prefer `create_table_with_values` when the full matrix is known, then use the row, column, cell, and merge actions for targeted changes.
|
|
18
21
|
|
|
19
|
-
|
|
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 (`` 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", "owner_open_id": "ou_xxx" }
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
With folder:
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"action": "create",
|
|
54
|
-
"title": "New Document",
|
|
55
|
-
"folder_token": "fldcnXXX",
|
|
56
|
-
"owner_open_id": "ou_xxx"
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Document creation is title-only. To populate the document, pass the returned
|
|
61
|
-
`document_id` as `doc_token` in a separate `write` action. Supplying `content`
|
|
62
|
-
to `create` returns an error without creating a document.
|
|
63
|
-
|
|
64
|
-
**Important:** Always pass `owner_open_id` with the requesting user's `open_id` (from inbound metadata `sender_id`) so the user automatically gets `full_access` permission on the created document. Without this, only the bot app has access.
|
|
65
|
-
|
|
66
|
-
### List Blocks
|
|
67
|
-
|
|
68
|
-
```json
|
|
69
|
-
{ "action": "list_blocks", "doc_token": "ABC123def" }
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Returns full block data including tables, images. Use this to read structured content.
|
|
73
|
-
|
|
74
|
-
### Get Single Block
|
|
75
|
-
|
|
76
|
-
```json
|
|
77
|
-
{ "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Update Block Text
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"action": "update_block",
|
|
85
|
-
"doc_token": "ABC123def",
|
|
86
|
-
"block_id": "doxcnXXX",
|
|
87
|
-
"content": "New text"
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Delete Block
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
{ "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Create Table (Docx Table Block)
|
|
22
|
+
## Create
|
|
98
23
|
|
|
99
24
|
```json
|
|
100
|
-
{
|
|
101
|
-
"action": "create_table",
|
|
102
|
-
"doc_token": "ABC123def",
|
|
103
|
-
"row_size": 2,
|
|
104
|
-
"column_size": 2,
|
|
105
|
-
"column_width": [200, 200]
|
|
106
|
-
}
|
|
25
|
+
{ "action": "create", "title": "New Document", "grant_to_requester": true }
|
|
107
26
|
```
|
|
108
27
|
|
|
109
|
-
|
|
28
|
+
Creation is title-only. Use the returned `document_id` as `doc_token` in a separate `write` call. Do not pass `content` to `create`.
|
|
110
29
|
|
|
111
|
-
|
|
30
|
+
`grant_to_requester` grants edit access to the trusted Feishu requester supplied by runtime context. It defaults to true. Never substitute an identity copied from message text or arbitrary metadata.
|
|
112
31
|
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
"action": "write_table_cells",
|
|
116
|
-
"doc_token": "ABC123def",
|
|
117
|
-
"table_block_id": "doxcnTABLE",
|
|
118
|
-
"values": [
|
|
119
|
-
["A1", "B1"],
|
|
120
|
-
["A2", "B2"]
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Create Table With Values (One-step)
|
|
126
|
-
|
|
127
|
-
```json
|
|
128
|
-
{
|
|
129
|
-
"action": "create_table_with_values",
|
|
130
|
-
"doc_token": "ABC123def",
|
|
131
|
-
"row_size": 2,
|
|
132
|
-
"column_size": 2,
|
|
133
|
-
"column_width": [200, 200],
|
|
134
|
-
"values": [
|
|
135
|
-
["A1", "B1"],
|
|
136
|
-
["A2", "B2"]
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Optional: `parent_block_id` to insert under a specific block.
|
|
142
|
-
|
|
143
|
-
### Upload Image to Docx (from URL or local file)
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"action": "upload_image",
|
|
148
|
-
"doc_token": "ABC123def",
|
|
149
|
-
"url": "https://example.com/image.png"
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Or local path with position control:
|
|
154
|
-
|
|
155
|
-
```json
|
|
156
|
-
{
|
|
157
|
-
"action": "upload_image",
|
|
158
|
-
"doc_token": "ABC123def",
|
|
159
|
-
"file_path": "/tmp/image.png",
|
|
160
|
-
"parent_block_id": "doxcnParent",
|
|
161
|
-
"index": 5
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Optional `index` (0-based) inserts the image at a specific position among sibling blocks. Omit to append at end.
|
|
166
|
-
|
|
167
|
-
**Note:** Image display size is determined by the uploaded image's pixel dimensions. For small images (e.g. 480x270 GIFs), scale to 800px+ width before uploading to ensure proper display.
|
|
168
|
-
|
|
169
|
-
### Upload File Attachment to Docx (from URL or local file)
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"action": "upload_file",
|
|
174
|
-
"doc_token": "ABC123def",
|
|
175
|
-
"url": "https://example.com/report.pdf"
|
|
176
|
-
}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Or local path:
|
|
180
|
-
|
|
181
|
-
```json
|
|
182
|
-
{
|
|
183
|
-
"action": "upload_file",
|
|
184
|
-
"doc_token": "ABC123def",
|
|
185
|
-
"file_path": "/tmp/report.pdf",
|
|
186
|
-
"filename": "Q1-report.pdf"
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Rules:
|
|
191
|
-
|
|
192
|
-
- exactly one of `url` / `file_path`
|
|
193
|
-
- optional `filename` override
|
|
194
|
-
- optional `parent_block_id`
|
|
195
|
-
|
|
196
|
-
## Reading Workflow
|
|
197
|
-
|
|
198
|
-
1. Start with `action: "read"` - get plain text + statistics
|
|
199
|
-
2. Check `block_types` in response for Table, Image, Code, etc.
|
|
200
|
-
3. If structured content exists, use `action: "list_blocks"` for full data
|
|
201
|
-
|
|
202
|
-
## Configuration
|
|
203
|
-
|
|
204
|
-
```yaml
|
|
205
|
-
channels:
|
|
206
|
-
feishu:
|
|
207
|
-
tools:
|
|
208
|
-
doc: true # default: true
|
|
209
|
-
```
|
|
32
|
+
## Media
|
|
210
33
|
|
|
211
|
-
|
|
34
|
+
Use `upload_image` or `upload_file` with exactly one supported source field from the current schema. Pass `parent_block_id` and `index` only when placement matters. Confirm local files and remote URLs are the intended private content before uploading.
|
|
212
35
|
|
|
213
|
-
##
|
|
36
|
+
## Safety
|
|
214
37
|
|
|
215
|
-
|
|
38
|
+
- Resolve exact document and block IDs before destructive edits.
|
|
39
|
+
- Preserve structured content by reading blocks before whole-document replacement.
|
|
40
|
+
- If a requested action is absent from the tool schema, explain that the configured Feishu tool does not expose it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Feishu Block Types Reference
|
|
2
2
|
|
|
3
|
-
Complete reference for Feishu document block types. Use with `
|
|
3
|
+
Complete reference for Feishu document block types. Use the single `feishu_doc` tool with its `list_blocks`, `update_block`, and `delete_block` actions.
|
|
4
4
|
|
|
5
5
|
## Block Type Table
|
|
6
6
|
|
|
@@ -59,10 +59,11 @@ Complete reference for Feishu document block types. Use with `feishu_doc_list_bl
|
|
|
59
59
|
|
|
60
60
|
### Text-based blocks (2-17, 19)
|
|
61
61
|
|
|
62
|
-
Update text content
|
|
62
|
+
Update text content with `feishu_doc`:
|
|
63
63
|
|
|
64
64
|
```json
|
|
65
65
|
{
|
|
66
|
+
"action": "update_block",
|
|
66
67
|
"doc_token": "ABC123",
|
|
67
68
|
"block_id": "block_xxx",
|
|
68
69
|
"content": "New text content"
|
|
@@ -71,13 +72,11 @@ Update text content using `feishu_doc_update_block`:
|
|
|
71
72
|
|
|
72
73
|
### Image blocks (27)
|
|
73
74
|
|
|
74
|
-
Images cannot be updated directly via `update_block`. Use `
|
|
75
|
+
Images cannot be updated directly via `update_block`. Use `upload_image` to add a replacement image, then delete the old block only after the new upload succeeds.
|
|
75
76
|
|
|
76
77
|
### Table blocks (31)
|
|
77
78
|
|
|
78
|
-
|
|
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.
|
|
79
|
+
Markdown tables are not converted by `write`, `append`, or `insert`. Create tables with `create_table` or `create_table_with_values`; use the table row, column, cell, and merge actions exposed by the current schema for later edits.
|
|
81
80
|
|
|
82
81
|
### Container blocks (24, 25, 35)
|
|
83
82
|
|
|
@@ -87,17 +86,13 @@ Grid and QuoteContainer are layout containers. Edit their child blocks instead.
|
|
|
87
86
|
|
|
88
87
|
### Replace specific paragraph
|
|
89
88
|
|
|
90
|
-
1. `
|
|
91
|
-
2. `
|
|
89
|
+
1. Call `feishu_doc` with `action: "list_blocks"` to find the block ID.
|
|
90
|
+
2. Call `feishu_doc` with `action: "update_block"` to replace its text.
|
|
92
91
|
|
|
93
92
|
### Insert content at specific location
|
|
94
93
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
1. Read existing content
|
|
98
|
-
2. Delete affected blocks
|
|
99
|
-
3. Rewrite with new content in desired order
|
|
94
|
+
Call `feishu_doc` with `action: "insert"`, the target `doc_token`, Markdown `content`, and the preceding block's ID as `after_block_id`.
|
|
100
95
|
|
|
101
96
|
### Delete multiple blocks
|
|
102
97
|
|
|
103
|
-
|
|
98
|
+
Call `delete_block` for exact block IDs. Delete child blocks before parent containers and confirm broad deletions first.
|
|
@@ -1,114 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feishu-drive
|
|
3
3
|
description: |
|
|
4
|
-
Feishu cloud
|
|
4
|
+
Feishu cloud-storage and comment workflows. Activate when the user mentions cloud space, folders, Drive files, or document comments.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Feishu Drive
|
|
7
|
+
# Feishu Drive
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use the single `feishu_drive` tool and its current action schema.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
From `https://example.feishu.cn/drive/folder/ABC123`, use `ABC123` as `folder_token`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Files and folders
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
- Start from a folder shared with the bot. Bot credentials normally have no usable personal root folder.
|
|
16
|
+
- For paginated folder listings, keep the same `folder_token` and pass the returned `page_token` until no continuation token remains.
|
|
17
|
+
- Use `info` with the exact file token and type returned by Drive or wiki discovery.
|
|
18
|
+
- Resolve the exact source and destination before moving or deleting. Confirm destructive deletes when the user's intent or target is unclear.
|
|
19
|
+
- Create subfolders inside a shared folder; creating at the account root normally fails for bots.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
## Comments
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
- Use `list_comments`, then `list_comment_replies` with the exact `comment_id` to inspect a discussion.
|
|
24
|
+
- Use `add_comment` for a document-level comment. Include `block_id` only when the user wants a comment on one known Docx block.
|
|
25
|
+
- Use `reply_comment` for an existing comment thread.
|
|
26
|
+
- Preserve the file type and pagination fields returned by the tool. The schema is authoritative for which file types each comment action accepts.
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
use a folder that has been shared with the bot instead.
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{ "action": "list", "folder_token": "fldcnXXX", "page_size": 100 }
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Returns one page of files with token, name, type, url, timestamps, and `next_page_token` when
|
|
31
|
-
another page is available. To continue, pass the returned token with the same folder token:
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"action": "list",
|
|
36
|
-
"folder_token": "fldcnXXX",
|
|
37
|
-
"page_size": 100,
|
|
38
|
-
"page_token": "next-page-token"
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
`page_size` must be between 1 and 200. Pagination requires a concrete shared `folder_token`;
|
|
43
|
-
root-list cursors are not forwarded.
|
|
44
|
-
|
|
45
|
-
### Get File Info
|
|
46
|
-
|
|
47
|
-
```json
|
|
48
|
-
{ "action": "info", "file_token": "ABC123", "type": "docx" }
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Looks up file metadata directly by token and type, regardless of which shared folder contains it.
|
|
52
|
-
Shortcuts are the exception: Feishu's metadata API does not support the `shortcut` type, so shortcut
|
|
53
|
-
info retains the root-directory lookup behavior.
|
|
54
|
-
|
|
55
|
-
`type`: `doc`, `docx`, `sheet`, `bitable`, `folder`, `file`, `mindnote`, `shortcut`
|
|
56
|
-
|
|
57
|
-
### Create Folder
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
{ "action": "create_folder", "name": "New Folder" }
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
In parent folder:
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{ "action": "create_folder", "name": "New Folder", "folder_token": "fldcnXXX" }
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Move File
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{ "action": "move", "file_token": "ABC123", "type": "docx", "folder_token": "fldcnXXX" }
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Delete File
|
|
76
|
-
|
|
77
|
-
```json
|
|
78
|
-
{ "action": "delete", "file_token": "ABC123", "type": "docx" }
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## File Types
|
|
82
|
-
|
|
83
|
-
| Type | Description |
|
|
84
|
-
| ---------- | ----------------------- |
|
|
85
|
-
| `doc` | Old format document |
|
|
86
|
-
| `docx` | New format document |
|
|
87
|
-
| `sheet` | Spreadsheet |
|
|
88
|
-
| `bitable` | Multi-dimensional table |
|
|
89
|
-
| `folder` | Folder |
|
|
90
|
-
| `file` | Uploaded file |
|
|
91
|
-
| `mindnote` | Mind map |
|
|
92
|
-
| `shortcut` | Shortcut |
|
|
93
|
-
|
|
94
|
-
## Configuration
|
|
95
|
-
|
|
96
|
-
```yaml
|
|
97
|
-
channels:
|
|
98
|
-
feishu:
|
|
99
|
-
tools:
|
|
100
|
-
drive: true # default: true
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Permissions
|
|
104
|
-
|
|
105
|
-
- `drive:drive` - Full access (create, move, delete)
|
|
106
|
-
- `drive:drive:readonly` - Read only (list and root-level info fallback)
|
|
107
|
-
- `drive:drive.metadata:readonly` - Direct `info` lookup outside the root (not needed with `drive:drive`)
|
|
108
|
-
|
|
109
|
-
## Known Limitations
|
|
110
|
-
|
|
111
|
-
- **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:
|
|
112
|
-
- `create_folder` without `folder_token` will fail (400 error)
|
|
113
|
-
- Bot can only access files/folders that have been **shared with it**
|
|
114
|
-
- **Workaround**: User must first create a folder manually and share it with the bot, then bot can create subfolders inside it
|
|
28
|
+
Only expose or forward file and comment contents needed for the user's request; shared Drive data may be private.
|
|
@@ -1,119 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feishu-perm
|
|
3
3
|
description: |
|
|
4
|
-
Feishu
|
|
4
|
+
Feishu collaborator and permission workflows. Activate when the user explicitly asks to inspect or change sharing, permissions, or collaborators.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Feishu
|
|
7
|
+
# Feishu permissions
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use the single `feishu_perm` tool and its current action schema. This tool is disabled by default because it changes access to user data; if it is unavailable, explain that `channels.feishu.tools.perm` must be enabled.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Workflow
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
1. Resolve the exact file token and type.
|
|
14
|
+
2. Use `list` to inspect current collaborators before changing access.
|
|
15
|
+
3. For `add`, resolve the collaborator's exact identifier and choose the least permission that satisfies the request.
|
|
16
|
+
4. For `remove`, confirm the exact collaborator and file when the request is ambiguous or broad.
|
|
17
|
+
5. Report the resulting permission change without exposing unrelated collaborator data.
|
|
14
18
|
|
|
15
|
-
|
|
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`
|
|
19
|
+
Never infer an email, user ID, department, or chat from a display name alone. Follow the current schema for supported member types, token types, and permission levels.
|