@amaster.ai/pi-lark 0.1.2-beta.55 → 0.1.2-beta.56
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 +166 -155
- 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-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 +18 -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
|
@@ -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
|
|
|
@@ -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 并截图检查,确认页序、视觉和文本没有破损。
|