@acedatacloud/skills 2026.629.3 → 2026.630.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/skills",
3
- "version": "2026.629.3",
3
+ "version": "2026.630.0",
4
4
  "description": "Agent Skills for AceDataCloud AI services — music, image, video generation, LLM chat, web search. Compatible with Claude Code, GitHub Copilot, Gemini CLI, OpenAI Codex, and 30+ AI coding agents.",
5
5
  "keywords": [
6
6
  "agent-skills",
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: feishu
3
+ description: Read and write Feishu (飞书) docs, sheets, Base (bitable), Drive files, calendar events, tasks, wiki, and IM messages via the Feishu Open Platform REST API. Use when the user mentions 飞书 / Feishu / Lark, a Feishu document or sheet link, their Feishu calendar, or wants to send a Feishu message.
4
+ when_to_use: |
5
+ Trigger when the user wants to read or write something in Feishu (飞书) —
6
+ summarize / create / edit a doc, read or append to a spreadsheet, query
7
+ or add Base (bitable) records, browse Drive files, look at or create
8
+ calendar events, manage tasks, read wiki nodes, or send an IM message.
9
+ connections: [feishu]
10
+ allowed_tools: [Bash]
11
+ license: Apache-2.0
12
+ metadata:
13
+ author: acedatacloud
14
+ version: "1.0"
15
+ ---
16
+
17
+ We drive the [Feishu Open Platform API](https://open.feishu.cn/document)
18
+ with `curl + jq`. The user's OAuth `user_access_token` is in
19
+ `$FEISHU_TOKEN`; every call sends it as `Authorization: Bearer
20
+ $FEISHU_TOKEN`. All endpoints live under `https://open.feishu.cn/open-apis`.
21
+
22
+ Calls run **in the user's context** (their docs, calendar, messages) — only
23
+ data the user can access and only the scopes they granted at connect time
24
+ (docs / sheets / base / drive / calendar / IM / wiki / task / contacts).
25
+
26
+ ## Response shape & error handling
27
+
28
+ Every Feishu response is `{"code": 0, "msg": "success", "data": {…}}`.
29
+ **`code == 0` means success**; any non-zero `code` is an error — surface
30
+ `msg` to the user. Always check it:
31
+
32
+ ```sh
33
+ resp=$(curl -sS … )
34
+ echo "$resp" | jq 'if .code == 0 then .data else error("Feishu \(.code): \(.msg)") end'
35
+ ```
36
+
37
+ Common error codes:
38
+
39
+ | code | meaning | what to do |
40
+ |---|---|---|
41
+ | `99991663` / `99991668` | access token invalid / expired | tell the user to reconnect Feishu in 连接 settings |
42
+ | `99991661` | no permission (scope not granted) | the connect-time scope is missing — reconnect and grant it |
43
+ | `1254xxx` | resource not found / no access | the user can't see that doc / sheet / app — double-check the token/id |
44
+
45
+ ## Recipes
46
+
47
+ ### Verify auth (always run first)
48
+
49
+ ```sh
50
+ curl -sS https://open.feishu.cn/open-apis/authen/v1/user_info \
51
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
52
+ | jq 'if .code == 0 then {name: .data.name, open_id: .data.open_id, email: .data.email} else . end'
53
+ ```
54
+
55
+ ### Docs (docx)
56
+
57
+ A Feishu doc URL looks like `https://…feishu.cn/docx/<document_id>`. The
58
+ `document_id` is the last path segment.
59
+
60
+ Read a document's plain text:
61
+
62
+ ```sh
63
+ curl -sS "https://open.feishu.cn/open-apis/docx/v1/documents/DOCUMENT_ID/raw_content" \
64
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
65
+ | jq -r 'if .code == 0 then .data.content else "ERR \(.code): \(.msg)" end'
66
+ ```
67
+
68
+ List a document's blocks (structured content):
69
+
70
+ ```sh
71
+ curl -sS "https://open.feishu.cn/open-apis/docx/v1/documents/DOCUMENT_ID/blocks?page_size=500" \
72
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
73
+ | jq 'if .code == 0 then [.data.items[] | {block_id, block_type}] else . end'
74
+ ```
75
+
76
+ Create a new empty document (optionally inside a folder):
77
+
78
+ ```sh
79
+ curl -sS -X POST "https://open.feishu.cn/open-apis/docx/v1/documents" \
80
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
81
+ -H "Content-Type: application/json" \
82
+ -d "$(jq -nc --arg title "会议纪要 2026-07-01" '{title: $title}')" \
83
+ | jq 'if .code == 0 then {document_id: .data.document.document_id} else . end'
84
+ ```
85
+
86
+ Append a text block to a document (insert at the end of the document body —
87
+ `DOCUMENT_ID` is also the root block id):
88
+
89
+ ```sh
90
+ curl -sS -X POST "https://open.feishu.cn/open-apis/docx/v1/documents/DOCUMENT_ID/blocks/DOCUMENT_ID/children" \
91
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
92
+ -H "Content-Type: application/json" \
93
+ -d "$(jq -nc --arg text "由助手追加的一段内容。" '
94
+ {children: [{block_type: 2, text: {elements: [{text_run: {content: $text}}]}}]}')" \
95
+ | jq 'if .code == 0 then "appended" else . end'
96
+ ```
97
+
98
+ ### Spreadsheets (sheets v2)
99
+
100
+ A sheet URL looks like `https://…feishu.cn/sheets/<spreadsheet_token>`.
101
+ A range is `<sheetId>!<A1:range>`, e.g. `abc123!A1:D10`. List sheet ids via
102
+ the metainfo endpoint first if you don't have one.
103
+
104
+ Read a range:
105
+
106
+ ```sh
107
+ curl -sS "https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/SPREADSHEET_TOKEN/values/RANGE" \
108
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
109
+ | jq 'if .code == 0 then .data.valueRange.values else . end'
110
+ ```
111
+
112
+ Append rows after the last non-empty row:
113
+
114
+ ```sh
115
+ curl -sS -X POST "https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/SPREADSHEET_TOKEN/values_append" \
116
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
117
+ -H "Content-Type: application/json" \
118
+ -d "$(jq -nc '{valueRange: {range: "SHEET_ID!A1:B1", values: [["张三", 100], ["李四", 200]]}}')" \
119
+ | jq 'if .code == 0 then .data.updates else . end'
120
+ ```
121
+
122
+ ### Base / 多维表格 (bitable v1)
123
+
124
+ A Base URL looks like `https://…feishu.cn/base/<app_token>`. Get `table_id`
125
+ from `…/bitable/v1/apps/APP_TOKEN/tables`.
126
+
127
+ List records:
128
+
129
+ ```sh
130
+ curl -sS "https://open.feishu.cn/open-apis/bitable/v1/apps/APP_TOKEN/tables/TABLE_ID/records?page_size=100" \
131
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
132
+ | jq 'if .code == 0 then [.data.items[] | {record_id, fields}] else . end'
133
+ ```
134
+
135
+ Create a record:
136
+
137
+ ```sh
138
+ curl -sS -X POST "https://open.feishu.cn/open-apis/bitable/v1/apps/APP_TOKEN/tables/TABLE_ID/records" \
139
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
140
+ -H "Content-Type: application/json" \
141
+ -d "$(jq -nc '{fields: {"标题": "新任务", "状态": "待办"}}')" \
142
+ | jq 'if .code == 0 then {record_id: .data.record.record_id} else . end'
143
+ ```
144
+
145
+ ### Drive files
146
+
147
+ List files in a folder (omit `folder_token` for the root):
148
+
149
+ ```sh
150
+ curl -sS "https://open.feishu.cn/open-apis/drive/v1/files?folder_token=FOLDER_TOKEN&page_size=50" \
151
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
152
+ | jq 'if .code == 0 then [.data.files[] | {name, type, token, url}] else . end'
153
+ ```
154
+
155
+ ### Calendar (v4)
156
+
157
+ List the user's calendars (the primary one has `type: "primary"`):
158
+
159
+ ```sh
160
+ curl -sS "https://open.feishu.cn/open-apis/calendar/v4/calendars?page_size=50" \
161
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
162
+ | jq 'if .code == 0 then [.data.calendar_list[] | {calendar_id, summary, type}] else . end'
163
+ ```
164
+
165
+ List events in a time window (epoch-seconds strings):
166
+
167
+ ```sh
168
+ curl -sS "https://open.feishu.cn/open-apis/calendar/v4/calendars/CALENDAR_ID/events?start_time=1751299200&end_time=1751385600&page_size=100" \
169
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
170
+ | jq 'if .code == 0 then [.data.items[] | {summary, start: .start_time, end: .end_time, event_id}] else . end'
171
+ ```
172
+
173
+ Create an event (times are epoch-seconds strings):
174
+
175
+ ```sh
176
+ curl -sS -X POST "https://open.feishu.cn/open-apis/calendar/v4/calendars/CALENDAR_ID/events" \
177
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
178
+ -H "Content-Type: application/json" \
179
+ -d "$(jq -nc '{summary: "项目评审", start_time: {timestamp: "1751302800"}, end_time: {timestamp: "1751306400"}}')" \
180
+ | jq 'if .code == 0 then {event_id: .data.event.event_id} else . end'
181
+ ```
182
+
183
+ ### Tasks (v2)
184
+
185
+ List the user's tasks:
186
+
187
+ ```sh
188
+ curl -sS "https://open.feishu.cn/open-apis/task/v2/tasks?page_size=50" \
189
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
190
+ | jq 'if .code == 0 then [.data.items[] | {summary, completed_at, task_guid: .guid}] else . end'
191
+ ```
192
+
193
+ Create a task:
194
+
195
+ ```sh
196
+ curl -sS -X POST "https://open.feishu.cn/open-apis/task/v2/tasks" \
197
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
198
+ -H "Content-Type: application/json" \
199
+ -d "$(jq -nc '{summary: "准备周会材料"}')" \
200
+ | jq 'if .code == 0 then {task_guid: .data.task.guid} else . end'
201
+ ```
202
+
203
+ ### Wiki
204
+
205
+ List wiki spaces, then nodes within a space:
206
+
207
+ ```sh
208
+ curl -sS "https://open.feishu.cn/open-apis/wiki/v2/spaces?page_size=50" \
209
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
210
+ | jq 'if .code == 0 then [.data.items[] | {space_id, name}] else . end'
211
+
212
+ curl -sS "https://open.feishu.cn/open-apis/wiki/v2/spaces/SPACE_ID/nodes?page_size=50" \
213
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
214
+ | jq 'if .code == 0 then [.data.items[] | {title, node_token, obj_type}] else . end'
215
+ ```
216
+
217
+ ### Send an IM message
218
+
219
+ Send to a user by `open_id` (use `receive_id_type=chat_id` for a group
220
+ chat). `content` must be a JSON **string**, so it's double-encoded:
221
+
222
+ ```sh
223
+ curl -sS -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id" \
224
+ -H "Authorization: Bearer $FEISHU_TOKEN" \
225
+ -H "Content-Type: application/json" \
226
+ -d "$(jq -nc --arg rid "ou_xxx" --arg text "你好,这是助手发送的消息。" '
227
+ {receive_id: $rid, msg_type: "text", content: ({text: $text} | tostring)}')" \
228
+ | jq 'if .code == 0 then {message_id: .data.message_id} else . end'
229
+ ```
230
+
231
+ ## Notes
232
+
233
+ - Confirm destructive or outward-facing actions (sending a message,
234
+ creating a calendar invite, posting to a shared doc) with the user
235
+ before running them.
236
+ - Pagination: list endpoints return `data.page_token` / `data.has_more`;
237
+ pass `page_token=…` to fetch the next page.
238
+ - When the user pastes a Feishu link, extract the token/id from the URL
239
+ path rather than asking them for it.