@wecom/wecom-openclaw-plugin 2026.5.7-beta.0 → 2026.5.14-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/openclaw.plugin.json +5 -0
- package/package.json +3 -2
- package/skills/{wecom-contact-lookup → wecom-contact}/SKILL.md +1 -1
- package/skills/{wecom-doc-manager → wecom-doc}/SKILL.md +32 -18
- package/skills/{wecom-doc-manager/references/api-smartpage-create.md → wecom-doc/references/smartpage-create.md} +22 -5
- package/skills/wecom-doc/references/smartpage-export.md +160 -0
- package/skills/wecom-meeting/SKILL.md +441 -0
- package/skills/wecom-meeting/references/response-get-meeting-info.md +148 -0
- package/skills/wecom-msg/SKILL.md +2 -2
- package/skills/wecom-schedule/SKILL.md +4 -4
- package/skills/{wecom-smartsheet-data → wecom-smartsheet}/SKILL.md +85 -14
- package/skills/{wecom-smartsheet-data/references/cell-value-formats.md → wecom-smartsheet/references/smartsheet-cell-value-formats.md} +1 -1
- package/skills/{wecom-smartsheet-data/references/api-get-records.md → wecom-smartsheet/references/smartsheet-get-records.md} +34 -0
- package/skills/wecom-todo/SKILL.md +392 -0
- package/skills/wecom-todo/examples/workflows.md +163 -0
- package/skills/wecom-doc-manager/references/api-smartpage-export-task.md +0 -62
- package/skills/wecom-doc-manager/references/api-smartpage-get-export-result.md +0 -74
- package/skills/wecom-edit-todo/SKILL.md +0 -249
- package/skills/wecom-get-todo-detail/SKILL.md +0 -143
- package/skills/wecom-get-todo-list/SKILL.md +0 -127
- package/skills/wecom-meeting-create/SKILL.md +0 -158
- package/skills/wecom-meeting-manage/SKILL.md +0 -136
- package/skills/wecom-meeting-query/SKILL.md +0 -330
- package/skills/wecom-smartsheet-schema/SKILL.md +0 -92
- /package/skills/{wecom-doc-manager/references/api-create-doc.md → wecom-doc/references/create-doc.md} +0 -0
- /package/skills/{wecom-doc-manager/references/api-edit-doc-content.md → wecom-doc/references/edit-doc-content.md} +0 -0
- /package/skills/{wecom-doc-manager/references/api-export-document.md → wecom-doc/references/get-doc-content.md} +0 -0
- /package/skills/{wecom-meeting-create → wecom-meeting}/references/example-full.md +0 -0
- /package/skills/{wecom-meeting-create → wecom-meeting}/references/example-reminder.md +0 -0
- /package/skills/{wecom-meeting-create → wecom-meeting}/references/example-security.md +0 -0
- /package/skills/{wecom-smartsheet-schema/references/field-types.md → wecom-smartsheet/references/smartsheet-field-types.md} +0 -0
- /package/skills/{wecom-smartsheet-data → wecom-smartsheet}/references/webhook-examples.md +0 -0
- /package/skills/{wecom-smartsheet-data → wecom-smartsheet}/references/webhook-fallback.md +0 -0
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wecom/wecom-openclaw-plugin",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.14-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"release": "node scripts/publish-all.mjs",
|
|
25
25
|
"release:dry": "node scripts/publish-all.mjs --dry-run",
|
|
26
26
|
"release:ci": "node scripts/publish-all.mjs --yes --restore=no",
|
|
27
|
-
"deploy:local": "bash scripts/dev-deploy.sh"
|
|
27
|
+
"deploy:local": "bash scripts/dev-deploy.sh",
|
|
28
|
+
"deploy:local:extensions": "bash scripts/dev-deploy.sh --target=extensions"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [
|
|
30
31
|
"wecom",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: wecom-doc
|
|
2
|
+
name: wecom-doc
|
|
3
3
|
description: 企业微信文档管理技能。支持企业微信文档、智能表格和智能文档(原名智能主页)的管理。具体能力:(1) 获取文档或智能表格的完整内容,以 Markdown 格式导出 (2) 新建文档或智能表格 (3) 用 Markdown 覆写文档内容 (4) 创建智能文档,将本地 Markdown 文件发布为智能文档 (5) 导出智能文档内容为 Markdown 文件。
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -51,7 +51,9 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
51
51
|
| errcode | errmsg | 含义 | 处理方式 |
|
|
52
52
|
|---------|--------|------|----------|
|
|
53
53
|
| `851002` | `incompatible doc type` | 文档品类与所调用的接口不匹配 | 根据文档 URL 重新确认品类(参见上方「URL 品类识别与接口路由」表),然后使用该品类对应的正确接口重试 |
|
|
54
|
-
| `851003` | `no authority` | 无权限调用该接口,**智能表格写入场景**下通常是企业可见范围 > 10 人的规模限制 | 若发生在需要写入数据的场景,引导用户走 Webhook 兜底方案,详见 [webhook-fallback.md](../wecom-smartsheet
|
|
54
|
+
| `851003` | `no authority` | 无权限调用该接口,**智能表格写入场景**下通常是企业可见范围 > 10 人的规模限制 | 若发生在需要写入数据的场景,引导用户走 Webhook 兜底方案,详见 [webhook-fallback.md](../wecom-smartsheet/references/webhook-fallback.md);其他接口则按权限问题排查 |
|
|
55
|
+
|
|
56
|
+
---
|
|
55
57
|
|
|
56
58
|
## 文档
|
|
57
59
|
|
|
@@ -71,18 +73,20 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
71
73
|
- 轮询(携带上次返回的 task_id):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2, "task_id": "xxx"}'`
|
|
72
74
|
- 或通过 URL:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"url": "https://doc.weixin.qq.com/doc/xxx", "type": 2}'`
|
|
73
75
|
|
|
74
|
-
参见 [API 详情](references/
|
|
76
|
+
参见 [API 详情](references/get-doc-content.md)。
|
|
75
77
|
|
|
76
78
|
### create_doc
|
|
77
79
|
|
|
78
80
|
新建文档(doc_type=3)或智能表格(doc_type=10)。创建成功返回 url 和 docid。
|
|
79
81
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
+
- 创建文档:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc create_doc '{"doc_type": 3, "doc_name": "项目周报"}'`
|
|
83
|
+
- 创建智能表格:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc create_doc '{"doc_type": 10, "doc_name": "任务跟踪表"}'`
|
|
82
84
|
|
|
83
|
-
**注意**:
|
|
85
|
+
**注意**:
|
|
86
|
+
- docid 仅在创建时返回,需妥善保存。创建智能表格时默认包含一个子表
|
|
87
|
+
- 智能表格(doc_type=10)的详细管理功能(子表、字段、数据记录等)已迁移到 `wecom-smartsheet` skill,请使用该 skill 进行高级操作
|
|
84
88
|
|
|
85
|
-
参见 [API 详情](references/
|
|
89
|
+
参见 [API 详情](references/create-doc.md)。
|
|
86
90
|
|
|
87
91
|
### edit_doc_content
|
|
88
92
|
|
|
@@ -90,7 +94,9 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
90
94
|
|
|
91
95
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc edit_doc_content '{"docid": "DOCID", "content": "# 标题\n\n正文内容", "content_type": 1}'`
|
|
92
96
|
|
|
93
|
-
参见 [API 详情](references/
|
|
97
|
+
参见 [API 详情](references/edit-doc-content.md)。
|
|
98
|
+
|
|
99
|
+
---
|
|
94
100
|
|
|
95
101
|
## 智能文档(原名智能主页)
|
|
96
102
|
|
|
@@ -101,7 +107,7 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
101
107
|
|
|
102
108
|
适用场景:
|
|
103
109
|
1. 将本地 Markdown 文件创建为智能文档
|
|
104
|
-
2. 异步导出智能文档内容为 Markdown
|
|
110
|
+
2. 异步导出智能文档内容为 Markdown
|
|
105
111
|
|
|
106
112
|
### smartpage_create
|
|
107
113
|
|
|
@@ -114,15 +120,16 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
114
120
|
- docid 仅在创建时返回,需妥善保存
|
|
115
121
|
- 每个子页面的 Markdown 文件大小不得超过 **10MB**,超过会导致创建失败。如果文件过大,需先拆分为多个子页面再创建
|
|
116
122
|
|
|
117
|
-
参见 [API 详情](references/
|
|
123
|
+
参见 [API 详情](references/smartpage-create.md)。
|
|
118
124
|
|
|
119
125
|
### smartpage_export_task
|
|
120
126
|
|
|
121
|
-
发起智能文档内容导出任务(异步)。传入 docid
|
|
127
|
+
发起智能文档内容导出任务(异步)。传入 docid(或 url)和 content_type,返回 task_id。这是异步导出的第一步,需配合 `smartpage_get_export_result` 轮询获取导出结果。
|
|
122
128
|
|
|
123
|
-
-
|
|
129
|
+
- 通过 docid:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}'`
|
|
130
|
+
- 或通过 URL:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartpage_export_task '{"url": "https://doc.weixin.qq.com/smartpage/xxx", "content_type": 1}'`
|
|
124
131
|
|
|
125
|
-
参见 [API 详情](references/
|
|
132
|
+
参见 [API 详情](references/smartpage-export.md)。
|
|
126
133
|
|
|
127
134
|
### smartpage_get_export_result
|
|
128
135
|
|
|
@@ -132,17 +139,24 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
132
139
|
|
|
133
140
|
当 `task_done` 为 `true` 时,使用 Read 工具读取 `content_filepath` 指向的文件即可获取导出的 Markdown 内容。
|
|
134
141
|
|
|
135
|
-
参见 [API 详情](references/
|
|
142
|
+
参见 [API 详情](references/smartpage-export.md)。
|
|
143
|
+
|
|
144
|
+
---
|
|
136
145
|
|
|
137
146
|
## 典型工作流
|
|
138
147
|
|
|
139
148
|
> **关键提示**:读取内容前先看 URL 判断品类。`/doc/` 或 `/smartsheet/` → `get_doc_content`;`/smartpage/` → `smartpage_export_task`。只有用户明确提到「智能文档」或「智能主页」时才走 smartpage 流程,其他文档场景一律使用企微文档接口。
|
|
140
149
|
|
|
150
|
+
### 文档操作
|
|
151
|
+
|
|
141
152
|
1. **读取文档/智能表格内容**(URL 含 `/doc/` 或 `/smartsheet/`) → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2}'`,若 `task_done` 为 false 则携带 `task_id` 继续轮询
|
|
142
153
|
2. **创建新文档** → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc create_doc '{"doc_type": 3, "doc_name": "文档名"}'`,保存返回的 docid
|
|
143
154
|
3. **编辑文档** → 先 get_doc_content 了解当前内容,再 edit_doc_content 覆写
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
|
|
156
|
+
### 智能文档操作
|
|
157
|
+
|
|
158
|
+
1. **创建智能文档**(仅当用户明确要求「智能文档」或「智能主页」时) → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartpage_create '{"title": "标题", "pages": [{"page_title": "子页面", "content_type": 1, "page_filepath": "/path/to/file.md"}]}'`,保存返回的 docid
|
|
159
|
+
2. **获取智能文档内容**(URL 含 `/smartpage/`,异步两步):
|
|
160
|
+
- **第一步**:发起导出任务 → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}'`,获取 `task_id`
|
|
161
|
+
- **第二步**:轮询导出结果 → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartpage_get_export_result '{"task_id": "TASK_ID"}'`,若 `task_done` 为 `false` 则继续轮询,直到 `task_done` 为 `true`
|
|
148
162
|
- **第三步**:使用 Read 工具读取 `content_filepath` 指向的本地文件,获取 Markdown 内容
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# smartpage_create API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
创建智能文档(原智能主页)。支持传入多个子页面,每个子页面可指定标题、内容类型和本地文件路径。创建成功后返回文档访问链接和 docid。
|
|
4
4
|
|
|
5
5
|
## 技能定义
|
|
6
6
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
| pages | array | 是 | 子页面列表 |
|
|
59
59
|
| pages[].page_title | string | 否 | 子页面标题 |
|
|
60
60
|
| pages[].content_type | integer | 否 | 内容类型:1-Markdown,0-Text(纯文本)。**默认应传 1**,仅纯文本内容才传 0 |
|
|
61
|
-
| pages[].page_filepath | string | 否 |
|
|
61
|
+
| pages[].page_filepath | string | 否 | 子页面内容对应的本地文件路径,需确保文件存在且可读 |
|
|
62
62
|
|
|
63
63
|
## ContentType 枚举
|
|
64
64
|
|
|
@@ -67,6 +67,25 @@
|
|
|
67
67
|
| 1 | Markdown | 文件内容包含 Markdown 语法(标题、列表、链接、代码块等) |
|
|
68
68
|
| 0 | Text(纯文本) | 文件内容为纯文本,不含任何 Markdown 语法 |
|
|
69
69
|
|
|
70
|
+
除了标准的 markdown 格式以外,智能文档还支持扩展语法以提升表示的丰富性,包括:
|
|
71
|
+
1. 背景块
|
|
72
|
+
```markdown
|
|
73
|
+
<card color="green">
|
|
74
|
+
## 在扩展标签里面可以任意嵌套 markdown 语法
|
|
75
|
+
- 背景块常用于展示重要信息
|
|
76
|
+
- 颜色的使用根据需要表达的语义进行选择,卡片背景由 `color` 指定;支持 `green`, `blue`, `red`, `yellow`, `gray`, `purple`, `orange`, `cyan`, `indigo`,也支持 `dark_green`, `dark_blue`, `dark_red`, `dark_yellow`, `dark_gray`, `dark_purple`, `dark_orange`, `dark_cyan`, `dark_indigo` 等深色系。
|
|
77
|
+
</card>
|
|
78
|
+
```
|
|
79
|
+
背景颜色推荐使用浅色背景,以完成区隔/高亮并且保持低饱和度确保正文内容的良好显示。
|
|
80
|
+
2. 分栏
|
|
81
|
+
使用分栏可以并列显示内容,常用于展示对比或者并列信息
|
|
82
|
+
```markdown
|
|
83
|
+
<grid>
|
|
84
|
+
<area width-ratio="0.5">占据50%的空间</area>
|
|
85
|
+
<area width-ratio="0.5">占据50%的空间</area>
|
|
86
|
+
</grid>
|
|
87
|
+
```
|
|
88
|
+
width-ratio:子容器宽度占比,范围 0.1~1.0,所有的子容器宽度占比之和为 1
|
|
70
89
|
|
|
71
90
|
## 请求示例
|
|
72
91
|
|
|
@@ -98,11 +117,9 @@
|
|
|
98
117
|
"url": "https://doc.weixin.qq.com/smartpage/a1_xxxxxx"
|
|
99
118
|
}
|
|
100
119
|
```
|
|
101
|
-
|
|
102
120
|
## 注意事项
|
|
103
121
|
|
|
104
|
-
- 响应透传 mcp 回包
|
|
105
122
|
- `docid` 仅在创建时返回,后续无法再获取,务必保存
|
|
106
123
|
- `page_filepath` 指向本地文件,需确保文件存在且可读
|
|
107
124
|
- **`content_type` 必须与文件实际内容格式匹配**:`.md` 文件或包含 Markdown 语法的内容必须传 `1`,不要传 `0`
|
|
108
|
-
- 每个子页面的 Markdown 文件大小不得超过 **10MB**,超过会导致创建失败;如果文件过大,需先拆分为多个子页面
|
|
125
|
+
- 每个子页面的 Markdown 文件大小不得超过 **10MB**,超过会导致创建失败;如果文件过大,需先拆分为多个子页面
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# smartpage_export_task / smartpage_get_export_result API
|
|
2
|
+
|
|
3
|
+
导出智能文档(原智能主页)内容。采用异步两步操作:先通过 `smartpage_export_task` 提交导出任务获取 `task_id`,再通过 `smartpage_get_export_result` 轮询任务状态,直到任务完成后返回导出内容的本地文件路径。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 第一步:smartpage_export_task — 提交导出任务
|
|
8
|
+
|
|
9
|
+
发起智能文档内容导出任务(异步)。传入 `docid` 或 `url` 和 `content_type`,返回 `task_id`。
|
|
10
|
+
|
|
11
|
+
### 技能定义
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"name": "smartpage_export_task",
|
|
16
|
+
"description": "发起智能文档(原智能主页)内容导出任务(异步)。传入 docid(或 url)和 content_type,返回 task_id。需配合 smartpage_get_export_result 轮询查询导出进度,直到任务完成后获取导出文件路径。",
|
|
17
|
+
"inputSchema": {
|
|
18
|
+
"properties": {
|
|
19
|
+
"docid": {
|
|
20
|
+
"description": "智能文档的 docid,与 url 二选一传入",
|
|
21
|
+
"title": "Doc ID",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"url": {
|
|
25
|
+
"description": "智能文档的访问链接,与 docid 二选一传入",
|
|
26
|
+
"title": "URL",
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"content_type": {
|
|
30
|
+
"description": "导出内容格式。0: Text,1: Markdown",
|
|
31
|
+
"enum": [0, 1],
|
|
32
|
+
"title": "Content Type",
|
|
33
|
+
"type": "integer"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{ "required": ["docid", "content_type"] },
|
|
38
|
+
{ "required": ["url", "content_type"] }
|
|
39
|
+
],
|
|
40
|
+
"title": "smartpage_export_taskArguments",
|
|
41
|
+
"type": "object"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 参数说明
|
|
47
|
+
|
|
48
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
49
|
+
| ------------ | ------- | --------------- | --------------------------------------------- |
|
|
50
|
+
| docid | string | 与 url 二选一 | 智能文档的 docid |
|
|
51
|
+
| url | string | 与 docid 二选一 | 智能文档的访问链接 |
|
|
52
|
+
| content_type | integer | 是 | 导出内容格式:0-Text,1-Markdown |
|
|
53
|
+
|
|
54
|
+
### 请求示例
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
// 通过 docid
|
|
58
|
+
{
|
|
59
|
+
"docid": "DOCID",
|
|
60
|
+
"content_type": 1
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 通过 url
|
|
64
|
+
{
|
|
65
|
+
"url": "https://doc.weixin.qq.com/smartpage/a1_xxxxxx",
|
|
66
|
+
"content_type": 1
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 响应示例
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"errcode": 0,
|
|
75
|
+
"errmsg": "ok",
|
|
76
|
+
"task_id": "TASK_ID"
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 第二步:smartpage_get_export_result — 查询导出结果
|
|
83
|
+
|
|
84
|
+
查询智能文档导出任务进度。传入 `task_id` 进行轮询,当 `task_done` 为 `true` 时返回导出内容的本地文件路径。
|
|
85
|
+
|
|
86
|
+
### 技能定义
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"name": "smartpage_get_export_result",
|
|
91
|
+
"description": "查询智能文档(原智能主页)导出任务进度。传入 task_id 轮询,当 task_done 为 true 时返回导出内容的本地文件路径 content_filepath,可通过读取该文件获取 Markdown 内容。",
|
|
92
|
+
"inputSchema": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"task_id": {
|
|
95
|
+
"description": "导出任务 ID,由 smartpage_export_task 返回",
|
|
96
|
+
"title": "Task ID",
|
|
97
|
+
"type": "string"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": ["task_id"],
|
|
101
|
+
"title": "smartpage_get_export_resultArguments",
|
|
102
|
+
"type": "object"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 参数说明
|
|
108
|
+
|
|
109
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
110
|
+
| ------- | ------ | ---- | -------------------------------------------- |
|
|
111
|
+
| task_id | string | 是 | 导出任务 ID,由 `smartpage_export_task` 返回 |
|
|
112
|
+
|
|
113
|
+
### 请求示例
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"task_id": "TASK_ID"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 响应示例
|
|
122
|
+
|
|
123
|
+
任务未完成:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"errcode": 0,
|
|
128
|
+
"errmsg": "ok",
|
|
129
|
+
"task_done": false
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
任务完成:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"errcode": 0,
|
|
138
|
+
"errmsg": "ok",
|
|
139
|
+
"task_done": true,
|
|
140
|
+
"content_filepath": "/path/to/exported-content.md"
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 异步轮询机制
|
|
147
|
+
|
|
148
|
+
1. **调用 smartpage_export_task**:传入 `docid`(或 `url`)和 `content_type: 1`,获取 `task_id`
|
|
149
|
+
2. **首次轮询**:传入 `task_id` 调用 `smartpage_get_export_result`
|
|
150
|
+
3. **检查响应**:若 `task_done` 为 `false`,继续轮询
|
|
151
|
+
4. **获取内容**:当 `task_done` 为 `true` 时,读取 `content_filepath` 指向的本地文件获取导出内容
|
|
152
|
+
|
|
153
|
+
## 注意事项
|
|
154
|
+
|
|
155
|
+
- `smartpage_export_task` 是异步操作的第一步,调用后仅返回 `task_id`
|
|
156
|
+
- `content_type` 建议使用 `1`(Markdown)以获取可编辑的文本格式
|
|
157
|
+
- `docid` 和 `url` 二选一传入即可,无需同时传入
|
|
158
|
+
- `content_filepath` 仅在 `task_done` 为 `true` 时返回
|
|
159
|
+
- `content_filepath` 是本地文件路径,使用 Read 工具读取文件内容即可
|
|
160
|
+
- 如果轮询多次仍未完成,建议适当增加轮询间隔
|