@amaster.ai/pi-lark 0.1.2-beta.55 → 0.1.2-beta.57
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 +2 -2
- package/skills/lark-apps/SKILL.md +2 -0
- package/skills/lark-apps/references/lark-apps-db.md +130 -2
- package/skills/lark-apps/references/lark-apps-user-id-convert.md +63 -0
- package/skills/lark-base/SKILL.md +22 -34
- package/skills/lark-base/references/lark-base-cell-value.md +19 -7
- package/skills/lark-base/references/lark-base-data-analysis-cloud.md +145 -0
- package/skills/lark-base/references/lark-base-data-analysis-pandas.md +93 -0
- package/skills/lark-base/references/lark-base-data-analysis-python-stdlib.md +120 -0
- package/skills/lark-base/references/lark-base-data-analysis-sop.md +176 -162
- package/skills/lark-base/references/lark-base-data-query-guide.md +1 -3
- package/skills/lark-base/references/lark-base-data-query.md +6 -9
- package/skills/lark-base/references/lark-base-field-json.md +2 -2
- package/skills/lark-base/references/lark-base-filter-condition.md +19 -3
- package/skills/lark-base/references/lark-base-record-upsert.md +2 -2
- package/skills/lark-calendar/SKILL.md +2 -0
- package/skills/lark-calendar/references/lark-calendar-create.md +1 -0
- package/skills/lark-doc/SKILL.md +1 -1
- package/skills/lark-drive/SKILL.md +4 -2
- package/skills/lark-drive/references/lark-drive-export.md +1 -0
- package/skills/lark-drive/references/lark-drive-member-remove.md +59 -0
- package/skills/lark-drive/references/lark-drive-push.md +5 -1
- package/skills/lark-drive/references/lark-drive-search.md +2 -0
- package/skills/lark-minutes/SKILL.md +11 -5
- package/skills/lark-minutes/references/lark-minutes-apply-permission.md +95 -0
- package/skills/lark-minutes/references/lark-minutes-detail.md +7 -6
- package/skills/lark-minutes/references/lark-minutes-download.md +4 -2
- package/skills/lark-note/SKILL.md +11 -9
- package/skills/lark-note/references/lark-note-detail.md +5 -2
- package/skills/lark-note/references/lark-note-transcript.md +2 -0
- package/skills/lark-shared/SKILL.md +36 -0
- package/skills/lark-slides/SKILL.md +14 -14
- package/skills/lark-slides/references/{xml → cli}/lark-slides-add-slide.md +1 -1
- package/skills/lark-slides/references/cli/lark-slides-create.md +5 -5
- package/skills/lark-slides/references/{xml → cli}/lark-slides-delete-slide.md +2 -2
- package/skills/lark-slides/references/cli/lark-slides-media-upload.md +4 -5
- package/skills/lark-slides/references/cli/lark-slides-replace-slide.md +10 -9
- package/skills/lark-slides/references/{lark-slides-update-slide.md → cli/lark-slides-update-slide.md} +3 -3
- package/skills/lark-slides/references/cli/lark-slides-xml-presentation-slide-get.md +3 -3
- package/skills/lark-slides/references/cli/lark-slides-xml-presentation-slide-replace.md +2 -2
- package/skills/lark-slides/references/cli/lark-slides-xml-presentations-get.md +2 -2
- package/skills/lark-slides/references/lark-slides-add-slide.md +1 -1
- package/skills/lark-slides/references/lark-slides-delete-slide.md +1 -1
- package/skills/lark-slides/references/lark-slides-edit-workflows.md +1 -1
- package/skills/lark-slides/references/workflow/error-handling.md +1 -1
- package/skills/lark-slides/references/workflow/{slides_editing.md → slides-editing.md} +4 -4
- package/skills/lark-slides/references/workflow/validation-xml.md +1 -1
- package/skills/lark-task/SKILL.md +12 -0
- package/skills/lark-task/references/lark-task-create.md +3 -1
- package/skills/lark-vc/SKILL.md +13 -5
- package/skills/lark-vc/references/lark-vc-detail.md +11 -6
- package/skills/{lark-vc-agent/references/lark-vc-agent-meeting-events.md → lark-vc/references/lark-vc-meeting-events.md} +121 -20
- package/skills/{lark-vc-agent/references/lark-vc-agent-meeting-list-active.md → lark-vc/references/lark-vc-meeting-list-active.md} +2 -2
- package/skills/{lark-vc-agent/references/lark-vc-agent-meeting-message-send.md → lark-vc/references/lark-vc-meeting-message-send.md} +3 -3
- package/skills/lark-vc/references/lark-vc-recording.md +8 -6
- package/skills/lark-vc/references/vc-domain-boundaries.md +6 -1
- package/skills/lark-vc-agent/SKILL.md +24 -9
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-join.md +2 -2
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-leave.md +2 -2
- package/skills/lark-wiki/references/lark-wiki-node-create.md +19 -2
- package/skills/lark-wiki/references/lark-wiki-node-get.md +11 -0
- package/skills/lark-wiki/references/lark-wiki-node-list.md +1 -1
- package/skills/lark-slides/references/cli/lark-slides-replace-pages.md +0 -97
|
@@ -65,7 +65,7 @@ lark-cli vc +meeting-events --as <same_identity> --meeting-id <id> --page-token
|
|
|
65
65
|
lark-cli vc +meeting-join --as bot --meeting-number 123456789
|
|
66
66
|
|
|
67
67
|
# 再查询事件
|
|
68
|
-
lark-cli vc +meeting-events --as bot --meeting-id <id>
|
|
68
|
+
lark-cli vc +meeting-events --as bot --meeting-id <id> --page-all --format pretty
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
如果应用机器人已经在会中,也可以先通过 active meeting 找会:
|
|
@@ -114,7 +114,9 @@ lark-cli vc +meeting-events --as user --meeting-id <id> --page-all --format pret
|
|
|
114
114
|
- `--format pretty`:默认推荐格式,输出当前身份和逐条时间线,适合快速理解“发生了什么”。
|
|
115
115
|
- `--format ndjson`:输出事件行,并带 metadata 行,适合流式消费。
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
**选型原则**:默认先用 `--format pretty`;仅当 `pretty` 缺少完成任务所必需的结构化字段时,才改用 `--format json`。用户明确要求 JSON 或规则明确要求结构化字段时可直接用 `--format json`;需要流式消费时用 `--format ndjson`。
|
|
118
|
+
|
|
119
|
+
> **JSON 成本**:JSON 保留完整 payload,输出通常远大于 `pretty`;长会全量拉取时会显著占用上下文空间。
|
|
118
120
|
|
|
119
121
|
> **注意**:pretty 输出中的正文文本会做单行转义,真实换行会显示为 `\n`,避免打乱时间线布局。
|
|
120
122
|
|
|
@@ -131,19 +133,117 @@ lark-cli vc +meeting-events --as user --meeting-id <id> --page-all --format pret
|
|
|
131
133
|
|
|
132
134
|
执行准则:
|
|
133
135
|
|
|
134
|
-
- 如果上下文已有明确 `meeting_id`,沿用该 `meeting_id` 的来源身份执行 `+meeting-events --page-all --format json`。
|
|
135
136
|
- 如果上下文没有明确 `meeting_id`,先按用户当前意图选择身份:问“我/当前用户所在会议”用 `lark-cli vc +meeting-list-active --as user --format json`;问“应用机器人可见的目标用户会议”用 `lark-cli vc +meeting-list-active --as bot --user-id <user_open_id> --format json`。返回多个会议时先让用户选择。
|
|
136
137
|
- 如果上下文只有 9 位会议号,先按当前身份执行 `+meeting-list-active` 并按 `meeting_no` 匹配;匹配到唯一会议后再查事件。不要为了总结会议而自动调用 `+meeting-join`。
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
- `share_doc.title`
|
|
141
|
-
- `share_doc.url`
|
|
142
|
-
- 必须继续读取共享文档内容,再生成总结,不能只根据“开始共享了某文档”这条事件和文档标题来概括会议内容。
|
|
143
|
-
- 若存在多个共享文档,优先读取**最近一次共享**的文档。
|
|
138
|
+
- 确认 `meeting_id` 后,沿用其来源身份执行 `lark-cli vc +meeting-events --as <same_identity> --meeting-id <id> --page-all --format pretty` 拉取最新事件流。
|
|
139
|
+
- 如果事件流显示开始共享内容(JSON 事件类型为 `magic_share_started`,pretty 时间线显示“开始共享”),并包含文档标题或 URL 等线索,必须继续读取共享文档内容后再生成总结,不能只根据共享事件和文档标题概括会议内容。
|
|
140
|
+
- 若存在多个共享文档,按用户问题读取相关文档;处理某条文档上下文事件时必须按该 item 的 `share_id` 精确关联,不能用“最近一次共享”替代。
|
|
144
141
|
- 若文档读取失败,必须明确说明“以下总结仅基于会中事件流,未成功读取共享文档内容”。
|
|
145
142
|
|
|
146
|
-
### 7.
|
|
143
|
+
### 7. 文档上下文事件消费
|
|
144
|
+
|
|
145
|
+
`document_context_changed` 是只读线索事件。需要根据该事件执行评论、章节或预览等后续处理时,必须用 `+meeting-events --page-all --format json` 读取 `share_id`、`comment_id`、`element_token` 等完整字段;仅向用户展示时间线时仍默认使用 pretty。`vc +meeting-events` 保留原始 payload,并按既有事件输出约定派生 actor 与 pretty timeline;它不会为单个事件类型扩张 JSON/NDJSON 公共 envelope,也不会查询评论、下载素材或写文件。后续 Drive/Docs 命令只能由 Agent 按下表显式选择。
|
|
146
|
+
|
|
147
|
+
#### 共享会话关联
|
|
148
|
+
|
|
149
|
+
`share_id` 标识一次共享会话。Agent 按事件时间顺序消费完整事件流,并维护共享会话状态:
|
|
150
|
+
|
|
151
|
+
1. 从 `payload.magic_share_started_items[]` 读取 `share_id` 和 `share_doc`,建立 `share_id -> share_doc` 映射并标记会话开始。同一 `share_id` 重复携带相同文档时按幂等事件处理;若指向不同文档则停止解析,不覆盖旧映射。
|
|
152
|
+
2. `document_context_changed_items[]` 通过自己的 `share_id` 精确查找该映射。当前契约中 item 自带的 `share_doc` 不提供文档信息;只保留它的原始值,不作为 URL/title 来源,也不做冲突判定。
|
|
153
|
+
3. `payload.magic_share_ended_items[]` 使用相同 `share_id` 标记该会话结束。历史映射可保留用于解释本批次中结束前已发生的上下文事件,但不能再作为新的活动共享会话。
|
|
154
|
+
4. 增量拉取从会话中途开始且本地没有对应映射时,重新拉取包含 `magic_share_started` 的完整事件流;仍无法命中则标记未解析。禁止回退到当前文档、最近一次共享或其他 `share_id`。
|
|
155
|
+
|
|
156
|
+
#### 字段合同
|
|
157
|
+
|
|
158
|
+
| 路径 | 含义与处理 |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| `payload.magic_share_started_items[].share_id/share_doc` | 建立一次共享会话与文档 URL/title 的映射。缺 `share_id` 时不建立映射。 |
|
|
161
|
+
| `payload.magic_share_ended_items[].share_id` | 结束同一 `share_id` 的共享会话;不得结束其他映射。 |
|
|
162
|
+
| `payload.document_context_changed_items[]` | 结构化消费按原序读取;pretty timeline 沿用统一时间排序。每项恰有一个已知 context 才生成 pretty 条目,未知/歧义项只保留 raw。 |
|
|
163
|
+
| `item.operator` | 当前 item 的 actor;缺 ID/name 时不猜共享发起人。 |
|
|
164
|
+
| `item.share_id` | 当前上下文所属共享会话;用它精确查找 `magic_share_started` 建立的 `share_doc` 映射。 |
|
|
165
|
+
| `item.share_doc.url/title` | 当前不作为文档元信息来源;保留在 raw payload 以兼容未来扩展。文档 URL/title 只从同 `share_id` 的 `magic_share_started` 映射取得。 |
|
|
166
|
+
| `item.time` | Unix 毫秒字符串;缺失或非法时 timeline 回退到事件时间。 |
|
|
167
|
+
| `item.comment_focus.comment_id/focused` | `focused=true` 才精确查询一个 comment ID;`false` 是清除焦点,零查询。 |
|
|
168
|
+
| `item.section_location.parent_titles/title/level` | `section_path` 按 parent 原序再追加 title,trim 后丢弃空段,以 ` > ` 连接;`level` 仅作诊断,不参与截断或补层。 |
|
|
169
|
+
| `item.element_preview.action/element_type/element_token/block_id` | 只有 `open + image + token`、`open + whiteboard + token` 可在明确预览意图下路由;其他组合零调用。 |
|
|
170
|
+
| 事件公共 envelope | JSON/NDJSON 只使用既有 `event_id/event_type/event_time/actors/payload`;不新增顶层 `summary/section_path`,也不发明 `derived.document_context`。 |
|
|
171
|
+
| 事件 `payload` | 原始恢复面;未知字段保留,顶层空数组沿用所有会议事件共用的压缩规则,派生字段不会写回 payload。 |
|
|
172
|
+
|
|
173
|
+
#### 评论聚焦:只查一个 ID
|
|
174
|
+
|
|
175
|
+
先读取当前 item 的 `share_id` 和 `comment_focus.comment_id`,再按“共享会话关联”取得 `share_doc.url`。优先把完整 URL 传给现有 shortcut,由它解析实际 `file_token/file_type`(含 Wiki 解包);如果上游只留下裸 token,则必须同时提供已解析且受支持的 `file_type`。
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# 推荐:share_doc.url 完整可用
|
|
179
|
+
lark-cli drive +batch-query-comments \
|
|
180
|
+
--as <same_identity> \
|
|
181
|
+
--url "<share_doc.url>" \
|
|
182
|
+
--comment-ids "<comment_focus.comment_id>" \
|
|
183
|
+
--format json
|
|
184
|
+
|
|
185
|
+
# 只有已经可靠解析出裸 token/type 时使用
|
|
186
|
+
lark-cli drive +batch-query-comments \
|
|
187
|
+
--as <same_identity> \
|
|
188
|
+
--token "<file_token>" \
|
|
189
|
+
--type "<file_type>" \
|
|
190
|
+
--comment-ids "<comment_focus.comment_id>" \
|
|
191
|
+
--format json
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
该 shortcut 对应 `drive.file.comments.batch_query`,请求体必须只有 `comment_ids:["<当前comment_id>"]`。响应处理规则:
|
|
195
|
+
|
|
196
|
+
1. 整个响应 `items` 长度必须恰为 1,且 `items[0].comment_id` 必须与请求 ID 完全相等。`items` 为空、多于 1 项或唯一项 ID 不同都停止;即使多项中恰有一项匹配,也不得挑选该项继续。失败时保留 `share_doc/comment_id`,禁止改用 `drive +list-comments` 扫描整篇文档。
|
|
197
|
+
2. `item.quote` 是引用位置;评论正文和回复在 `item.reply_list.replies`,其中第一条是根评论。
|
|
198
|
+
3. 完整性看命中评论卡片的 **`item.has_more`**,不是外层评论分页,也不是根据非空 `page_token` 猜测。`item.has_more=false` 时直接使用内嵌列表,零 `+list-replies` 调用。
|
|
199
|
+
4. `item.has_more=true` 时忽略截断列表,从**不带 `--page-token` 的第一页**开始重建完整 replies:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
lark-cli drive +list-replies \
|
|
203
|
+
--as <same_identity> \
|
|
204
|
+
--url "<share_doc.url>" \
|
|
205
|
+
--comment-id "<comment_focus.comment_id>" \
|
|
206
|
+
--page-size 100 \
|
|
207
|
+
--format json
|
|
208
|
+
|
|
209
|
+
lark-cli drive +list-replies \
|
|
210
|
+
--as <same_identity> \
|
|
211
|
+
--url "<share_doc.url>" \
|
|
212
|
+
--comment-id "<comment_focus.comment_id>" \
|
|
213
|
+
--page-size 100 \
|
|
214
|
+
--page-token "<returned_page_token>" \
|
|
215
|
+
--format json
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
第一页 `items[0]` 才是根评论;后续页的 `items[0]` 是普通回复。按页原序累积,直到页级 `has_more=false`。如果 `has_more=true` 但 `page_token` 为空、与已用 token 重复、API/权限失败或 comment ID 改变,立即停止并标记为 `partial`;保留已经取得的内容和原始标识,不循环、不重复根评论、不声称完整。
|
|
219
|
+
|
|
220
|
+
#### 章节定位
|
|
221
|
+
|
|
222
|
+
结构化消费直接读取当前 `section_location` item。pretty timeline 会按 `parent_titles` 原序追加 `title`,trim 后丢弃空段,并以 ` > ` 连接;多个 section item 分别展示,不选择其中一个覆盖事件级标量;标题全空时不生成 pretty 条目,只保留 raw。该路径是本地展示派生,不写回 JSON/NDJSON,也不需要或允许为它新增 API 查询。
|
|
223
|
+
|
|
224
|
+
#### 元素预览:显式白名单
|
|
225
|
+
|
|
226
|
+
只有用户或上层 Agent 明确要求预览,并且 item 命中下表时才执行。两个命令都会写入 `--output`,因此输出路径必须由本次调用显式选择;不得默认覆盖已有文件。
|
|
227
|
+
|
|
228
|
+
| action | element_type | token 条件 | 精确命令 |
|
|
229
|
+
| --- | --- | --- | --- |
|
|
230
|
+
| `open` | `image` | `element_token` 非空 | `lark-cli docs +media-preview --as <same_identity> --token "<element_token>" --output "<explicit-path>"` |
|
|
231
|
+
| `open` | `whiteboard` | `element_token` 非空 | `lark-cli docs +media-download --as <same_identity> --type whiteboard --token "<element_token>" --output "<explicit-path>"` |
|
|
232
|
+
| `close` | `image`/`whiteboard` | 任意 | 零调用;pretty 只记录预览关闭 |
|
|
233
|
+
| 未知 | 任意 | 任意 | 零调用;不生成 pretty 条目,只保留 raw |
|
|
234
|
+
| `open` | 未知/空 | 任意 | 零调用;禁止把原值透传到 `--type` |
|
|
235
|
+
| `open` | `image`/`whiteboard` | token 为空 | 零调用;保留 `block_id/element_type/action` 并提示缺 token |
|
|
236
|
+
|
|
237
|
+
#### 失败恢复
|
|
238
|
+
|
|
239
|
+
- parser 遇到未知字段、歧义 one-of 或单 item 缺字段:保留整个事件 `payload`、`event_id/event_type/event_time` 和可用 sibling;该 item 不生成 pretty 条目,也不合成通用描述。
|
|
240
|
+
- `share_id` 缺失、映射未命中或 `share_doc` 冲突:回显 `share_id`、可用的 `share_doc.url/title` 与 `comment_id`;必要时重新拉取完整事件流,仍无法关联则停止,不用最近一次共享兜底。
|
|
241
|
+
- `share_doc` 无法解析:回显 `share_id`、`share_doc.url/title` 与 `comment_id`,提示需要有效文档 URL 或已确认的 `file_token/file_type`;不要猜 type。
|
|
242
|
+
- Drive API/权限失败:保留精确 batch-query 命令与 `comment_id`,根据 CLI 的 `missing_scopes/hint` 恢复权限后重试;不要扫描全部评论。
|
|
243
|
+
- Docs 预览失败:保留 `action/element_type/element_token/block_id` 和用户选择的输出路径,修复权限或 token 后重试同一白名单命令;不要让 `meeting-events` 自动下载兜底。
|
|
244
|
+
- 未知 context/type/action:保留 raw 并说明当前 CLI 没有安全路由;不得自动调用 overwrite、download 或任何猜测的 shortcut。
|
|
245
|
+
|
|
246
|
+
### 8. 关于 `page_token` 的返回与续拉
|
|
147
247
|
|
|
148
248
|
- 不管这次是只查 1 页,还是通过 `--page-all` 已经把当前可见事件都拿完,都应把最后拿到的 `page_token` 一并保留下来并返回给用户。
|
|
149
249
|
- 只要响应里出现 `has_more=true`、pretty 里出现 `more available`,或返回了非空 `page_token`,就必须先判断当前结果是否完整;默认情况下,这意味着你还需要继续分页。
|
|
@@ -160,7 +260,7 @@ lark-cli vc +meeting-events --as user --meeting-id <id> --page-all --format pret
|
|
|
160
260
|
|------|------|
|
|
161
261
|
| `meeting` | 会议身份与时间状态,包含 `id/topic/meeting_no/start_time/end_time/status` |
|
|
162
262
|
| `identity` | 当前读取身份,包含 `id/name/participant_type/label` |
|
|
163
|
-
| `events` |
|
|
263
|
+
| `events` | 结构化事件列表;每条事件沿用 `event_id/event_type/event_time/actors/payload` 公共 envelope,事件专属数据保留在 `payload` |
|
|
164
264
|
| `warnings` | 非阻断告警列表;事件列表本身仍可使用 |
|
|
165
265
|
| `has_more` | 是否还有下一页 |
|
|
166
266
|
| `page_token` | 下一页游标 |
|
|
@@ -175,6 +275,7 @@ lark-cli vc +meeting-events --as user --meeting-id <id> --page-all --format pret
|
|
|
175
275
|
| `transcript_received` | 收到转写文本 |
|
|
176
276
|
| `magic_share_started` | 开始共享内容 / 文档 |
|
|
177
277
|
| `magic_share_ended` | 结束共享 |
|
|
278
|
+
| `document_context_changed` | 评论聚焦、章节定位或元素预览上下文变化 |
|
|
178
279
|
|
|
179
280
|
### Forwarding meeting chat and reactions to IM
|
|
180
281
|
|
|
@@ -304,12 +405,12 @@ lark-cli vc +meeting-events \
|
|
|
304
405
|
|
|
305
406
|
## 参考
|
|
306
407
|
|
|
307
|
-
- [lark-vc-agent-meeting-join](lark-vc-agent-meeting-join.md) — 先真实入会
|
|
308
|
-
- [lark-vc-
|
|
309
|
-
- [lark-vc-agent-meeting-leave](lark-vc-agent-meeting-leave.md) — 用户明确要求时离会
|
|
310
|
-
- [lark-vc-search](
|
|
311
|
-
- [lark-vc-recording](
|
|
312
|
-
- [lark-vc-detail](
|
|
313
|
-
- [lark-vc-agent](
|
|
314
|
-
- [lark-vc](
|
|
408
|
+
- [lark-vc-agent-meeting-join](../../lark-vc-agent/references/lark-vc-agent-meeting-join.md) — 先真实入会
|
|
409
|
+
- [lark-vc-meeting-list-active](lark-vc-meeting-list-active.md) — 发现当前可读事件的进行中会议 ID
|
|
410
|
+
- [lark-vc-agent-meeting-leave](../../lark-vc-agent/references/lark-vc-agent-meeting-leave.md) — 用户明确要求时离会
|
|
411
|
+
- [lark-vc-search](lark-vc-search.md) — 搜索历史会议(获取 meeting_id)
|
|
412
|
+
- [lark-vc-recording](lark-vc-recording.md) — 查询 minute_token
|
|
413
|
+
- [lark-vc-detail](lark-vc-detail.md) — 获取会议详情
|
|
414
|
+
- [lark-vc-agent](../../lark-vc-agent/SKILL.md) — Agent 参会能力
|
|
415
|
+
- [lark-vc](../SKILL.md) — 视频会议原子域(Meeting / Note 等核心概念)
|
|
315
416
|
- [lark-shared](../../lark-shared/SKILL.md) — 认证和全局参数
|
|
@@ -87,5 +87,5 @@ lark-cli vc +meeting-list-active --as bot --user-id <user_open_id> --format json
|
|
|
87
87
|
|
|
88
88
|
## 参考
|
|
89
89
|
|
|
90
|
-
- [lark-vc-agent-meeting-join](lark-vc-agent-meeting-join.md) — 让应用机器人真实入会并拿 `meeting.id`
|
|
91
|
-
- [lark-vc-
|
|
90
|
+
- [lark-vc-agent-meeting-join](../../lark-vc-agent/references/lark-vc-agent-meeting-join.md) — 让应用机器人真实入会并拿 `meeting.id`
|
|
91
|
+
- [lark-vc-meeting-events](lark-vc-meeting-events.md) — 使用 `meeting_id` 读取会中事件
|
|
@@ -129,6 +129,6 @@ VC_CanNotSee, VC_NoSound, VC_LooksGood, VC_SoundsClear
|
|
|
129
129
|
|
|
130
130
|
## 相关
|
|
131
131
|
|
|
132
|
-
- [lark-vc-
|
|
133
|
-
- [lark-vc-
|
|
134
|
-
- [lark-vc-agent-meeting-join](lark-vc-agent-meeting-join.md) — 应用机器人入会
|
|
132
|
+
- [lark-vc-meeting-list-active](lark-vc-meeting-list-active.md) — 发现当前进行中会议 ID
|
|
133
|
+
- [lark-vc-meeting-events](lark-vc-meeting-events.md) — 读取会中事件
|
|
134
|
+
- [lark-vc-agent-meeting-join](../../lark-vc-agent/references/lark-vc-agent-meeting-join.md) — 应用机器人入会
|
|
@@ -40,9 +40,11 @@ lark-cli vc +recording --meeting-ids 69xxxxxxxxxxxxx28 --dry-run
|
|
|
40
40
|
|
|
41
41
|
每次只能指定一种输入方式。同时传入会报错。
|
|
42
42
|
|
|
43
|
-
### 2.
|
|
43
|
+
### 2. 身份支持
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
`--meeting-ids` 和 `--calendar-event-ids` 两种模式都支持 `--as user` 和 `--as bot`。user token 只能查自己有权限的录制;bot 使用 tenant_access_token,只能查 bot 有权限的录制。
|
|
46
|
+
|
|
47
|
+
拿到的 `minute_token` 是在某个身份下解析出来的:下一步传给 `minutes minutes get` / `minutes +detail` / `minutes +download` 时必须显式沿用同一个 `--as`,不要省略让身份被 profile 默认值悄悄换掉(完整规则见 [lark-shared](../../lark-shared/SKILL.md) 的「身份延续」)。
|
|
46
48
|
|
|
47
49
|
### 3. 批量上限
|
|
48
50
|
|
|
@@ -78,10 +80,10 @@ lark-cli vc +recording --meeting-ids 69xxxxxxxxxxxxx28 --dry-run
|
|
|
78
80
|
|
|
79
81
|
```bash
|
|
80
82
|
# 第 1 步:通过 meeting_id 查询录制,拿到 minute_token
|
|
81
|
-
lark-cli vc +recording --meeting-ids xxx
|
|
83
|
+
lark-cli vc +recording --meeting-ids xxx --as bot
|
|
82
84
|
|
|
83
|
-
# 第 2 步:使用上一步返回的 minute_token
|
|
84
|
-
lark-cli minutes +download --minute-tokens
|
|
85
|
+
# 第 2 步:使用上一步返回的 minute_token 下载妙记文件,沿用第 1 步的身份
|
|
86
|
+
lark-cli minutes +download --minute-tokens obcnxxxxxxxxxxxxxxxxxxxx --as bot
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
### 场景 2:知道 meeting_id,想查询妙记基础信息
|
|
@@ -136,7 +138,7 @@ lark-cli minutes +download --minute-tokens <minute_token>
|
|
|
136
138
|
| `no recording available` | 该会议无录制或录制未完成 | 确认会议已结束且开启了录制 |
|
|
137
139
|
| `121005 no permission` | 无权查看该会议录制 | 确认是会议参与者或有录制权限 |
|
|
138
140
|
| `124002 recording generating` | 录制文件仍在生成中 | 等待录制完成后重试 |
|
|
139
|
-
| `missing required scope(s)` | 权限不足 |
|
|
141
|
+
| `missing required scope(s)` | 权限不足 | `--as user`:按提示运行 `auth login --scope`;`--as bot`:使用错误中的 `console_url` 去开发者后台开通,**禁止**对 bot 执行 `auth login`(见 [lark-shared](../../lark-shared/SKILL.md) 的权限恢复表) |
|
|
140
142
|
|
|
141
143
|
## 提示
|
|
142
144
|
|
|
@@ -99,6 +99,8 @@ lark-cli vc +search --start "<YYYY-MM-DD>" --end "<YYYY-MM-DD>" --format json
|
|
|
99
99
|
|
|
100
100
|
#### Step 2: 根据 meeting_id 查询产物
|
|
101
101
|
|
|
102
|
+
> **身份延续**:`vc +detail` 支持 `--as user` / `--as bot`。用哪个身份取到 `note_id` / `minute_token`,Step 2、Step 3 后续每一条命令(`note +detail`、`minutes +detail`、`docs +fetch`)都要显式带上**同一个** `--as`;不要省略让身份被 profile 默认值悄悄换掉。完整规则见 [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 的「身份延续」。
|
|
103
|
+
|
|
102
104
|
##### 获取会议产物
|
|
103
105
|
|
|
104
106
|
当用户提供 `meeting_id` 并需要会议产物时,先用 `vc +detail` 拿到 `note_id` 和 `minute_token`:
|
|
@@ -111,7 +113,7 @@ lark-cli vc +detail --meeting-ids '<meeting_id1>,<meeting_id2>'
|
|
|
111
113
|
|
|
112
114
|
**优先路径:通过 `note_id` 获取纪要产物**
|
|
113
115
|
|
|
114
|
-
如果用户未明确要求使用妙记,且返回了 `note_id`,**优先**使用 `note +detail` 获取纪要文档的 token
|
|
116
|
+
如果用户未明确要求使用妙记,且返回了 `note_id`,**优先**使用 `note +detail` 获取纪要文档的 token 信息(沿用上一步的 `--as`):
|
|
115
117
|
|
|
116
118
|
```bash
|
|
117
119
|
lark-cli note +detail --note-id <note_id>
|
|
@@ -149,6 +151,9 @@ lark-cli docs +fetch --doc <note_doc_token> --doc-format markdown
|
|
|
149
151
|
lark-cli docs +fetch --doc <verbatim_doc_token> --doc-format markdown
|
|
150
152
|
|
|
151
153
|
# note_display_type=unified:逐字稿不是独立文档,按 note_id 拉取
|
|
154
|
+
# ⚠️ note +transcript 目前仅支持 --as user;如果上面的 note_id 是通过 --as bot
|
|
155
|
+
# 拿到的,在这一步停下来向用户说明"该纪要逐字稿只能以 user 身份读取",
|
|
156
|
+
# 只有用户明确同意才切到 --as user,不要静默切换身份重试
|
|
152
157
|
lark-cli note +transcript --note-id <note_id>
|
|
153
158
|
```
|
|
154
159
|
|
|
@@ -32,8 +32,8 @@ metadata:
|
|
|
32
32
|
|
|
33
33
|
本 skill 与 [`lark-vc`](../lark-vc/SKILL.md) 并列:
|
|
34
34
|
|
|
35
|
-
- **`lark-vc`**
|
|
36
|
-
- **`lark-vc-agent`**
|
|
35
|
+
- **`lark-vc`** **负责会议查询和共享会中能力**:发现进行中会议、读取事件、发送消息,以及搜索历史会议、查询参会人快照和会议产物
|
|
36
|
+
- **`lark-vc-agent`** **负责应用机器人会中编排**:真实入会 / 离会,并复用上述共享能力读取事件或发送消息
|
|
37
37
|
|
|
38
38
|
按此分工路由,避免两个 skill 语义混淆。
|
|
39
39
|
|
|
@@ -87,7 +87,22 @@ metadata:
|
|
|
87
87
|
10. **只要你是基于** **`+meeting-events`** **来回答一场正在进行中的会议内容,就不能直接复用旧结果。** 无论用户是在问“现在/刚刚/最新”的状态,还是让你“总结一下这个会议讲什么”,都必须先重新拉一次当前事件流,确认拿到的是最新信息,再基于最新结果回答。只有在用户明确要求基于某次历史快照继续分析时,才可以复用旧结果。
|
|
88
88
|
11. **会中聊天 / 互动转发到 IM 时基于 JSON 事件构造 IM post。** `chat_received_items[].message_type == 3` 表示会中 reaction;构造 IM post 时,先用 [`lark-im` reaction emoji 白名单](../lark-im/references/lark-im-reactions.md) 判断同一 item 的 `content`:白名单内才写成 Feishu post `emotion` 节点,不在白名单内则保留原始 key 并写成文本节点,例如 `[CanNotSee]`。普通聊天按文本发送。不要从 pretty/Markdown 重新拼消息,也不要把整条消息退化成纯文本;只降级非法 reaction key。用户已说“发给我 / 推送给我 / 发到我的单聊”时,默认用 bot 身份直接发当前用户;收件人不明确时只补问收件人。
|
|
89
89
|
12. 用户直接问“这个会议讲了什么 / 现在讲到哪了”且上下文没有明确 `meeting_id` 时,先用用户身份发现当前会议;如果用户明确要求应用机器人视角,或上下文已经是应用机器人参会流程,再用应用身份发现。若返回多个会议,展示候选并让用户选择。
|
|
90
|
-
13.
|
|
90
|
+
13. 默认用户身份路径未发现当前会议时,改用 [`lark-vc`](../lark-vc/SKILL.md) 的 `+search` 查询当天最近结束的会议;仍无结果时询问会议时间、主题或会议号,不自行扩大时间范围。应用机器人视角未发现当前会议时,按当前身份解释空结果,不自动查询历史会议或真实入会。
|
|
91
|
+
14. 用户直接提供 **9 位会议号** 并询问会中事件/会议内容时,默认把它当作 active meeting 的筛选条件:先按当前身份查 active meetings,并在返回里匹配 `meeting_no == <9位会议号>`;匹配到唯一会议后取长数字 `meeting_id`,再用同一身份查事件。只有用户明确要求“入会 / 让应用机器人旁听 / 代我参会”时才改用 `+meeting-join`。
|
|
92
|
+
|
|
93
|
+
#### 文档上下文事件
|
|
94
|
+
|
|
95
|
+
`event_type == "document_context_changed"` 时,结构化消费按 `payload.document_context_changed_items` 原序读取;CLI pretty timeline 与其他事件一致,按 item `time` 排序。每个 item 只接受一个 `comment_focus`、`section_location` 或 `element_preview`;零个、多个、字段缺失或未知值不生成 pretty 条目,但保留事件 `payload` 和原标识,不猜字段别名。
|
|
96
|
+
|
|
97
|
+
| context | 消费规则 |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `comment_focus` | 先按完整事件流中的 `magic_share_started/ended` 维护 `share_id -> share_doc` 共享会话映射,再用当前 item 的 `share_id` 精确关联文档;禁止退化为“最近一次共享”猜测。`document_context_changed` item 自带的 `share_doc` 当前不提供文档信息,只保留在 raw payload,不作为解析来源。仅当 `focused=true`、单个 `comment_id` 和由开始共享事件解析出的有效文档 URL 均存在时,用 `drive +batch-query-comments` 精确查询该 ID;严格匹配、回复分页与失败终止条件见 reference。`focused=false` 表示清除焦点,零评论调用。 |
|
|
100
|
+
| `section_location` | 从当前 item 的 `parent_titles/title` 按原序派生 pretty timeline 中的章节路径;JSON/NDJSON 继续只保留原始 payload,不新增事件顶层 `section_path`。不得根据 `level` 反转、截断或补造路径,也不调用文档 API。 |
|
|
101
|
+
| `element_preview` | 只有用户明确要求预览且 `action=open` 时路由:`element_type=image` 使用 `docs +media-preview --token <element_token> --output <用户选择路径>`;`element_type=whiteboard` 使用 `docs +media-download --type whiteboard --token <element_token> --output <用户选择路径>`。`close`、未知 type/action、缺 token 或无明确预览意图均零调用;禁止把未知 `element_type` 透传给 `--type`,禁止自动选择覆盖路径。 |
|
|
102
|
+
|
|
103
|
+
`vc +meeting-events` 始终只读,不因评论或元素上下文自动调用 Drive/Docs,也不写文件。`share_id` 无法关联、评论 API/权限失败或 reply 游标为空/重复时,明确标记结果为未解析或 partial,并保留 `share_id`、`share_doc`、`comment_id`、`element_token`、`block_id` 和 raw payload,给出可重试的精确命令;不要用“最近一次共享”、全量评论扫描或自动下载兜底。完整命令与终止条件见 [`+meeting-events` reference](../lark-vc/references/lark-vc-meeting-events.md#文档上下文事件消费)。
|
|
104
|
+
|
|
105
|
+
JSON/NDJSON 的单事件 envelope 始终只使用既有 `event_id/event_type/event_time/actors/payload` 字段;不得为 `document_context_changed` 单独增加顶层 `summary/section_path` 或新的 `derived` 层。结构化消费从 `payload.document_context_changed_items[]` 读取,pretty 仅作可读派生展示。
|
|
91
106
|
|
|
92
107
|
### 3. 发送会中文本或会中表情(写操作)
|
|
93
108
|
|
|
@@ -164,15 +179,15 @@ Shortcut 是对常用操作的高级封装(`lark-cli vc +<verb> [flags]`)。
|
|
|
164
179
|
| Shortcut | 类型 | 说明 |
|
|
165
180
|
| --------------------------------------------------------------- | -- | -------------------------------------------------------------------------- |
|
|
166
181
|
| [`+meeting-join`](references/lark-vc-agent-meeting-join.md) | 写 | Join an in-progress meeting by 9-digit meeting number |
|
|
167
|
-
| [`+meeting-list-active`](references/lark-vc-
|
|
168
|
-
| [`+meeting-events`](references/lark-vc-
|
|
169
|
-
| [`+meeting-message-send`](references/lark-vc-
|
|
182
|
+
| [`+meeting-list-active`](../lark-vc/references/lark-vc-meeting-list-active.md) | 读 | List active meetings and discover meeting_id for event reads |
|
|
183
|
+
| [`+meeting-events`](../lark-vc/references/lark-vc-meeting-events.md) | 读 | List meeting events visible to the current identity (participant, transcript, chat, share, document context) |
|
|
184
|
+
| [`+meeting-message-send`](../lark-vc/references/lark-vc-meeting-message-send.md) | 写 | Send an in-meeting text message or reaction emoji |
|
|
170
185
|
| [`+meeting-leave`](references/lark-vc-agent-meeting-leave.md) | 写 | Leave a meeting by meeting\_id |
|
|
171
186
|
|
|
172
187
|
- [`+meeting-join`](references/lark-vc-agent-meeting-join.md):入参格式、写操作可见性风险、入会失败排查。
|
|
173
|
-
- [`+meeting-list-active`](references/lark-vc-
|
|
174
|
-
- [`+meeting-events`](references/lark-vc-
|
|
175
|
-
- [`+meeting-message-send`](references/lark-vc-
|
|
188
|
+
- [`+meeting-list-active`](../lark-vc/references/lark-vc-meeting-list-active.md):用户身份和应用身份的不同返回范围。
|
|
189
|
+
- [`+meeting-events`](../lark-vc/references/lark-vc-meeting-events.md):`meeting_id` 来源、身份延续、分页和错误码(10005 / 20001 / 20002)。
|
|
190
|
+
- [`+meeting-message-send`](../lark-vc/references/lark-vc-meeting-message-send.md):会中文本、完整 `emoji_type` 列表、身份延续和写操作风险。
|
|
176
191
|
- [`+meeting-leave`](references/lark-vc-agent-meeting-leave.md):`meeting_id` 的来源与写操作可见性。
|
|
177
192
|
|
|
178
193
|
## 应用身份权限配置检查
|
|
@@ -131,8 +131,8 @@ lark-cli vc +detail --meeting-ids <meeting.id>
|
|
|
131
131
|
## 参考
|
|
132
132
|
|
|
133
133
|
- [lark-vc-agent-meeting-leave](lark-vc-agent-meeting-leave.md) — 对应的离会命令
|
|
134
|
-
- [lark-vc-
|
|
135
|
-
- [lark-vc-
|
|
134
|
+
- [lark-vc-meeting-list-active](../../lark-vc/references/lark-vc-meeting-list-active.md) — 发现当前可读事件的进行中会议 ID
|
|
135
|
+
- [lark-vc-meeting-events](../../lark-vc/references/lark-vc-meeting-events.md) — 会中事件流
|
|
136
136
|
- [lark-vc-search](../../lark-vc/references/lark-vc-search.md) — 搜索历史会议记录
|
|
137
137
|
- [lark-vc-recording](../../lark-vc/references/lark-vc-recording.md) — 查询 minute_token
|
|
138
138
|
- [lark-vc-detail](../../lark-vc/references/lark-vc-detail.md) — 获取会议详情
|
|
@@ -95,8 +95,8 @@ lark-cli vc +detail --meeting-ids <meeting.id>
|
|
|
95
95
|
## 参考
|
|
96
96
|
|
|
97
97
|
- [lark-vc-agent-meeting-join](lark-vc-agent-meeting-join.md) — 对应的入会命令
|
|
98
|
-
- [lark-vc-
|
|
99
|
-
- [lark-vc-
|
|
98
|
+
- [lark-vc-meeting-list-active](../../lark-vc/references/lark-vc-meeting-list-active.md) — 发现当前可读事件的进行中会议 ID
|
|
99
|
+
- [lark-vc-meeting-events](../../lark-vc/references/lark-vc-meeting-events.md) — 会中事件流
|
|
100
100
|
- [lark-vc-search](../../lark-vc/references/lark-vc-search.md) — 搜索历史会议(获取 meeting_id)
|
|
101
101
|
- [lark-vc-recording](../../lark-vc/references/lark-vc-recording.md) — 查询 minute_token
|
|
102
102
|
- [lark-vc-detail](../../lark-vc/references/lark-vc-detail.md) — 获取会议详情
|
|
@@ -78,7 +78,7 @@ lark-cli wiki +node-create \
|
|
|
78
78
|
| `--parent-node-token` | 否 | 父知识库节点 token;传入后会在该节点下创建新节点 |
|
|
79
79
|
| `--title` | 否 | 节点标题 |
|
|
80
80
|
| `--node-type` | 否 | 节点类型,默认 `origin`;可选值:`origin`、`shortcut` |
|
|
81
|
-
| `--obj-type` | 否 | 节点对应对象类型,默认 `docx`;可选值:`sheet`、`mindnote`、`bitable`、`docx`、`slides` |
|
|
81
|
+
| `--obj-type` | 否 | 节点对应对象类型,默认 `docx`;可选值:`sheet`、`mindnote`、`bitable`、`file`、`docx`、`slides`。`file` 仅支持 `shortcut` 节点 |
|
|
82
82
|
| `--origin-node-token` | 否 | 当 `--node-type=shortcut` 时必填,表示快捷方式指向的源节点 token |
|
|
83
83
|
|
|
84
84
|
## 空间解析规则
|
|
@@ -89,11 +89,27 @@ lark-cli wiki +node-create \
|
|
|
89
89
|
- **个人知识库回退**:`user` 身份下,如果 `--space-id` 和 `--parent-node-token` 都没传,会自动解析 `my_library`
|
|
90
90
|
- **bot 身份限制**:`bot` 身份既没有“个人知识库”回退语义,也不支持显式传 `--space-id my_library`;请改用真实 `space_id` 或 `--parent-node-token`
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## 节点类型与对象类型
|
|
93
|
+
|
|
94
|
+
| `node_type` | 支持的 `obj_type` |
|
|
95
|
+
|-------------|-------------------|
|
|
96
|
+
| `origin` | `sheet`、`mindnote`、`bitable`、`docx`、`slides` |
|
|
97
|
+
| `shortcut` | `sheet`、`mindnote`、`bitable`、`file`、`docx`、`slides` |
|
|
93
98
|
|
|
94
99
|
- `--node-type=shortcut` 时,必须同时提供 `--origin-node-token`
|
|
95
100
|
- `--node-type=origin` 时,不能传 `--origin-node-token`
|
|
101
|
+
- `--obj-type=file` 仅支持 `--node-type=shortcut`;实体节点不支持创建 `file` 类型
|
|
96
102
|
- `shortcut` 节点只是知识库中的快捷方式入口;真正被引用的节点由 `--origin-node-token` 指定
|
|
103
|
+
- 如果 `+node-create` 因上述组合返回参数校验错误,禁止改用 raw `wiki nodes create` 或直接调用 OpenAPI 绕过校验;应修正 `node_type`、`obj_type` 或 `origin_node_token`
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# 创建一个指向文件的快捷方式节点
|
|
107
|
+
lark-cli wiki +node-create \
|
|
108
|
+
--space-id <SPACE_ID> \
|
|
109
|
+
--node-type shortcut \
|
|
110
|
+
--obj-type file \
|
|
111
|
+
--origin-node-token <ORIGIN_NODE_TOKEN>
|
|
112
|
+
```
|
|
97
113
|
|
|
98
114
|
## 一致性校验
|
|
99
115
|
|
|
@@ -111,6 +127,7 @@ lark-cli wiki +node-create \
|
|
|
111
127
|
- 同时需要 `my_library` 和父节点时:会展示三步调用链
|
|
112
128
|
- **bot 自动授权**:若使用 `--as bot`,结果还会额外带上 `permission_grant`,用于说明是否已自动为当前 CLI 用户授予新建节点的可管理权限
|
|
113
129
|
- **输出结果**:成功后会返回 `resolved_space_id`、`resolved_by`、`node_token`、`obj_token`、`obj_type`、`node_type`、`title` 等字段,便于后续继续操作
|
|
130
|
+
- **结构限制**:返回 `131003` 表示触发了知识空间总节点数、目录深度或单个父节点直属子节点数等结构限制。这不是瞬时错误,禁止使用相同参数重试。根据上游错误信息选择更浅或其他父节点、重新组织现有节点,或清理/改用其他知识空间;不要在无法确认具体限制时盲目增加中间层级。
|
|
114
131
|
|
|
115
132
|
## 推荐场景
|
|
116
133
|
|
|
@@ -52,6 +52,17 @@ lark-cli wiki +node-get \
|
|
|
52
52
|
- `creator` falls back to `creator` when `node_creator` is absent. `updated_at` is `obj_edit_time` formatted as RFC3339.
|
|
53
53
|
- No `url` is returned: `get_node` does not provide one and a synthesized `www.feishu.cn/wiki/<node_token>` link is non-canonical/misleading for a read command. Use `node_token` / `obj_token` as the identifiers.
|
|
54
54
|
|
|
55
|
+
## Terminal business errors
|
|
56
|
+
|
|
57
|
+
These HTTP 200 responses carry a non-zero business code and are not retryable with the same input:
|
|
58
|
+
|
|
59
|
+
| Code | Meaning | Required action |
|
|
60
|
+
|------|---------|-----------------|
|
|
61
|
+
| `131006` | The current user or app/bot identity lacks access to the Wiki node or space | This is resource access, not app scope authorization. Do not retry the same request, reauthorize, or switch identity as trial and error; ask the node owner or wiki administrator to grant read access, or use an accessible resource |
|
|
62
|
+
| `131012` | The Wiki node has been deleted | Do not retry the same node token; rediscover the node or ask for a current Wiki link |
|
|
63
|
+
| `131013` | The resource token is invalid | Do not switch identity or reauthorize; correct the URL/token |
|
|
64
|
+
| `131014` | The document is not mounted in Wiki | Stop Wiki resolution; use the corresponding docs/sheets/base/drive command, or provide a Wiki URL/node_token |
|
|
65
|
+
|
|
55
66
|
## Required Scope
|
|
56
67
|
|
|
57
68
|
`wiki:node:retrieve`
|
|
@@ -87,7 +87,7 @@ lark-cli wiki +node-list --space-id 6946843325487912356 --parent-node-token wikc
|
|
|
87
87
|
- `--space-id my_library` is a per-user alias and only valid with `--as user`. The shortcut will refuse `--as bot` with `my_library` upfront.
|
|
88
88
|
- `--space-id` is a numeric wiki `space_id`. Do not pass a wiki URL, wiki node token, document token, or title. Use `lark-cli wiki +space-list --as user` to discover it.
|
|
89
89
|
- `--parent-node-token` must resolve to a wiki node token. If you have a docx/sheet/base/file URL, first run `lark-cli wiki +node-get --node-token <url>` and use the returned `node_token`.
|
|
90
|
-
- Treat `invalid_parameters` (`space_id is not int`, `invalid page_token`), `not_found` (`node not found by parent node token`), and `permission_denied` as terminal for the current arguments.
|
|
90
|
+
- Treat `invalid_parameters` (`space_id is not int`, `invalid page_token`), `not_found` (`node not found by parent node token`), and `permission_denied` as terminal for the current arguments. For `131006 permission_denied`, the user or app/bot identity lacks access to the target space or parent node; this is resource access, not app scope authorization. Do not retry the same request, reauthorize, or switch identity as trial and error. Ask the resource owner or wiki administrator to grant read access, or use an accessible resource.
|
|
91
91
|
- For `rate_limit`, stop immediate retries and retry later with exponential backoff or a smaller `--page-limit`.
|
|
92
92
|
|
|
93
93
|
## Required Scope
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# slides +replace-pages(单页或多页整页重建)
|
|
2
|
-
|
|
3
|
-
替换已有演示文稿里的一页或多页,保持原 `xml_presentation_id` 和原 Slides 链接不变。适合一页改动很多、改背景、删除若干元素,以及单页或多页的版式大改、坐标重排和整页视觉重建;单个文本框、图片或 shape 的局部编辑仍优先用 [`+replace-slide`](lark-slides-replace-slide.md)。
|
|
4
|
-
|
|
5
|
-
> **灰度期间的重要兼容说明**:当前命令的 `--help` 及输出中的 `deprecated` 字段会提示改用 `+update-slide`,但该提示依赖尚未全量的 Slide Engine 后端能力。在本参考页随 skill 发布期间,必须忽略该提示并继续使用 `+replace-pages`,不得切换到 `+update-slide`。后端全量并由新版 skill 恢复路由后,再使用 `+update-slide`。
|
|
6
|
-
|
|
7
|
-
> 重要:这是多步编排,不是后端原子事务。CLI 对每页执行“先创建新页到旧页前,再删除旧页”;创建失败时旧页会保留。删除失败时可能出现新旧页同时存在,需要按返回结果继续处理。
|
|
8
|
-
|
|
9
|
-
## 命令
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
lark-cli slides +replace-pages \
|
|
13
|
-
--as user \
|
|
14
|
-
--presentation <slides_url_or_xml_presentation_id> \
|
|
15
|
-
--pages @pages.json
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## 参数
|
|
19
|
-
|
|
20
|
-
| 参数 | 必需 | 说明 |
|
|
21
|
-
|------|------|------|
|
|
22
|
-
| `--presentation` | 是 | `xml_presentation_id`、`/slides/` URL 或 `/wiki/` URL |
|
|
23
|
-
| `--pages` | 是 | JSON 数组,每项包含 `slide_id` 和 `content`;支持 literal、`@file`、stdin `-` |
|
|
24
|
-
| `--dry-run` | 否 | 基于 `slide_id` 输入输出替换计划,不执行 create/delete |
|
|
25
|
-
| `--continue-on-error` | 否 | 默认失败即停;开启后继续处理后续页,并在结果中标记失败项 |
|
|
26
|
-
| `--validate-only` | 否 | 只校验输入并生成替换计划,不执行 Slides get/create/delete |
|
|
27
|
-
|
|
28
|
-
## pages.json
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
[
|
|
32
|
-
{
|
|
33
|
-
"slide_id": "slide_short_id_1",
|
|
34
|
-
"content": "<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"slide_id": "slide_short_id_2",
|
|
38
|
-
"content": "<slide xmlns=\"https://www.larkoffice.com/sml/2.0\"><data></data></slide>"
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
规则:
|
|
44
|
-
|
|
45
|
-
- 每项必须提供 `slide_id`;不支持 `slide_number`。
|
|
46
|
-
- `content` 必须是完整 `<slide>...</slide>` XML。
|
|
47
|
-
- 同一批次不能重复 `slide_id`。
|
|
48
|
-
- CLI 不会回读整份 presentation;如果 `slide_id` 已失效,create/delete 阶段会返回对应错误。
|
|
49
|
-
|
|
50
|
-
## Dry Run
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
lark-cli slides +replace-pages --as user \
|
|
54
|
-
--presentation "$PID" \
|
|
55
|
-
--pages @pages.json \
|
|
56
|
-
--dry-run
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
输出包含 `xml_presentation_id`、`pages_count`、`plan`,以及每页的 `old_slide_id`、`insert_before_slide_id` 和动作 `create_before_then_delete_old`。Dry-run 只基于输入的 `slide_id` 构造计划,不会调用 `xml_presentations.get`,也不会执行 create/delete。
|
|
60
|
-
|
|
61
|
-
## 成功输出
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"xml_presentation_id": "xxx",
|
|
66
|
-
"pages_count": 2,
|
|
67
|
-
"status": "completed",
|
|
68
|
-
"summary": {
|
|
69
|
-
"replaced": 2,
|
|
70
|
-
"failed": 0,
|
|
71
|
-
"total": 2
|
|
72
|
-
},
|
|
73
|
-
"results": [
|
|
74
|
-
{
|
|
75
|
-
"old_slide_id": "old3",
|
|
76
|
-
"new_slide_id": "new3",
|
|
77
|
-
"status": "replaced"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"revision_id": 123
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
如果使用 `--continue-on-error` 且任一页面失败,CLI 会继续处理后续页,但最终以 partial failure 非零退出;stdout 仍保留完整 `results`,顶层 `ok` 为 `false`,`status` 为 `partial_failure`。
|
|
85
|
-
|
|
86
|
-
`status` 可能为:
|
|
87
|
-
|
|
88
|
-
- `replaced`:新页创建成功,旧页删除成功。
|
|
89
|
-
- `create_failed`:新页创建失败,旧页保留。
|
|
90
|
-
- `delete_failed`:新页已创建,但旧页删除失败。
|
|
91
|
-
|
|
92
|
-
## 使用建议
|
|
93
|
-
|
|
94
|
-
1. 大幅改写前先 `slides +xml-get` 保存当前 XML,并记录要替换页面的 `slide_id`。
|
|
95
|
-
2. 生成只含 `slide_id` 的 `pages.json` 后先跑 `--dry-run` 或 `--validate-only`。
|
|
96
|
-
3. 默认不要开 `--continue-on-error`,除非能接受部分页面已替换。
|
|
97
|
-
4. 替换后再回读全文 XML 并截图检查,确认页序、视觉和文本没有破损。
|