mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-07 04:39:25 +08:00
fix(pdf): 将 Markdown 转 PDF 交接给内置导出工具 (#467)
## 中文
PDF 技能 1.0.3 在中英文技能说明和市场目录中加入 Markdown 转 PDF 的内置入口。已声明的 `ExportDocument`
可直接调用。需要发现工具时先确认 `ToolCatalog` 可用。只有目录确认已获授权、会话提供 `LoadTools`
且用户要求转换时才加载。只询问能力时报告声明或查询结果,目录和声明都缺席时说明当前会话无法核实。
市场 i18n、严格目录元数据及翻译新鲜度检查通过。隔离 macOS Electron 使用随包候选验证了读取 PDF
技能、精确查询、按需加载和首次导出成功,产物通过签名、页数及正文检查。
## English
PDF skill 1.0.3 adds Markdown-to-PDF discovery to both locales and the
marketplace listing. A declared `ExportDocument` can be called directly.
The skill checks that `ToolCatalog` is available before an exact lookup
and only loads the authorized tool for conversion when `LoadTools` is
available. Capability questions use the declaration or catalog result
and report when the current session cannot verify availability.
Market i18n, strict catalog metadata, and translation freshness checks
passed. An isolated macOS Electron run with the bundled candidate
verified skill loading, exact discovery, on-demand declaration, and
first-attempt export. The PDF passed signature, page count, and text
checks.
(cherry picked from commit 5f1ffcd699)
This commit is contained in:
1 parent
0403f7b28b
commit
17c12cadc5
3 files changed
+53
-31
No files matched your search
+31
-21
@@ -2,15 +2,14 @@
|
||||
license: "Anthropic Source Available License"
|
||||
name: pdf
|
||||
description: >-
|
||||
Use this skill whenever the user wants to do anything with PDF files. This
|
||||
includes reading or extracting text/tables from PDFs, combining or merging
|
||||
multiple PDFs into one, splitting PDFs apart, rotating pages, adding
|
||||
watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs,
|
||||
extracting images, and OCR on scanned PDFs to make them searchable. If the
|
||||
user mentions a .pdf file or asks to produce one, use this skill. Use when
|
||||
用户提到 PDF、读取PDF、合并PDF、拆分PDF、填写表单、加水印、提取文字、
|
||||
扫描识别。
|
||||
version: 1.0.2
|
||||
Export Markdown to PDF with DesireCore's built-in ExportDocument tool or check
|
||||
whether it is available in the current session. Use for creating PDFs, reading
|
||||
or extracting text, tables, and images, merging or splitting PDFs, rotating
|
||||
pages, adding watermarks, filling forms, encrypting or decrypting PDFs, and OCR
|
||||
on scanned PDFs.
|
||||
适用于 Markdown 转 PDF、查找内置 PDF 导出工具、创建、读取、合并、拆分 PDF、
|
||||
填写表单、添加水印、提取文字和扫描识别。
|
||||
version: 1.0.3
|
||||
type: procedural
|
||||
risk_level: low
|
||||
status: enabled
|
||||
@@ -22,7 +21,7 @@ tags:
|
||||
- ocr
|
||||
metadata:
|
||||
author: anthropic
|
||||
updated_at: '2026-04-13'
|
||||
updated_at: '2026-12-06'
|
||||
i18n:
|
||||
default_locale: en-US
|
||||
source_locale: zh-CN
|
||||
@@ -31,21 +30,20 @@ metadata:
|
||||
- en-US
|
||||
zh-CN:
|
||||
name: PDF 文档处理
|
||||
short_desc: 读取、创建、合并、拆分和填写 PDF 文档
|
||||
short_desc: 导出 Markdown 为 PDF,读取、创建、合并、拆分和填写 PDF 文档
|
||||
description: >-
|
||||
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. Use when 用户提到 PDF、读取PDF、合并PDF、拆分PDF、填写表单、加水印、提取文字、 扫描识别。
|
||||
使用 DesireCore 内置 ExportDocument 将 Markdown 导出为 PDF,也可查询本次会话能否使用该工具。支持创建 PDF、提取文字、表格和图片、合并、拆分、旋转、添加水印、填写表单、加密和解密,以及扫描件 OCR。
|
||||
body: ./SKILL.zh-CN.md
|
||||
source_hash: sha256:15805c1921ac2c1e
|
||||
source_hash: sha256:ed191f48b08a9e77
|
||||
translated_by: human
|
||||
en-US:
|
||||
name: PDF Document Processing
|
||||
short_desc: Read, create, merge, split, and fill PDF documents
|
||||
short_desc: Export Markdown to PDF and read, create, merge, split, and fill PDFs
|
||||
description: >-
|
||||
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. Use when the user mentions PDF, reading PDFs, merging PDFs, splitting PDFs, filling forms, adding watermarks, extracting text, or OCR.
|
||||
Export Markdown to PDF with the built-in ExportDocument tool and check its availability in the current DesireCore session. Supports creating PDFs, extracting text, tables, and images, merging, splitting, rotation, watermarks, form filling, encryption and decryption, and OCR on scanned PDFs.
|
||||
body: ./SKILL.md
|
||||
source_hash: sha256:15805c1921ac2c1e
|
||||
translated_by: ai:claude-opus-4-7
|
||||
translated_at: '2026-05-03'
|
||||
source_hash: sha256:ed191f48b08a9e77
|
||||
translated_by: human
|
||||
market:
|
||||
icon: >-
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
|
||||
@@ -70,26 +68,38 @@ market:
|
||||
|
||||
## L0: One-Sentence Summary
|
||||
|
||||
Read, create, merge, split, and fill PDF documents, with OCR support and command-line tools.
|
||||
Export Markdown to PDF, and read, create, merge, split, and fill PDFs with OCR support.
|
||||
|
||||
## L1: Overview and Use Cases
|
||||
|
||||
### Capability Description
|
||||
|
||||
pdf is a **Procedural Skill** that provides full PDF document processing capabilities. Built on Python libraries (pypdf, pdfplumber, reportlab) and command-line tools (qpdf, pdftotext, pdftk), it supports text extraction, table extraction, merging/splitting, rotation, watermarking, encryption, form filling, and OCR.
|
||||
In DesireCore, the built-in `ExportDocument` tool converts Markdown files to PDF. The Python libraries (pypdf, pdfplumber, reportlab) and command-line tools (qpdf, pdftotext, pdftk) below cover extraction, merging, splitting, rotation, watermarks, encryption, forms, OCR, and other PDF creation.
|
||||
|
||||
### Use Cases
|
||||
|
||||
- The user needs to extract text or table data from a PDF
|
||||
- The user needs to merge multiple PDFs or split pages
|
||||
- The user wants to export a Markdown file to PDF or find a built-in tool for it
|
||||
- The user needs to create a new PDF document
|
||||
- The user needs to fill PDF forms, add watermarks, or encrypt PDFs
|
||||
|
||||
## L2: Detailed Specification
|
||||
|
||||
### Export a Markdown file to PDF
|
||||
|
||||
For an existing UTF-8 Markdown file, prefer DesireCore's built-in `ExportDocument` when available. This path needs no Python or shell commands.
|
||||
|
||||
1. If `ExportDocument` is already declared, call `ExportDocument(path="/work/report.md", format="pdf")` for a conversion. If the user only asks which tool can convert Markdown or whether it is available, report that `ExportDocument` is available.
|
||||
2. If `ExportDocument` is undeclared and `ToolCatalog` is available, call `ToolCatalog(query="select:ExportDocument")`. For an availability question, report what the catalog confirms. For a conversion, call `LoadTools(names=["ExportDocument"])` only when the catalog confirms authorization and `LoadTools` is available. Call `ExportDocument` after it is declared.
|
||||
|
||||
`path` is the input file's absolute path or a path relative to the working directory. For a specified PDF name or destination, pass `output`. When omitted, the result is a same-named PDF beside the source. Set `overwrite=false` when the destination must be new. Report the absolute path from the export result.
|
||||
|
||||
If `ExportDocument` is undeclared and `ToolCatalog` is unavailable, explain that you cannot verify the exporter's availability in this session. If the built-in conversion cannot proceed, explain the limitation and use another method only if the request and current permissions allow it.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Python 3 (required)
|
||||
### Python 3 (required for Python operations)
|
||||
|
||||
Before performing any Python operation, check that Python is available:
|
||||
|
||||
|
||||
@@ -4,26 +4,38 @@
|
||||
|
||||
## L0:一句话摘要
|
||||
|
||||
读取、创建、合并、拆分和填写 PDF 文档,支持 OCR 识别和命令行工具。
|
||||
将 Markdown 导出为 PDF,读取、创建、合并、拆分和填写 PDF 文档,支持 OCR 识别。
|
||||
|
||||
## L1:概述与使用场景
|
||||
|
||||
### 能力描述
|
||||
|
||||
pdf 是一个**流程型技能(Procedural Skill)**,提供 PDF 文档的完整处理能力。基于 Python 库(pypdf、pdfplumber、reportlab)和命令行工具(qpdf、pdftotext、pdftk),支持文本提取、表格提取、合并拆分、旋转、水印、加密、表单填写和 OCR 识别。
|
||||
在 DesireCore 中,内置 `ExportDocument` 工具可以将 Markdown 文件转为 PDF。下文的 Python 库(pypdf、pdfplumber、reportlab)和命令行工具(qpdf、pdftotext、pdftk)用于内容提取、合并拆分、旋转、加水印、加密、填写表单、OCR 识别和其他 PDF 创建任务。
|
||||
|
||||
### 使用场景
|
||||
|
||||
- 用户需要从 PDF 中提取文本或表格数据
|
||||
- 用户需要合并多个 PDF 或拆分页面
|
||||
- 用户需要将 Markdown 文件导出为 PDF,或想知道哪个内置工具能转换
|
||||
- 用户需要创建新的 PDF 文档
|
||||
- 用户需要填写 PDF 表单、添加水印或加密
|
||||
|
||||
## L2:详细规范
|
||||
|
||||
### 将 Markdown 文件导出为 PDF
|
||||
|
||||
输入是现有的 UTF-8 Markdown 文件时,优先使用本次可用的 DesireCore 内置工具 `ExportDocument`。这条路径无需 Python 或 Shell 命令。
|
||||
|
||||
1. 已声明 `ExportDocument` 时,转换请求可直接调用 `ExportDocument(path="/work/report.md", format="pdf")`。用户只问哪个工具能转换 Markdown,或问本次是否可用时,告知用户 `ExportDocument` 可用。
|
||||
2. `ExportDocument` 尚未声明且 `ToolCatalog` 可用时,调用 `ToolCatalog(query="select:ExportDocument")`。用户只问可用性时,按查询结果答复。用户请求转换时,仅在目录确认已获授权且 `LoadTools` 可用的情况下,调用 `LoadTools(names=["ExportDocument"])`。工具声明后再调用 `ExportDocument`。
|
||||
|
||||
`path` 是输入文件的绝对路径或相对于当前工作目录的路径。用户指定 PDF 文件名或保存位置时传 `output`。省略后在源文件旁生成同名 PDF。要求目标必须是新建文件时传 `overwrite=false`。导出成功后,告知用户回执中的绝对路径。
|
||||
|
||||
如果 `ExportDocument` 尚未声明且 `ToolCatalog` 不可用,说明当前会话无法核实内置导出工具是否可用。内置转换无法进行时说明限制,仅在用户请求和本次权限允许的情况下采用其他方法。
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Python 3(必需)
|
||||
### Python 3(执行 Python 操作时需要)
|
||||
|
||||
在执行任何 Python 操作之前,先检测 Python 是否可用:
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
"i18n": {
|
||||
"zh-CN": {
|
||||
"name": "PDF 文档处理",
|
||||
"summary": "读取、创建、合并、拆分和填写 PDF 文档",
|
||||
"description": "Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. Use when 用户提到 PDF、读取PDF、合并PDF、拆分PDF、填写表单、加水印、提取文字、 扫描识别。"
|
||||
"summary": "导出 Markdown 为 PDF,读取、创建、合并、拆分和填写 PDF 文档",
|
||||
"description": "使用 DesireCore 内置 ExportDocument 将 Markdown 导出为 PDF,也可查询本次会话能否使用该工具。支持创建 PDF、提取文字、表格和图片、合并、拆分、旋转、添加水印、填写表单、加密和解密,以及扫描件 OCR。"
|
||||
},
|
||||
"en-US": {
|
||||
"name": "PDF Document Processing",
|
||||
"summary": "Read, create, merge, split, and fill PDF documents",
|
||||
"description": "Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. Use when the user mentions PDF, reading PDFs, merging PDFs, splitting PDFs, filling forms, adding watermarks, extracting text, or OCR."
|
||||
"summary": "Export Markdown to PDF and read, create, merge, split, and fill PDFs",
|
||||
"description": "Export Markdown to PDF with the built-in ExportDocument tool and check its availability in the current DesireCore session. Supports creating PDFs, extracting text, tables, and images, merging, splitting, rotation, watermarks, form filling, encryption and decryption, and OCR on scanned PDFs."
|
||||
}
|
||||
},
|
||||
"category": "productivity",
|
||||
@@ -29,14 +29,14 @@
|
||||
},
|
||||
"release": {
|
||||
"state": "known",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"versionScheme": "semver"
|
||||
},
|
||||
"timestamps": {
|
||||
"catalogUpdatedAt": {
|
||||
"state": "known",
|
||||
"value": "2026-05-04T16:26:33Z",
|
||||
"precision": "second"
|
||||
"value": "2026-12-06",
|
||||
"precision": "day"
|
||||
},
|
||||
"releasePublishedAt": {
|
||||
"state": "unknown"
|
||||
|
||||
Reference in new issue
Block a user