@amaster.ai/pi-lark 0.1.2-beta.40 → 0.1.2-beta.41
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 +10 -0
- package/skills/lark-apps/references/lark-apps-db-execute.md +1 -1
- package/skills/lark-apps/references/lark-apps-db.md +2 -2
- package/skills/lark-calendar/SKILL.md +89 -31
- package/skills/lark-calendar/references/lark-calendar-create.md +7 -39
- package/skills/lark-calendar/references/lark-calendar-room-find.md +5 -9
- package/skills/lark-calendar/references/lark-calendar-rsvp.md +1 -5
- package/skills/lark-calendar/references/lark-calendar-schedule-clear-time.md +59 -0
- package/skills/lark-calendar/references/lark-calendar-schedule-fuzzy-time.md +88 -0
- package/skills/lark-calendar/references/lark-calendar-schedule-meeting.md +67 -210
- package/skills/lark-calendar/references/lark-calendar-suggestion.md +1 -5
- package/skills/lark-calendar/references/lark-calendar-update.md +2 -7
- package/skills/lark-doc/SKILL.md +1 -1
- package/skills/lark-doc/references/lark-doc-fetch.md +4 -2
- package/skills/lark-doc/references/lark-doc-mindnote.md +17 -2
- package/skills/lark-doc/references/lark-doc-whiteboard.md +4 -0
- package/skills/lark-doc/references/lark-doc-xml-extended-blocks.md +34 -0
- package/skills/lark-doc/references/lark-doc-xml.md +3 -2
- package/skills/lark-drive/SKILL.md +7 -3
- package/skills/lark-drive/references/lark-drive-delete.md +12 -0
- package/skills/lark-drive/references/lark-drive-files-list.md +27 -2
- package/skills/lark-drive/references/lark-drive-inspect.md +2 -0
- package/skills/lark-drive/references/lark-drive-permission-guide.md +12 -0
- package/skills/lark-drive/references/lark-drive-push.md +32 -5
- package/skills/lark-drive/references/lark-drive-workflow-knowledge-organize.md +26 -20
- package/skills/lark-drive/references/lark-drive-workflow.md +2 -1
- package/skills/lark-mail/SKILL.md +12 -9
- package/skills/lark-mail/references/lark-mail-forward.md +1 -1
- package/skills/lark-mail/references/lark-mail-message-modify.md +48 -0
- package/skills/lark-mail/references/lark-mail-message-trash.md +41 -0
- package/skills/lark-mail/references/lark-mail-reply-all.md +1 -1
- package/skills/lark-mail/references/lark-mail-reply.md +1 -1
- package/skills/lark-mail/references/lark-mail-watch.md +1 -1
- package/skills/lark-markdown/SKILL.md +3 -2
- package/skills/lark-markdown/references/lark-markdown-create.md +22 -2
- package/skills/lark-minutes/references/lark-minutes-download.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-search.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-speaker-replace.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-summary.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-todo.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-update.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-upload.md +10 -10
- package/skills/lark-shared/SKILL.md +18 -0
- package/skills/lark-slides/references/asset-planning.md +16 -4
- package/skills/lark-slides/references/lark-slides-whiteboard.md +31 -30
- package/skills/lark-slides/references/planning-layer.md +31 -1
- package/skills/lark-slides/references/slides_chart_demo.xml +1 -0
- package/skills/lark-slides/references/slides_xml_schema_definition.xml +1 -1
- package/skills/lark-slides/references/xml-format-guide.md +50 -1
- package/skills/lark-slides/references/xml-schema-quick-ref.md +1 -1
- package/skills/lark-task/references/lark-task-create.md +14 -1
- package/skills/lark-vc/references/lark-vc-recording.md +0 -2
- package/skills/lark-vc-agent/SKILL.md +13 -10
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md +64 -36
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-list-active.md +7 -7
- package/skills/lark-whiteboard/references/lark-whiteboard-workflow.md +5 -2
- package/skills/lark-wiki/SKILL.md +4 -2
- package/skills/lark-wiki/references/lark-wiki-node-get.md +1 -1
- package/skills/lark-wiki/references/lark-wiki-node-list.md +9 -2
- package/skills/lark-calendar/references/lark-calendar-agenda.md +0 -78
- package/skills/lark-calendar/references/lark-calendar-freebusy.md +0 -124
- package/skills/lark-calendar/references/lark-calendar-search-event.md +0 -29
|
@@ -41,12 +41,37 @@ lark-cli drive files list \
|
|
|
41
41
|
|
|
42
42
|
也可以省略 `folder_token` 字段来请求根目录,但在 Agent 编排中建议显式传空字符串,避免把“忘记传参数”和“确认请求根目录”混在一起。
|
|
43
43
|
|
|
44
|
+
## 按时间排序
|
|
45
|
+
|
|
46
|
+
默认不要传 `order_by` / `direction`;服务端会按默认顺序返回。只有用户明确要求按创建时间或编辑时间排序时,才使用服务端排序参数。
|
|
47
|
+
|
|
48
|
+
按创建时间升序列出当前文件夹直接子项:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
lark-cli drive files list \
|
|
52
|
+
--params '{"folder_token":"<folder_token>","order_by":"CreatedTime","direction":"ASC","page_size":200}' \
|
|
53
|
+
--format json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
按编辑时间降序列出当前文件夹直接子项:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
lark-cli drive files list \
|
|
60
|
+
--params '{"folder_token":"<folder_token>","order_by":"EditedTime","direction":"DESC","page_size":200}' \
|
|
61
|
+
--format json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
以上示例返回排序后的当前页;如果返回 `has_more=true`,保持相同 `folder_token` / `order_by` / `direction` / `page_size`,把 `next_page_token` 放入 `page_token` 继续翻页。
|
|
65
|
+
|
|
44
66
|
## 参数规则
|
|
45
67
|
|
|
46
68
|
1. `folder_token` 必须放在 `--params` JSON 里;不要使用不存在的 `--folder-token` flag。
|
|
47
69
|
2. `page_token` 必须放在 `--params` JSON 里;不要依赖 shell 变量拼接不完整的 JSON。
|
|
48
|
-
3. `
|
|
49
|
-
4.
|
|
70
|
+
3. 默认不要传 `order_by` / `direction`;只有用户明确要求按创建时间 / 编辑时间排序时才使用服务端排序参数。
|
|
71
|
+
4. 排序参数映射:创建时间 -> `order_by:"CreatedTime"`;编辑时间 / 修改时间 -> `order_by:"EditedTime"`;升序 -> `direction:"ASC"`;降序 -> `direction:"DESC"`。不要省略排序参数后再用 Python / shell 客户端排序替代。
|
|
72
|
+
5. 排序查询建议带 `page_size:200` 减少翻页;只有用户要求完整分页、递归盘点、大目录全量导出,或当前页返回 `has_more=true` 后继续翻页时,才加入 `page_token`。
|
|
73
|
+
6. `page_size` 在分页、递归盘点或全量导出时建议显式设置为 `200`。如果服务端或环境返回参数错误,再降级到服务端允许的值,并记录降级原因。
|
|
74
|
+
7. 调用前如果不确定字段结构,先运行 `lark-cli schema drive.files.list` 查看 `--params` 结构。
|
|
50
75
|
|
|
51
76
|
## 返回结构与解析
|
|
52
77
|
|
|
@@ -47,4 +47,6 @@ JSON 输出包含以下字段:
|
|
|
47
47
|
- `--url` 为必填参数
|
|
48
48
|
- 当 `--url` 是 bare token(非完整 URL)时,`--type` 也是必填的
|
|
49
49
|
- wiki URL 会自动调用 `get_node` API 解包,输出中 `type` 和 `token` 是底层文档的类型和 token
|
|
50
|
+
- `+inspect` 只用于识别/消歧;如果任务已能通过 URL 路径形态完成路由判断,不必把它作为所有 Drive 操作的通用前置步骤
|
|
51
|
+
- `+inspect` 失败后不要自动切到写接口继续尝试,先按错误提示处理权限、scope 或链接问题
|
|
50
52
|
- 支持 `--dry-run` 查看将调用的 API 步骤
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
如果用户只是想向文档 owner 申请访问权限,优先使用 [`lark-drive-apply-permission.md`](lark-drive-apply-permission.md)。
|
|
12
12
|
|
|
13
|
+
## 公开权限修改前门槛
|
|
14
|
+
|
|
15
|
+
公开权限修改是高风险写操作。执行 `drive permission.public patch --yes` 前同时确认:
|
|
16
|
+
|
|
17
|
+
| 条件 | 可执行信号 |
|
|
18
|
+
|------|------------|
|
|
19
|
+
| 具体目标 | 单个 URL/token,或用户确认过的资源列表 |
|
|
20
|
+
| 公开范围 | 用户明确选择组织内/互联网、可读/可编辑等具体 `link_share_entity` 档位 |
|
|
21
|
+
| 执行确认 | 用户在本轮确认按该目标和范围执行 |
|
|
22
|
+
|
|
23
|
+
“开放一下”“共享给大家”“让大家能看”只表达目标状态,不包含具体公开范围。先列出可选范围并停止等待用户选择;公开档位必须来自用户选择,CLI 的 `--yes` 只表示已获得用户对该档位的执行确认。
|
|
24
|
+
|
|
13
25
|
## 公开权限错误码
|
|
14
26
|
|
|
15
27
|
调用 `lark-cli drive permission.public patch` 更新文档公开权限失败时,如果返回以下错误码,按表格给用户明确下一步。不要把这些错误简单归类为缺少 scope;它们通常表示租户、对外分享或文档密级策略拦截。
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
| `summary.skipped` | 因 `--if-exists=skip` 或 `--if-exists=smart` 命中“无需传输”而跳过的文件数 |
|
|
16
16
|
| `summary.failed` | 上传 / 覆盖 / 建目录 / 删除失败的条目数;**只要不为 0,命令就以非零状态退出**(结构化 `items[]` 仍在 stdout 上) |
|
|
17
17
|
| `summary.deleted_remote` | 启用 `--delete-remote --yes` 时删除的云端文件数 |
|
|
18
|
-
| `
|
|
18
|
+
| `summary.aborted` | 命中终止性错误并停止后续批处理时为 `true` |
|
|
19
|
+
| `items[]` | 每个条目的明细(`rel_path` / `file_token` / `action` / 覆盖时的 `version` / `size_bytes` / 失败时的 `error` / `hint` / `phase` / `error_class` / `code` / `subtype` / `retryable`) |
|
|
19
20
|
|
|
20
|
-
`items[].action` 取值:`uploaded` / `overwritten` / `skipped` / `folder_created` / `deleted_remote` / `failed` / `delete_failed`。
|
|
21
|
+
`items[].action` 取值:`uploaded` / `overwritten` / `skipped` / `folder_created` / `deleted_remote` / `already_deleted` / `failed` / `delete_failed`。
|
|
21
22
|
|
|
22
23
|
> 本地目录(包括空目录)会被镜像到 Drive;新建的子目录会以 `action: "folder_created"` 出现在 `items[]` 里,但**不计入** `summary.uploaded`(该字段只数文件)。已存在的远端目录复用其 token,不会重复 `create_folder`,也不会出现在 `items[]` 里。
|
|
23
24
|
|
|
@@ -95,6 +96,7 @@ lark-cli drive +push --local-dir ./repo --folder-token fldcnxxxxxxxxx \
|
|
|
95
96
|
- `--delete-remote`(无 `--yes`)→ Validate 直接报错:`--delete-remote requires --yes`,不会发起任何列表 / 上传 / 删除请求。
|
|
96
97
|
- `--delete-remote --yes` → Validate 阶段还会**动态做一次** `space:document:delete` 的 scope 预检:缺这条 scope 时整次运行立刻失败、不发任何上传请求,避免出现"上传都成功了,但删除阶段才报 missing_scope"的半同步状态。
|
|
97
98
|
- `--delete-remote --yes`(且 scope 已授权)→ 正常执行:先把本地文件 push 上去,再扫一遍远端 `type=file` 列表,把不在本地清单里的逐个删除。**任何上传 / 覆盖 / 建目录失败时,整段 `--delete-remote` 阶段会被跳过**(stderr 上有提示),命令以非零状态退出,远端不会被破坏。
|
|
99
|
+
- 删除阶段如果服务端返回 `1061007 file has been delete`,说明目标远端文件在本次 DELETE 前已经不存在;这已经满足 `--delete-remote` 的目标状态,输出会记为 `action: "already_deleted"`,不计入 `summary.failed`,也不计入 `summary.deleted_remote`。
|
|
98
100
|
- 远端同名冲突且使用默认 `fail`,或冲突里混有 folder / 其他非 `type=file` 对象 → 在上传阶段前失败,删除阶段不会运行。
|
|
99
101
|
- 不传 `--delete-remote` → `summary.deleted_remote` 永远是 0;命令对远端"多余"文件视而不见。
|
|
100
102
|
- 在线文档(docx / sheet / bitable / ...)和快捷方式即使本地完全没有同名文件,也**不会**进入删除候选,因为它们从来不进 `summary.uploaded` 的对齐域。
|
|
@@ -110,22 +112,47 @@ lark-cli drive +push --local-dir ./repo --folder-token fldcnxxxxxxxxx \
|
|
|
110
112
|
"uploaded": 0,
|
|
111
113
|
"skipped": 0,
|
|
112
114
|
"failed": 0,
|
|
113
|
-
"deleted_remote": 0
|
|
115
|
+
"deleted_remote": 0,
|
|
116
|
+
"aborted": false
|
|
114
117
|
},
|
|
115
118
|
"items": [
|
|
116
119
|
{"rel_path": "...", "file_token": "...", "action": "folder_created"},
|
|
117
120
|
{"rel_path": "...", "file_token": "...", "action": "uploaded", "size_bytes": 0},
|
|
118
121
|
{"rel_path": "...", "file_token": "...", "action": "overwritten", "version": "...", "size_bytes": 0},
|
|
119
122
|
{"rel_path": "...", "file_token": "...", "action": "skipped", "size_bytes": 0},
|
|
120
|
-
{"rel_path": "...", "action": "failed", "size_bytes": 0, "error": "..."},
|
|
123
|
+
{"rel_path": "...", "action": "failed", "size_bytes": 0, "error": "...", "hint": "...", "phase": "upload", "error_class": "...", "code": 0, "subtype": "...", "retryable": false},
|
|
121
124
|
{"rel_path": "...", "file_token": "...", "action": "deleted_remote"},
|
|
122
|
-
{"rel_path": "...", "file_token": "...", "action": "
|
|
125
|
+
{"rel_path": "...", "file_token": "...", "action": "already_deleted"},
|
|
126
|
+
{"rel_path": "...", "file_token": "...", "action": "delete_failed", "error": "...", "hint": "...", "phase": "delete", "error_class": "...", "code": 0, "subtype": "...", "retryable": false}
|
|
123
127
|
]
|
|
124
128
|
}
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
`rel_path` 始终用 `/` 作为分隔符(跨平台一致)。
|
|
128
132
|
|
|
133
|
+
## 失败处理与 agent 行为
|
|
134
|
+
|
|
135
|
+
`+push` 的失败项带结构化字段,agent 必须优先读 `items[].error_class` / `phase` / `code`,不要只看自然语言 `error` 文本。`summary.aborted=true` 表示命令已经遇到终止性错误并停止后续批处理;这时**不要原样重试**,先修复根因。
|
|
136
|
+
|
|
137
|
+
常见终止性错误:
|
|
138
|
+
|
|
139
|
+
| `error_class` | 常见 `code` | 含义 | Agent 应对 |
|
|
140
|
+
|---|---:|---|---|
|
|
141
|
+
| `app_scope_missing` | `99991672` | 应用身份缺少 Drive / 文件夹相关 scope | 停止重试,引导开通错误里列出的应用身份权限,例如 `space:folder:create` 或 `drive:drive` |
|
|
142
|
+
| `user_scope_missing` | `99991679` | 用户身份缺少授权 | 停止重试,走 `lark-cli auth login --scope ...` 补错误里列出的 scope |
|
|
143
|
+
| `permission_denied` | `1061004` / HTTP 403 | 当前身份无权操作目标资源 | 停止重试,检查目标文件夹权限、身份类型(user / bot)和资源可见性 |
|
|
144
|
+
| `invalid_api_parameters` | `1061002` | API 参数被服务端拒绝 | 停止重试,检查 `--folder-token`、覆盖模式、`file_token`、文件名和上传参数;不要对同一参数组合批量重试 |
|
|
145
|
+
| `parent_node_missing` | `1061044` | 上传 / 建目录使用的父文件夹不存在或当前身份不可见 | 停止重试,检查 `--folder-token` 是否仍存在、是否有权限、父目录是否在 push 过程中被删除;不要继续上传同一目录树 |
|
|
146
|
+
| `parent_sibling_limit` | `1062507` | 目标父文件夹单层子节点数量超过上限 | 停止重试,清理目标目录、换一个 `--folder-token`,或把上传内容拆到多个子目录 |
|
|
147
|
+
| `rate_limited` | `99991400` | 触发频控 | 停止当前批次,退避后再重试 |
|
|
148
|
+
| `server_error` | `1061001` / `2200` | Drive 服务端异常 | 停止当前批次,稍后重试;保留 `log_id` 便于排查 |
|
|
149
|
+
|
|
150
|
+
非终止但需要解释的状态:
|
|
151
|
+
|
|
152
|
+
- `file_size_limit` / `1061043`:文件超过 Drive 上传限制。不要继续尝试同一文件;改拆分或换存储方式。
|
|
153
|
+
- `upload_size_mismatch` / `1062009`:本地文件在上传过程中发生变化,或声明大小与实际读取大小不一致。重新扫描本地文件后再 push。
|
|
154
|
+
- `remote_not_found` / `1061007`:一般表示远端文件已不存在。删除阶段的 `1061007` 会被视为 `already_deleted` 成功项;其他阶段需重新列表确认远端状态。
|
|
155
|
+
|
|
129
156
|
## 性能注意
|
|
130
157
|
|
|
131
158
|
- 默认 `skip` 下,已存在的远端文件一律不碰;`overwrite` 下,重复跑会重传所有命中的同名文件;`smart` 下会按 `modified_time` 跳过已对齐的远端文件,但对“远端更旧”的文件仍会进入覆盖路径,因此它减少的是**不必要的重传**,不是把覆盖风险完全拿掉。
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# 知识整理工作流
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Workflow id: `knowledge_organize`
|
|
4
|
+
|
|
5
|
+
Risk / Structure: `R2-R3` / `S3`
|
|
6
|
+
|
|
7
|
+
This file implements the registered knowledge organization workflow. Before execution, the agent MUST read [`lark-drive-workflow.md`](lark-drive-workflow.md) and [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md), and follow the shared execution protocol, Artifact Contract, Workflow Loading rules, authentication rules, and write confirmation rules.
|
|
8
|
+
|
|
9
|
+
It defines the workflow-specific state machine and progressive loading map. Stage-specific rules live in phase files and MUST be loaded only when the workflow reaches the corresponding state.
|
|
4
10
|
|
|
5
11
|
Phase files are references for this workflow, not independent skills. Do not route user requests directly to a phase file.
|
|
6
12
|
|
|
@@ -80,7 +86,7 @@ When this workflow is triggered, the agent MUST:
|
|
|
80
86
|
|
|
81
87
|
## Runtime State
|
|
82
88
|
|
|
83
|
-
Agent MUST maintain these internal fields during one workflow run:
|
|
89
|
+
This workflow extends the shared Artifact Contract. Agent MUST maintain these internal fields during one workflow run:
|
|
84
90
|
|
|
85
91
|
| Field | Meaning |
|
|
86
92
|
|-------|---------|
|
|
@@ -114,24 +120,24 @@ Agent MUST maintain these internal fields during one workflow run:
|
|
|
114
120
|
|
|
115
121
|
## Execution State Machine
|
|
116
122
|
|
|
117
|
-
| State | Entry Condition | Agent MUST Do | User-Facing Output | wait_for_user | Next State |
|
|
118
|
-
|
|
119
|
-
| `PARSE_SCOPE` | Workflow triggered | Load discovery phase; parse target, environment, identity, and target type | Scope confirmation or clarification question | `true` | `INVENTORY` |
|
|
120
|
-
| `INVENTORY` | Scope confirmed | Load discovery phase; recursively list resources and build `resource_items` | Inventory progress / summary; continue automatically unless blocked | `false` unless blocked | `CONTENT_READ` |
|
|
121
|
-
| `CONTENT_READ` | Inventory complete | Load analysis phase; identify low-confidence items and perform mandatory partial read when needed | Low-confidence read summary | `false` unless auth / permission blocks | `ISSUE_ANALYSIS` |
|
|
122
|
-
| `ISSUE_ANALYSIS` | Resource list and partial reads ready | Load analysis phase; detect structure problems, evidence, and organization approach | Inventory result, problems, organization approach, and decision options | `true` | `RULE_GENERATION` |
|
|
123
|
-
| `RULE_GENERATION` | User confirms organization approach | Load analysis phase; generate classification rules and `target_tree` | No separate stop; target tree is shown with plan generation | `false` | `PLAN_GENERATION` |
|
|
124
|
-
| `PLAN_GENERATION` | Target tree ready | Load planning phase; generate complete internal `plan_items`; show target tree plus plan overview or page | Target tree and plan overview / paginated plan page | `true` | `EXEC_CONFIRM` |
|
|
125
|
-
| `EXEC_CONFIRM` | User wants execution | Load planning phase; ask user to choose execution scope | Execution options and write-operation summary | `true` | `EXECUTE` or `DONE` |
|
|
126
|
-
| `EXECUTE` | User explicitly confirmed execution scope | Load execution phase; execute only whitelisted write operations for confirmed scope while maintaining internal recovery state | Progress reports for large or long-running execution; if blocked after successful moves, ask whether to try restoring to `整理前的位置` | `false` unless blocked / recovery offered | `VERIFY`, `ROLLBACK_CONFIRM`, or `DONE` |
|
|
127
|
-
| `VERIFY` | Execution finished | Load execution phase; rescan target scope and compare actual path/token against plan | Verification table and final summary; if serious mismatches exist, ask whether to try restoring to `整理前的位置` | `false` unless recovery offered | `DONE` or `ROLLBACK_CONFIRM` |
|
|
128
|
-
| `ROLLBACK_CONFIRM` | User asks to restore after execution failure / verification mismatch / explicit rollback request | Load rollback phase; generate internal `rollback_plan`; ask whether to execute recovery | Recoverable scope and restore confirmation | `true` | `ROLLBACK` or `DONE` |
|
|
129
|
-
| `ROLLBACK` | User explicitly confirms restore execution | Load rollback phase; execute confirmed reverse moves only | Recovery progress / result | `false` | `ROLLBACK_VERIFY` |
|
|
130
|
-
| `ROLLBACK_VERIFY` | Recovery execution finished | Load rollback phase; verify restored locations and decide whether cleanup candidates exist | Recovery verification result | `false` | `ROLLBACK_CLEANUP_CONFIRM` or `DONE` |
|
|
131
|
-
| `ROLLBACK_CLEANUP_CONFIRM` | Cleanup candidates exist after recovery, or user asks to clean workflow-created empty folders / nodes | Load rollback phase; generate cleanup plan and ask for delete confirmation | Cleanup candidates and delete confirmation | `true` | `ROLLBACK_CLEANUP` or `DONE` |
|
|
132
|
-
| `ROLLBACK_CLEANUP` | User explicitly confirms cleanup deletion | Load rollback phase; delete only confirmed workflow-created safe-empty folders / nodes | Cleanup progress / result | `false` | `ROLLBACK_CLEANUP_VERIFY` |
|
|
133
|
-
| `ROLLBACK_CLEANUP_VERIFY` | Cleanup deletion finished | Load rollback phase; verify deleted cleanup targets | Cleanup verification result | `false` | `DONE` |
|
|
134
|
-
| `DONE` | No more action | Stop | Final answer | `false` | End |
|
|
123
|
+
| State | Protocol Step | Entry Condition | Agent MUST Do | User-Facing Output | wait_for_user | Next State |
|
|
124
|
+
|-------|---------------|-----------------|---------------|--------------------|---------------|------------|
|
|
125
|
+
| `PARSE_SCOPE` | `route` / `scope` | Workflow triggered | Load discovery phase; parse target, environment, identity, and target type | Scope confirmation or clarification question | `true` | `INVENTORY` |
|
|
126
|
+
| `INVENTORY` | `read` | Scope confirmed | Load discovery phase; recursively list resources and build `resource_items` | Inventory progress / summary; continue automatically unless blocked | `false` unless blocked | `CONTENT_READ` |
|
|
127
|
+
| `CONTENT_READ` | `read` | Inventory complete | Load analysis phase; identify low-confidence items and perform mandatory partial read when needed | Low-confidence read summary | `false` unless auth / permission blocks | `ISSUE_ANALYSIS` |
|
|
128
|
+
| `ISSUE_ANALYSIS` | `assess` / `plan` | Resource list and partial reads ready | Load analysis phase; detect structure problems, evidence, and organization approach | Inventory result, problems, organization approach, and decision options | `true` | `RULE_GENERATION` |
|
|
129
|
+
| `RULE_GENERATION` | `assess` / `plan` | User confirms organization approach | Load analysis phase; generate classification rules and `target_tree` | No separate stop; target tree is shown with plan generation | `false` | `PLAN_GENERATION` |
|
|
130
|
+
| `PLAN_GENERATION` | `assess` / `plan` | Target tree ready | Load planning phase; generate complete internal `plan_items`; show target tree plus plan overview or page | Target tree and plan overview / paginated plan page | `true` | `EXEC_CONFIRM` |
|
|
131
|
+
| `EXEC_CONFIRM` | `confirm` | User wants execution | Load planning phase; ask user to choose execution scope | Execution options and write-operation summary | `true` | `EXECUTE` or `DONE` |
|
|
132
|
+
| `EXECUTE` | `execute` | User explicitly confirmed execution scope | Load execution phase; execute only whitelisted write operations for confirmed scope while maintaining internal recovery state | Progress reports for large or long-running execution; if blocked after successful moves, ask whether to try restoring to `整理前的位置` | `false` unless blocked / recovery offered | `VERIFY`, `ROLLBACK_CONFIRM`, or `DONE` |
|
|
133
|
+
| `VERIFY` | `verify` | Execution finished | Load execution phase; rescan target scope and compare actual path/token against plan | Verification table and final summary; if serious mismatches exist, ask whether to try restoring to `整理前的位置` | `false` unless recovery offered | `DONE` or `ROLLBACK_CONFIRM` |
|
|
134
|
+
| `ROLLBACK_CONFIRM` | `recovery confirm` | User asks to restore after execution failure / verification mismatch / explicit rollback request | Load rollback phase; generate internal `rollback_plan`; ask whether to execute recovery | Recoverable scope and restore confirmation | `true` | `ROLLBACK` or `DONE` |
|
|
135
|
+
| `ROLLBACK` | `recovery execute` | User explicitly confirms restore execution | Load rollback phase; execute confirmed reverse moves only | Recovery progress / result | `false` | `ROLLBACK_VERIFY` |
|
|
136
|
+
| `ROLLBACK_VERIFY` | `recovery verify` | Recovery execution finished | Load rollback phase; verify restored locations and decide whether cleanup candidates exist | Recovery verification result | `false` | `ROLLBACK_CLEANUP_CONFIRM` or `DONE` |
|
|
137
|
+
| `ROLLBACK_CLEANUP_CONFIRM` | `cleanup confirm` | Cleanup candidates exist after recovery, or user asks to clean workflow-created empty folders / nodes | Load rollback phase; generate cleanup plan and ask for delete confirmation | Cleanup candidates and delete confirmation | `true` | `ROLLBACK_CLEANUP` or `DONE` |
|
|
138
|
+
| `ROLLBACK_CLEANUP` | `cleanup execute` | User explicitly confirms cleanup deletion | Load rollback phase; delete only confirmed workflow-created safe-empty folders / nodes | Cleanup progress / result | `false` | `ROLLBACK_CLEANUP_VERIFY` |
|
|
139
|
+
| `ROLLBACK_CLEANUP_VERIFY` | `cleanup verify` | Cleanup deletion finished | Load rollback phase; verify deleted cleanup targets | Cleanup verification result | `false` | `DONE` |
|
|
140
|
+
| `DONE` | `done` | No more action | Stop | Final answer | `false` | End |
|
|
135
141
|
|
|
136
142
|
## Progressive Load Map
|
|
137
143
|
|
|
@@ -97,7 +97,7 @@ Structure Level:
|
|
|
97
97
|
2. Entry file 超过约 300 行时,优先拆 `commands`、`outputs` 或 `artifacts` reference。
|
|
98
98
|
3. 只有执行、验证、恢复或 rollback 状态链复杂到影响可读性时,才升级到 `S3` phase files。
|
|
99
99
|
4. 垂直业务包优先作为已有 workflow 的 recipe / policy / template,不默认新增独立 workflow。
|
|
100
|
-
5. 已有样板:`permission_governance` 是 `R2/S2
|
|
100
|
+
5. 已有样板:`permission_governance` 是 `R2/S2`;`knowledge_organize` 是 `R2-R3/S3`。
|
|
101
101
|
|
|
102
102
|
## 加载与拆分边界
|
|
103
103
|
|
|
@@ -111,6 +111,7 @@ Structure Level:
|
|
|
111
111
|
| Workflow | Status | Risk | Structure | Entry File | Trigger |
|
|
112
112
|
|----------|--------|------|-----------|------------|---------|
|
|
113
113
|
| `permission_governance` | Registered | `R2` | `S2` | [`lark-drive-workflow-permission-governance.md`](lark-drive-workflow-permission-governance.md) | 权限审计、公开链接/外部访问、复制/下载/评论/分享设置、权限申请、owner 转移 / 批量 owner 转移、密级标签调整 |
|
|
114
|
+
| `knowledge_organize` | Registered | `R2-R3` | `S3` | [`lark-drive-workflow-knowledge-organize.md`](lark-drive-workflow-knowledge-organize.md) | 整理云盘 / 文件夹 / 文档库 / 知识库、盘点目录结构、归类资源、生成整理方案,并在用户确认后创建目录或移动资源 |
|
|
114
115
|
|
|
115
116
|
## Workflow Loading
|
|
116
117
|
|
|
@@ -79,7 +79,7 @@ metadata:
|
|
|
79
79
|
|
|
80
80
|
1. `+triage --from spam@x.com` → 列出 N 条结果
|
|
81
81
|
2. 展示:"将删除 N 封邮件(发件人 spam@x.com,主题:…),确认?"
|
|
82
|
-
3. 用户确认后 →
|
|
82
|
+
3. 用户确认后 → `+message-trash --message-ids ... --yes`
|
|
83
83
|
|
|
84
84
|
## 身份选择:优先使用 user 身份
|
|
85
85
|
|
|
@@ -96,13 +96,14 @@ metadata:
|
|
|
96
96
|
1. **确认身份** — 首次操作邮箱前先调用 `lark-cli mail user_mailboxes profile --params '{"user_mailbox_id":"me"}'` 获取当前用户的真实邮箱地址(`primary_email_address`),不要通过系统用户名猜测。后续判断"发件人是否为用户本人"时以此地址为准。
|
|
97
97
|
2. **浏览** — `+triage` 查看收件箱摘要,获取 `message_id` / `thread_id`
|
|
98
98
|
3. **阅读** — `+message` 只读单封邮件;已有多个 `message_id` 时用 `+messages` 批量读取,不要循环调用 `+message`;`+thread` 读整个会话
|
|
99
|
-
4.
|
|
100
|
-
5.
|
|
101
|
-
6.
|
|
102
|
-
7.
|
|
103
|
-
8.
|
|
104
|
-
9.
|
|
105
|
-
10.
|
|
99
|
+
4. **整理** — 标签、已读/未读状态和移动文件夹优先用 `+message-modify`;软删除优先用 `+message-trash`
|
|
100
|
+
5. **回复** — `+reply` / `+reply-all`(默认存草稿,加 `--confirm-send` 则立即发送)
|
|
101
|
+
6. **转发** — `+forward`(默认存草稿,加 `--confirm-send` 则立即发送)
|
|
102
|
+
7. **新邮件** — `+send` 存草稿(默认),加 `--confirm-send` 发送
|
|
103
|
+
8. **HTML body 预检(可选)** — 复杂 HTML body 提交前可先跑 `+lint-html` 看 lint 会改 / 删什么;写信路径(`+send` / `+draft-create` / `+reply` / `+reply-all` / `+forward` / `+draft-edit` body op)已内置 autofix,普通正文不必先跑。详见 [references/lark-mail-html.md](references/lark-mail-html.md) 中的「写入路径内置 HTML lint」章节
|
|
104
|
+
9. **确认投递** — 立即发送后用 `send_status` 查询投递状态,定时发送后在预定时间后再查询;取消定时发送用 `cancel_scheduled_send`
|
|
105
|
+
10. **编辑草稿** — `+draft-edit` 修改已有草稿。正文编辑通过 `--patch-file`:回复/转发草稿用 `set_reply_body` op 保留引用区,普通草稿用 `set_body` op
|
|
106
|
+
11. **已读回执** —
|
|
106
107
|
- **请求回执(写信侧)**:`--request-receipt` 仅在**用户显式要求**时添加,**不要从 subject / body 内容推断意图**。
|
|
107
108
|
- **响应回执(拉信侧)**:拉信看到 `label_ids` 含 `READ_RECEIPT_REQUEST`(或 `-607`)时,**必须先问用户**是否回执(不要自动回执,涉及隐私)。用户同意 → `+send-receipt` 响应;用户不同意但想消掉提示 → `+decline-receipt` 只清本地标签、不发邮件。
|
|
108
109
|
|
|
@@ -119,6 +120,8 @@ metadata:
|
|
|
119
120
|
- 查看发送邮件后的投递状态:发送成功后查看邮件投递状态;也覆盖发送拦截。ref: [lark-mail-send-status](references/lark-mail-send-status.md)
|
|
120
121
|
- 使用邮件模板:区分个人模板和静态 HTML 模板,发信类 shortcut 用 `--template-id` 套用模板。ref: [lark-mail-template](references/lark-mail-template.md)
|
|
121
122
|
- 撤回已发送邮件:撤回邮件并查询异步撤回状态。ref: [lark-mail-recall](references/lark-mail-recall.md)
|
|
123
|
+
- 修改邮件标签/已读状态/文件夹:优先使用 `+message-modify`。ref: [`+message-modify`](references/lark-mail-message-modify.md)
|
|
124
|
+
- 软删除邮件:优先使用 `+message-trash`。ref: [`+message-trash`](references/lark-mail-message-trash.md)
|
|
122
125
|
- 收信规则:创建、验证、删除自动处理收到邮件的规则。ref: [lark-mail-rules](references/lark-mail-rules.md)
|
|
123
126
|
- 分享邮件到 IM:分享邮件或会话到群聊、个人会话。ref: [lark-mail-share-to-chat](references/lark-mail-share-to-chat.md)
|
|
124
127
|
- 发送日程邀请邮件:在邮件中嵌入 `text/calendar` 日程邀请。ref: [lark-mail-calendar-invite](references/lark-mail-calendar-invite.md)
|
|
@@ -192,7 +195,7 @@ lark-cli mail +messages --message-ids <id1>,<id2>,<id3> --html=false
|
|
|
192
195
|
|
|
193
196
|
## 原生 API 调用规则
|
|
194
197
|
|
|
195
|
-
没有 Shortcut 覆盖的操作才使用原生 API
|
|
198
|
+
没有 Shortcut 覆盖的操作才使用原生 API。标签、已读状态、移动文件夹优先使用 `+message-modify`;软删除优先使用 `+message-trash`。调用步骤以本节为准;资源和 method 用 `lark-cli mail -h` / `lark-cli mail <resource> -h` 发现,不在入口保留完整资源表。
|
|
196
199
|
|
|
197
200
|
### Step 1 — 用 `-h` 确定要调用的 API(必须,不可跳过)
|
|
198
201
|
|
|
@@ -215,7 +215,7 @@ lark-cli mail user_mailbox.drafts cancel_scheduled_send --params '{"user_mailbox
|
|
|
215
215
|
**2. 标记已读**(可选)— 询问用户是否需要将原邮件标记为已读。如果用户同意:
|
|
216
216
|
|
|
217
217
|
```bash
|
|
218
|
-
lark-cli mail
|
|
218
|
+
lark-cli mail +message-modify --message-ids <原邮件ID> --remove-label-ids UNREAD
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
## 编辑转发草稿
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# mail +message-modify
|
|
2
|
+
|
|
3
|
+
`mail +message-modify` is the preferred shortcut for changing labels, read-state labels, or folder placement on existing messages.
|
|
4
|
+
|
|
5
|
+
Use it instead of raw `user_mailbox.messages batch_modify` when the operation targets concrete `message_id` values from `+triage`, `+message`, or `+messages`.
|
|
6
|
+
|
|
7
|
+
## Common Commands
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
lark-cli mail +message-modify --message-ids <id1>,<id2> --add-label-ids unread
|
|
11
|
+
lark-cli mail +message-modify --message-ids <id> --remove-label-ids FLAGGED
|
|
12
|
+
lark-cli mail +message-modify --message-ids <id> --add-folder archive
|
|
13
|
+
lark-cli mail +message-modify --mailbox shared@example.com --message-ids <id> --add-folder folder_xxx
|
|
14
|
+
lark-cli mail +message-modify --message-ids <id> --add-label-ids custom_label_id --dry-run
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Flags
|
|
18
|
+
|
|
19
|
+
| Flag | Required | Notes |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `--mailbox` | No | Mailbox that owns the messages. Defaults to `me`. |
|
|
22
|
+
| `--message-ids` | Yes | `string_array`; supports comma-separated values and repeated flags. |
|
|
23
|
+
| `--add-label-ids` | No | Adds labels. System labels `unread`, `important`, `other`, `flagged` normalize to upper case. |
|
|
24
|
+
| `--remove-label-ids` | No | Removes labels. Cannot overlap with `--add-label-ids`. |
|
|
25
|
+
| `--add-folder` | No | Moves to one folder. `inbox`, `sent`, `spam`, `archive`, `archived` normalize to system folder IDs. |
|
|
26
|
+
|
|
27
|
+
`TRASH` is intentionally rejected by this shortcut. Use `mail +message-trash --message-ids <id> --yes` for soft deletion.
|
|
28
|
+
|
|
29
|
+
## Behavior
|
|
30
|
+
|
|
31
|
+
- Message IDs are locally validated, de-duplicated in first-seen order, and sent in batches of 20.
|
|
32
|
+
- Custom label IDs are checked with `labels.get`; custom folder IDs are checked with `folders.get`.
|
|
33
|
+
- If no label or folder operation is requested, the command succeeds locally, emits all message IDs as `success_message_ids`, and makes no POST request.
|
|
34
|
+
- Single batch POST failures mark every message in that batch with the same failure reason; later batches still run.
|
|
35
|
+
- JSON output is intentionally compact:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"success_message_ids": ["id1"],
|
|
40
|
+
"failed_message_ids": [
|
|
41
|
+
{"message_id": "id2", "reason": "api error"}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## When Raw API Is Still Appropriate
|
|
47
|
+
|
|
48
|
+
Use raw `mail user_mailbox.messages batch_modify` only when you need a request shape that the shortcut intentionally does not expose, or when reproducing backend/API behavior exactly for diagnostics.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# mail +message-trash
|
|
2
|
+
|
|
3
|
+
`mail +message-trash` is the preferred shortcut for soft-deleting existing messages.
|
|
4
|
+
|
|
5
|
+
Use it after obtaining real `message_id` values from `+triage`, `+message`, or `+messages`, and after the user has confirmed the deletion preview.
|
|
6
|
+
|
|
7
|
+
## Common Commands
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
lark-cli mail +message-trash --message-ids <id1>,<id2> --yes
|
|
11
|
+
lark-cli mail +message-trash --mailbox shared@example.com --message-ids <id> --yes
|
|
12
|
+
lark-cli mail +message-trash --message-ids <id1> --message-ids <id2> --dry-run
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Flags
|
|
16
|
+
|
|
17
|
+
| Flag | Required | Notes |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `--mailbox` | No | Mailbox that owns the messages. Defaults to `me`. |
|
|
20
|
+
| `--message-ids` | Yes | `string_array`; supports comma-separated values and repeated flags. |
|
|
21
|
+
| `--yes` | Yes for execution | Required by the high-risk write confirmation framework. |
|
|
22
|
+
|
|
23
|
+
## Behavior
|
|
24
|
+
|
|
25
|
+
- Message IDs are locally validated, de-duplicated in first-seen order, and sent in batches of 20.
|
|
26
|
+
- The shortcut calls `POST /open-apis/mail/v1/user_mailboxes/<mailbox>/messages/batch_trash` sequentially.
|
|
27
|
+
- Single batch POST failures mark every message in that batch with the same failure reason; later batches still run.
|
|
28
|
+
- JSON output is intentionally compact:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"success_message_ids": ["id1"],
|
|
33
|
+
"failed_message_ids": [
|
|
34
|
+
{"message_id": "id2", "reason": "api error"}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## When Raw API Is Still Appropriate
|
|
40
|
+
|
|
41
|
+
Use raw `mail user_mailbox.messages batch_trash` only when reproducing backend/API behavior exactly for diagnostics. For normal soft deletion, prefer this shortcut because it handles validation, batching, compact output, and `--yes` confirmation consistently.
|
|
@@ -203,7 +203,7 @@ lark-cli mail user_mailbox.drafts cancel_scheduled_send --params '{"user_mailbox
|
|
|
203
203
|
**2. 标记已读**(可选)— 询问用户是否需要将原邮件标记为已读。如果用户同意:
|
|
204
204
|
|
|
205
205
|
```bash
|
|
206
|
-
lark-cli mail
|
|
206
|
+
lark-cli mail +message-modify --message-ids <原邮件ID> --remove-label-ids UNREAD
|
|
207
207
|
```
|
|
208
208
|
|
|
209
209
|
## 相关命令
|
|
@@ -218,7 +218,7 @@ lark-cli mail user_mailbox.drafts cancel_scheduled_send --params '{"user_mailbox
|
|
|
218
218
|
**2. 标记已读**(可选)— 询问用户是否需要将原邮件标记为已读。如果用户同意:
|
|
219
219
|
|
|
220
220
|
```bash
|
|
221
|
-
lark-cli mail
|
|
221
|
+
lark-cli mail +message-modify --message-ids <原邮件ID> --remove-label-ids UNREAD
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
## 编辑回复草稿
|
|
@@ -47,7 +47,7 @@ lark-cli mail +watch --print-output-schema
|
|
|
47
47
|
|------|------|------|
|
|
48
48
|
| `--mailbox <id>` | `me` | 订阅目标邮箱 |
|
|
49
49
|
| `--msg-format <mode>` | `metadata` | 输出模式:`metadata` / `minimal` / `plain_text_full` / `full` / `event` |
|
|
50
|
-
| `--format <mode>` | `
|
|
50
|
+
| `--format <mode>` | `data` | 输出样式:`json`(带 ok/data 信封的 NDJSON 流)/ `data`(裸 NDJSON 流) |
|
|
51
51
|
| `--folder-ids <json-array>` | — | 文件夹 ID 过滤,如 `["INBOX","SENT"]` |
|
|
52
52
|
| `--folders <json-array>` | — | 文件夹名称过滤(与 `--folder-ids` 取并集) |
|
|
53
53
|
| `--label-ids <json-array>` | — | 标签 ID 过滤,如 `["FLAGGED","IMPORTANT"]` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lark-markdown
|
|
3
|
-
version: 1.2.
|
|
3
|
+
version: 1.2.2
|
|
4
4
|
description: "飞书 Markdown:查看、创建、上传、编辑和比较 Markdown 文件。当用户需要创建或编辑 Markdown 文件、读取、修改、局部 patch 或比较差异时使用。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。"
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
@@ -25,7 +25,8 @@ metadata:
|
|
|
25
25
|
- 用户要先拿 Markdown 文件的历史版本号,再做比较/下载/回滚,先用 [`lark-drive`](../lark-drive/SKILL.md) 的 `lark-cli drive +version-history`
|
|
26
26
|
- 用户要把本地 Markdown **导入成在线新版文档(docx)**,不要用本 skill,改用 [`lark-drive`](../lark-drive/SKILL.md) 的 `lark-cli drive +import --type docx`
|
|
27
27
|
- 用户要对 Markdown 文件做**rename / move / delete / 搜索 / 权限 / 评论**等云空间(云盘/云存储)操作,不要留在本 skill,切到 [`lark-drive`](../lark-drive/SKILL.md)
|
|
28
|
-
- `markdown +create` / `+overwrite` 命中 `missing scope`、`permission denied`、`not found`、`version limit` 时,默认停止重试并按报错 hint 处理;只有 `
|
|
28
|
+
- `markdown +create` / `+overwrite` 命中 `missing scope`、`permission denied`、`not found`、`quota_exceeded`、`version limit` 时,默认停止重试并按报错 hint 处理;只有 `rate_limit`、`server_error` 或临时网络错误才做有限退避重试。
|
|
29
|
+
- `markdown +create` 的目标参数不要猜:Drive 文件夹用 `--folder-token`,Wiki 节点用 `--wiki-token`。如果用户给的是 URL,可以直接传完整 URL;CLI 会归一成 token。不要把 doc/sheet/wiki URL 放进 `--folder-token` 试错。
|
|
29
30
|
|
|
30
31
|
## 核心边界
|
|
31
32
|
|
|
@@ -32,11 +32,21 @@ lark-cli markdown +create \
|
|
|
32
32
|
--folder-token fldcn_xxx \
|
|
33
33
|
--file ./README.md
|
|
34
34
|
|
|
35
|
+
# 创建到指定文件夹(可直接传 Drive folder URL)
|
|
36
|
+
lark-cli markdown +create \
|
|
37
|
+
--folder-token "https://feishu.cn/drive/folder/fldcn_xxx" \
|
|
38
|
+
--file ./README.md
|
|
39
|
+
|
|
35
40
|
# 创建到指定 wiki 节点
|
|
36
41
|
lark-cli markdown +create \
|
|
37
42
|
--wiki-token wikcn_xxx \
|
|
38
43
|
--file ./README.md
|
|
39
44
|
|
|
45
|
+
# 创建到指定 wiki 节点(可直接传 wiki URL)
|
|
46
|
+
lark-cli markdown +create \
|
|
47
|
+
--wiki-token "https://feishu.cn/wiki/wikcn_xxx" \
|
|
48
|
+
--file ./README.md
|
|
49
|
+
|
|
40
50
|
# 预览底层请求
|
|
41
51
|
lark-cli markdown +create \
|
|
42
52
|
--name README.md \
|
|
@@ -48,8 +58,8 @@ lark-cli markdown +create \
|
|
|
48
58
|
|
|
49
59
|
| 参数 | 必填 | 说明 |
|
|
50
60
|
|------|------|------|
|
|
51
|
-
| `--folder-token` | 否 | 目标 Drive 文件夹 token;与 `--wiki-token` 互斥;省略时创建到根目录 |
|
|
52
|
-
| `--wiki-token` | 否 | 目标 wiki 节点 token;与 `--folder-token` 互斥;传入后自动映射为 `parent_type=wiki` |
|
|
61
|
+
| `--folder-token` | 否 | 目标 Drive 文件夹 token 或 Drive folder URL;与 `--wiki-token` 互斥;省略时创建到根目录 |
|
|
62
|
+
| `--wiki-token` | 否 | 目标 wiki 节点 token 或 wiki URL;与 `--folder-token` 互斥;传入后自动映射为 `parent_type=wiki` |
|
|
53
63
|
| `--name` | 条件必填 | 文件名,**必须显式带 `.md` 后缀**;使用 `--content` 时必填;使用 `--file` 时可省略,默认取本地文件名 |
|
|
54
64
|
| `--content` | 条件必填 | Markdown 内容;与 `--file` 互斥;支持直接传字符串、`@file`、`-`(stdin) |
|
|
55
65
|
| `--file` | 条件必填 | 本地 `.md` 文件路径;与 `--content` 互斥 |
|
|
@@ -58,6 +68,8 @@ lark-cli markdown +create \
|
|
|
58
68
|
|
|
59
69
|
- `--content` 与 `--file` 必须二选一
|
|
60
70
|
- `--folder-token` 与 `--wiki-token` 互斥
|
|
71
|
+
- `--folder-token` 只能是 Drive 文件夹;不要传 wiki/doc/sheet/base/file token 或 URL
|
|
72
|
+
- `--wiki-token` 只能是 Wiki 节点;如果只有 docx/sheet/base 等文档 URL,先用 `lark-cli wiki +node-get --node-token <url>` 解析出 `node_token`
|
|
61
73
|
- `--name` 必须带 `.md` 后缀
|
|
62
74
|
- `--file` 指向的本地文件名也必须带 `.md` 后缀
|
|
63
75
|
- 传 `--wiki-token` 时,返回值中不会附带 `/file/<token>` URL,因为 wiki 承载文件没有稳定的独立 file URL
|
|
@@ -88,6 +100,14 @@ lark-cli markdown +create \
|
|
|
88
100
|
>
|
|
89
101
|
> **不要擅自执行 owner 转移。** 如果用户需要把 owner 转给自己,必须单独确认。
|
|
90
102
|
|
|
103
|
+
## 失败处理
|
|
104
|
+
|
|
105
|
+
- `not_found` / `1061044`:父目录或 wiki 节点不存在,或 token 类型放错参数。修正 `--folder-token` / `--wiki-token` 后再试,不要重复提交同一参数。
|
|
106
|
+
- `quota_exceeded` / `1061101`:目标存储空间配额已满。释放空间、换父目录/节点或请管理员扩容后再试。
|
|
107
|
+
- `permission_denied` / `missing_scope`:区分身份处理。`--as user` 看用户授权和目标 ACL;`--as bot` 看应用 scope 与目标目录/节点 ACL。
|
|
108
|
+
- `rate_limit`:停止立即重试,使用退避。
|
|
109
|
+
- `server_error` / `233523001`:可以稍后有限重试;若重复出现,保留 `log_id` / request id 给服务端排查。
|
|
110
|
+
|
|
91
111
|
## 参考
|
|
92
112
|
|
|
93
113
|
- [lark-markdown](../SKILL.md) — Markdown 域总览
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
# minutes +download
|
|
3
3
|
|
|
4
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
5
4
|
|
|
6
5
|
下载妙记的音视频媒体文件到本地,或获取有效期 1 天的下载链接。只读操作。
|
|
7
6
|
|
|
@@ -134,4 +133,3 @@ API 限流 5 次/秒,批量下载时需注意控制频率。
|
|
|
134
133
|
|
|
135
134
|
- [lark-minutes](../SKILL.md) — 妙记全部命令
|
|
136
135
|
- [lark-minutes-detail](lark-minutes-detail.md) — 妙记详情与 AI 产物查询
|
|
137
|
-
- [lark-shared](../../lark-shared/SKILL.md) — 认证和全局参数
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# minutes +search
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
3
|
|
|
5
4
|
搜索妙记列表,支持关键词、所有者、参与者以及时间范围等多条件过滤。所有者与参与者都支持传入多个 open\_id,也支持传入 `me` 表示当前用户。只读操作,不修改任何妙记数据。
|
|
6
5
|
|
|
@@ -199,6 +198,5 @@ lark-cli minutes +detail --minute-tokens <minute_token> --summary
|
|
|
199
198
|
|
|
200
199
|
- [lark-minutes](../SKILL.md) -- 妙记相关命令
|
|
201
200
|
- [lark-minutes-detail](lark-minutes-detail.md) -- 基于 `minute_token` 获取逐字稿、总结、待办、章节等产物
|
|
202
|
-
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数
|
|
203
201
|
- [lark-vc](../../lark-vc/SKILL.md) -- 视频会议全部命令
|
|
204
202
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# minutes +speaker-replace
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
3
|
|
|
5
4
|
替换妙记逐字稿中的说话人身份:把妙记逐字稿里"原说话人"对应的所有发言段,重新归属到"新说话人"。常用于解决妙记自动识别错说话人,或需要把外部/非飞书说话人改绑到正确飞书用户的场景。
|
|
6
5
|
|
|
@@ -106,4 +105,3 @@ Agent 必须先 `lark-cli api GET .../speakerlist`,再 `+speaker-replace`;`-
|
|
|
106
105
|
## 参考
|
|
107
106
|
|
|
108
107
|
- [lark-minutes](../SKILL.md) -- 妙记相关功能说明
|
|
109
|
-
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# minutes +summary
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
3
|
|
|
5
4
|
替换妙记的 AI 总结内容。写操作,会覆盖当前总结。
|
|
6
5
|
|
|
@@ -119,4 +118,3 @@ lark-cli minutes +summary --minute-token obcnxxxxxxxxxxxxxxxxxxxx --summary @sum
|
|
|
119
118
|
- [lark-minutes](../SKILL.md) — 妙记全部命令
|
|
120
119
|
- [minutes +todo](lark-minutes-todo.md) — 替换待办项
|
|
121
120
|
- [minutes +detail](lark-minutes-detail.md) — 读取总结、待办等 AI 产物
|
|
122
|
-
- [lark-shared](../../lark-shared/SKILL.md) — 认证和全局参数
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **路由**:本命令操作**妙记内的 AI 待办**,不是飞书任务(Task)。用户说「在妙记里新建待办」时**必须**用本命令,**禁止**走 `lark-cli task` / `tasklists list` / `task +create`。详见 [lark-minutes/SKILL.md](../SKILL.md) 第 6 节。
|
|
4
4
|
|
|
5
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
6
5
|
|
|
7
6
|
对妙记中的待办做新增 / 更新 / 删除(单条或批量)。写操作。
|
|
8
7
|
|
|
@@ -135,4 +134,3 @@ lark-cli minutes +todo --minute-token obcnxxxxxxxxxxxxxxxxxxxx --operation add -
|
|
|
135
134
|
- [lark-minutes](../SKILL.md)
|
|
136
135
|
- [minutes +summary](lark-minutes-summary.md)
|
|
137
136
|
- [minutes +detail](lark-minutes-detail.md)
|
|
138
|
-
- [lark-shared](../../lark-shared/SKILL.md)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# minutes +update
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
3
|
|
|
5
4
|
修改飞书妙记的标题(topic)。
|
|
6
5
|
|
|
@@ -38,4 +37,3 @@ lark-cli minutes +update --minute-token xxx --topic "周会纪要 2026-05-18"
|
|
|
38
37
|
## 参考
|
|
39
38
|
|
|
40
39
|
- [lark-minutes](../SKILL.md) -- 妙记相关功能说明
|
|
41
|
-
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数
|