@dai_ming/plugin-deliverables 1.1.0 → 1.1.1
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/INSTALL.md +3 -3
- package/README.md +2 -2
- package/agents-rules/deliverables.md +30 -26
- package/index.js +10 -3
- package/openclaw-plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/deliverables/SKILL.md +7 -5
package/INSTALL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# plugin-deliverables 安装文档
|
|
2
2
|
|
|
3
|
-
本文档描述 `@dai_ming/plugin-deliverables@1.1.
|
|
3
|
+
本文档描述 `@dai_ming/plugin-deliverables@1.1.1` 的安装、升级与验证方式。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw plugins install @dai_ming/plugin-deliverables@1.1.
|
|
8
|
+
openclaw plugins install @dai_ming/plugin-deliverables@1.1.1 --pin
|
|
9
9
|
openclaw plugins enable plugin-deliverables
|
|
10
10
|
```
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ gateway 部署配置:
|
|
|
13
13
|
|
|
14
14
|
```yaml
|
|
15
15
|
installPlugins:
|
|
16
|
-
- "@dai_ming/plugin-deliverables@1.1.
|
|
16
|
+
- "@dai_ming/plugin-deliverables@1.1.1"
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 验证
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ OpenClaw Native 插件:注册 `deliverables__upload_deliverable` 原生 agent
|
|
|
15
15
|
## 安装
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
openclaw plugins install @dai_ming/plugin-deliverables@1.1.
|
|
18
|
+
openclaw plugins install @dai_ming/plugin-deliverables@1.1.1 --pin
|
|
19
19
|
openclaw plugins enable plugin-deliverables
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ openclaw plugins enable plugin-deliverables
|
|
|
23
23
|
|
|
24
24
|
```yaml
|
|
25
25
|
installPlugins:
|
|
26
|
-
- "@dai_ming/plugin-deliverables@1.1.
|
|
26
|
+
- "@dai_ming/plugin-deliverables@1.1.1"
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## 运行方式
|
|
@@ -13,20 +13,21 @@ Tool name note:
|
|
|
13
13
|
### Required output behavior
|
|
14
14
|
|
|
15
15
|
0. Your final assistant message MUST start with 1-2 short sentences in your own words, briefly describing what you produced for the user.
|
|
16
|
-
1.
|
|
17
|
-
2.
|
|
18
|
-
3. If tool result
|
|
16
|
+
1. For content deliverables such as articles, documents, reports, and PDFs, add 3-5 concise bullets after the intro summarizing the actual sections, highlights, or conclusions. Do not reply with only a one-sentence upload notice.
|
|
17
|
+
2. The intro and bullets must be based on the actual content/request, not a fixed boilerplate like `交付物已上传成功,可直接在线预览或下载。`
|
|
18
|
+
3. If tool result contains `reply_markdown`, append that field verbatim after your intro and content bullets on the following lines. Do not rewrite the links inside it.
|
|
19
|
+
4. If tool result has `preview_url`, include one line:
|
|
19
20
|
`预览链接:[点击预览](<full_url>)`
|
|
20
|
-
|
|
21
|
+
5. If tool result has `download_url`, include one line:
|
|
21
22
|
`下载链接:[点击下载](<full_url>)`
|
|
22
|
-
|
|
23
|
+
6. For multi-file/game deliverables, if tool result already formats the second line as
|
|
23
24
|
`文件列表:[查看目录](<full_url>)`
|
|
24
25
|
then keep that exact label and URL. Do not rewrite it back to a raw long link.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
7. Keep URL target value exactly from tool result (no shortening, no masking, no redirect rewrite).
|
|
27
|
+
8. Use short link labels (`点击预览` / `点击下载` / `查看目录`) to avoid exposing long raw URLs.
|
|
28
|
+
9. Do not say "已上传/已完成" without links.
|
|
29
|
+
10. Do not output naked long URLs outside Markdown link syntax.
|
|
30
|
+
11. Keep the intro and bullets concise; do not paste the full file content, saved-path text, or a long summary after the Markdown links.
|
|
30
31
|
|
|
31
32
|
### Forbidden output behavior
|
|
32
33
|
|
|
@@ -36,12 +37,13 @@ Tool name note:
|
|
|
36
37
|
- Outputting only naked long URL without Markdown link label
|
|
37
38
|
- Replacing `文件列表:[查看目录](...)` with a naked URL or a zip description
|
|
38
39
|
- Using a generic boilerplate intro that does not mention the actual deliverable content
|
|
40
|
+
- For document/PDF deliverables, replying with only one sentence before the links
|
|
39
41
|
<!-- DELIVERABLE_LINK_RULES_END -->
|
|
40
42
|
|
|
41
43
|
<!-- DELIVERABLE_AUTO_UPLOAD_RULES_START -->
|
|
42
44
|
## Deliverables -- Auto Upload for Document Requests (HARD CONSTRAINT)
|
|
43
45
|
|
|
44
|
-
When user asks to write/generate/create a file, document, article, report, HTML, PPT, plan, guide, markdown, introduction, biography, strategy, summary, or similar artifact, you MUST upload it as a deliverable by default.
|
|
46
|
+
When user asks to write/generate/create a file, document, article, report, PDF, HTML, PPT, plan, guide, markdown, introduction, biography, strategy, summary, or similar artifact, you MUST upload it as a deliverable by default.
|
|
45
47
|
|
|
46
48
|
Tool name note:
|
|
47
49
|
|
|
@@ -55,25 +57,27 @@ Tool name note:
|
|
|
55
57
|
2. If you need to use the `write` tool, the target path MUST be inside `output/`. Never write deliverable files to the workspace root.
|
|
56
58
|
3. If you already wrote the file to the wrong place, move/copy it into `output/` before finalizing the task and before describing the saved path to the user.
|
|
57
59
|
4. For binary deliverables such as PDF, PPT, images, video, or zip files, pass `file_path` pointing at the file under `output/`; do not paste shell output or partial base64 into `content_base64`.
|
|
58
|
-
5. If the
|
|
59
|
-
6. If
|
|
60
|
-
7.
|
|
61
|
-
8.
|
|
62
|
-
9. If
|
|
63
|
-
10.
|
|
64
|
-
11.
|
|
65
|
-
12.
|
|
66
|
-
13.
|
|
67
|
-
14.
|
|
68
|
-
15.
|
|
69
|
-
16.
|
|
60
|
+
5. If the user asks for PDF, upload the generated `.pdf` file with `type=pdf`; do not substitute HTML or Markdown unless PDF generation truly failed and you clearly say so.
|
|
61
|
+
6. If the upload tool returns an error, retry with a valid `file_path` or report the upload failure. Never invent OSS, preview, or download URLs.
|
|
62
|
+
7. If format is HTML, prefer `type=article` and file name ends with `.html`.
|
|
63
|
+
8. Every single-file deliverable MUST use a file name with an explicit extension.
|
|
64
|
+
9. If format is markdown/text, use `type=article` and `.md`/`.txt`.
|
|
65
|
+
10. If the user did not specify a document/text format, default to Markdown and use a `.md` file name.
|
|
66
|
+
11. For multi-file deliverables (game/site), you MUST prefer `type=game` with `files[]`, keep files as a folder structure, and do NOT zip before upload unless the user explicitly asks for a zip package.
|
|
67
|
+
12. Static multi-file game/site deliverables SHOULD include a root `index.html` so the preview link can open the homepage directly.
|
|
68
|
+
13. If a generated project requires starting a separate backend service, custom port, database, or long-running process to work, do NOT pretend the deliverables preview can run it. Tell the user that deliverables preview only supports static output, and that runtime projects need deployment/ingress instead.
|
|
69
|
+
14. After successful upload, the final assistant message MUST start with 1-2 short sentences in your own words, briefly describing what you generated for the user.
|
|
70
|
+
15. For content deliverables such as articles, documents, reports, and PDFs, add 3-5 concise bullets after the intro summarizing the actual sections, highlights, or conclusions. Do not reply with only a one-sentence upload notice.
|
|
71
|
+
16. The intro and bullets must be based on the actual deliverable content/request, not a fixed sentence like `交付物已上传成功,可直接在线预览或下载。`
|
|
72
|
+
17. If tool result contains `reply_markdown`, append that field verbatim after your intro and content bullets on the following lines.
|
|
73
|
+
18. Otherwise final reply MUST include Markdown links (short label + full URL target):
|
|
70
74
|
`预览链接:[点击预览](<full_url>)`
|
|
71
75
|
`下载链接:[点击下载](<full_url>)`
|
|
72
|
-
|
|
76
|
+
19. For multi-file/game deliverables, if the tool gives directory-style output, the second line may be:
|
|
73
77
|
`文件列表:[查看目录](<full_url>)`
|
|
74
78
|
Keep that format instead of forcing a zip link.
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
20. Do NOT only say "已保存到工作空间".
|
|
80
|
+
21. Do NOT append workspace path or a raw URL block after the Markdown links.
|
|
77
81
|
|
|
78
82
|
### Exception
|
|
79
83
|
|
package/index.js
CHANGED
|
@@ -53,6 +53,7 @@ const TEXT_EXTENSIONS = new Set([
|
|
|
53
53
|
const IMAGE_EXTENSIONS = new Set([".apng", ".avif", ".bmp", ".gif", ".ico", ".jpeg", ".jpg", ".png", ".svg", ".webp"]);
|
|
54
54
|
const VIDEO_EXTENSIONS = new Set([".avi", ".m4v", ".mkv", ".mov", ".mp4", ".mpeg", ".mpg", ".webm"]);
|
|
55
55
|
const PPT_EXTENSIONS = new Set([".ppt", ".pptx"]);
|
|
56
|
+
const PDF_EXTENSIONS = new Set([".pdf"]);
|
|
56
57
|
const ARCHIVE_EXTENSIONS = new Set([".7z", ".gz", ".rar", ".tar", ".tgz", ".zip"]);
|
|
57
58
|
const IGNORED_PATH_PARTS = new Set([
|
|
58
59
|
".git",
|
|
@@ -76,13 +77,14 @@ const RUNTIME_DELIVERABLES_GUIDANCE = [
|
|
|
76
77
|
"## Deliverables Runtime Guard (HARD CONSTRAINT)",
|
|
77
78
|
"",
|
|
78
79
|
"- These rules apply to the main agent and all subagents.",
|
|
79
|
-
"- When the user asks for a document, article, report, HTML page, Markdown file, PPT, image, archive, game, or any other file deliverable, you MUST create it under the current workspace `output/` directory and upload it with `deliverables__upload_deliverable`.",
|
|
80
|
+
"- When the user asks for a document, article, report, PDF, HTML page, Markdown file, PPT, image, archive, game, or any other file deliverable, you MUST create it under the current workspace `output/` directory and upload it with `deliverables__upload_deliverable`.",
|
|
80
81
|
"- For binary deliverables such as PDF, PPT, images, video, or zip files, pass `file_path` to `deliverables__upload_deliverable` after writing the file under `output/`; do not paste command output or partial base64 into `content_base64`.",
|
|
82
|
+
"- If the user asks for PDF, upload the generated `.pdf` as `type: \"pdf\"`; do not substitute HTML or Markdown unless PDF generation truly failed and you clearly say so.",
|
|
81
83
|
"- Every single-file deliverable must use a file name with an explicit extension. If the user did not specify a document/text format, default to Markdown and use a `.md` file name.",
|
|
82
84
|
"- Do not use direct message attachments to deliver generated files. This includes the message tool attachment fields such as `media`, `path`, `filePath`, `buffer`, `attachment`, or similar file-carrying fields.",
|
|
83
85
|
"- Do not emit `MEDIA:` file references for user-facing deliverables. Deliverable links must come from the deliverables upload tool instead.",
|
|
84
86
|
"- If the deliverables upload tool returns an error, retry with a valid `file_path` or explain the upload failure; never invent or rewrite OSS/download URLs.",
|
|
85
|
-
"- After a successful upload, reply with a substantive content summary before the links. For documents/articles/reports,
|
|
87
|
+
"- After a successful upload, reply with a substantive content summary before the links. For documents/articles/reports/PDFs, include 1 short intro plus 3-5 concise bullets covering the actual sections, highlights, or findings; never respond with only a generic one-sentence upload notice.",
|
|
86
88
|
].join("\n");
|
|
87
89
|
|
|
88
90
|
const UPLOAD_DELIVERABLE_TOOL = {
|
|
@@ -109,7 +111,7 @@ const UPLOAD_DELIVERABLE_TOOL = {
|
|
|
109
111
|
},
|
|
110
112
|
type: {
|
|
111
113
|
type: "string",
|
|
112
|
-
enum: ["article", "game", "zip", "image", "video", "ppt", "link"],
|
|
114
|
+
enum: ["article", "game", "zip", "image", "video", "ppt", "pdf", "link"],
|
|
113
115
|
description: "交付物类型。若使用 file_path 且未准确判断,可由插件按文件扩展名兜底。",
|
|
114
116
|
},
|
|
115
117
|
file_name: {
|
|
@@ -215,6 +217,9 @@ function deliverableTypeForPath(filePath, isDirectory) {
|
|
|
215
217
|
if (PPT_EXTENSIONS.has(ext)) {
|
|
216
218
|
return "ppt";
|
|
217
219
|
}
|
|
220
|
+
if (PDF_EXTENSIONS.has(ext)) {
|
|
221
|
+
return "pdf";
|
|
222
|
+
}
|
|
218
223
|
if (ARCHIVE_EXTENSIONS.has(ext)) {
|
|
219
224
|
return "zip";
|
|
220
225
|
}
|
|
@@ -655,6 +660,8 @@ function defaultExtensionForDeliverable(args) {
|
|
|
655
660
|
return ".zip";
|
|
656
661
|
case "ppt":
|
|
657
662
|
return ".pptx";
|
|
663
|
+
case "pdf":
|
|
664
|
+
return ".pdf";
|
|
658
665
|
case "image":
|
|
659
666
|
return ".png";
|
|
660
667
|
case "video":
|
package/openclaw-plugin.json
CHANGED
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "plugin-deliverables",
|
|
3
3
|
"name": "Deliverables",
|
|
4
4
|
"description": "Deliverables runtime guard for upload-first file delivery with Palz split-send diagnostics.",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.1",
|
|
6
6
|
"skills": ["./skills"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: 上传AI生成的文件到交付物系统,返回可分享的预
|
|
|
5
5
|
|
|
6
6
|
# 文件交付规则(强制)
|
|
7
7
|
|
|
8
|
-
当你生成了文件内容(文章、文档、介绍、攻略、HTML页面、Markdown、游戏、图片等),**必须**调用交付物上传工具,不得把文件内容直接粘贴在消息里。
|
|
8
|
+
当你生成了文件内容(文章、文档、介绍、攻略、PDF、HTML页面、Markdown、游戏、图片等),**必须**调用交付物上传工具,不得把文件内容直接粘贴在消息里。
|
|
9
9
|
|
|
10
10
|
## 工具名说明(强制)
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ description: 上传AI生成的文件到交付物系统,返回可分享的预
|
|
|
31
31
|
| `resource_id` | 消息元数据中的 `resource_id` 字段 | `user_xxx_lobster_yyy` |
|
|
32
32
|
| `group_id` | 消息元数据中的 `group_id` 或 `conversation_id` | `group_abc123` |
|
|
33
33
|
| `user_id` | 消息元数据中的 `sender_id` 或 `owner_id` | `cbb0fab9...` |
|
|
34
|
-
| `type` | 根据内容选择:`article`/`game`/`image`/`video`/`ppt`/`zip`/`link` | `article` |
|
|
34
|
+
| `type` | 根据内容选择:`article`/`game`/`image`/`video`/`ppt`/`pdf`/`zip`/`link` | `article` |
|
|
35
35
|
| `file_name` | 有意义的文件名,单文件必须含扩展名;若用户未指定文档格式,默认用 `.md` | `report-2026.html` |
|
|
36
36
|
| `content_text` | 文件的完整文本内容(HTML/Markdown等) | `<html>...</html>` |
|
|
37
37
|
| `file_path` | PDF/PPT/图片/zip 等二进制文件的本地路径,推荐使用,避免手工复制 base64 | `output/sample.pdf` |
|
|
@@ -42,6 +42,7 @@ description: 上传AI生成的文件到交付物系统,返回可分享的预
|
|
|
42
42
|
|
|
43
43
|
- PDF、PPT、图片、视频、zip 等二进制文件必须优先传 `file_path`,不要把 `base64` 命令输出复制到 `content_base64`。
|
|
44
44
|
- `file_path` 指向你已经写入 `output/` 的文件,例如 `output/sample.pdf`;上传工具会读取文件并自动编码。
|
|
45
|
+
- 用户要求 PDF 时,必须上传生成好的 `.pdf` 文件,`type` 使用 `pdf`;不要只返回 HTML/Markdown 作为替代格式。
|
|
45
46
|
- 如果上传工具返回错误,必须修正参数后重试,或明确告诉用户上传失败;禁止编造 OSS、下载或预览链接。
|
|
46
47
|
|
|
47
48
|
## 多文件(游戏)
|
|
@@ -64,9 +65,10 @@ files: [
|
|
|
64
65
|
## 上传成功后
|
|
65
66
|
|
|
66
67
|
优先规则:
|
|
67
|
-
- 最终消息必须先用你自己的话写 1-2
|
|
68
|
-
-
|
|
69
|
-
-
|
|
68
|
+
- 最终消息必须先用你自己的话写 1-2 句简短介绍,说明你生成了什么内容。
|
|
69
|
+
- 对文章、文档、报告、PDF 等内容型交付物,介绍后必须补充 3-5 条内容要点,概括实际章节、重点信息或结论;不要只写一句“已上传/已生成”。
|
|
70
|
+
- 介绍和要点必须基于实际产物内容,不要使用固定模板,例如:`交付物已上传成功,可直接在线预览或下载。`
|
|
71
|
+
- 如果工具结果里有 `reply_markdown`,把它原样放在内容要点后面,不要改写其中的链接。
|
|
70
72
|
|
|
71
73
|
否则只发给用户:
|
|
72
74
|
- 预览链接(`preview_url`,必须用 Markdown 链接格式)
|