@deepseek-ai/dsh-skill-office 0.1.7-alpha.2 → 0.1.7-rc.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/README.i18n.yaml +2 -2
- package/README.md +8 -2
- package/README.zh.md +8 -2
- package/assets/office-docx/SKILL.md +14 -3
- package/assets/office-pptx/SKILL.md +14 -3
- package/assets/office-xlsx/SKILL.md +22 -4
- package/lib/index.js +21 -3
- package/lib/types/index.d.ts +4 -0
- package/package.json +4 -3
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/skill/skill-office/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 2e5bd0b007422a1923a5cff971c1e635b056ceea
|
|
6
|
+
README.zh.md: c2d6e22cdeafc7fb98721ffabcda45f2f9432f4a
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
Agents can load Word, PowerPoint, and Excel workflows that use the bundled Python environment by default and respect explicit user or AGENTS.md environment choices. The skills cover creation, focused edits, structural checks, and file delivery. Visual
|
|
12
|
+
Agents can load Word, PowerPoint, and Excel workflows that use the bundled Python environment by default and respect explicit user or AGENTS.md environment choices. The skills cover creation, focused edits, structural checks, and file delivery. When supplied by the environment, the LibreOffice Kit CLI directly renders selected pages or worksheet ranges, converts requested PDFs, and recalculates workbooks into new files. Visual QA requires image input support, reuses unchanged-source previews, and ends when applicable checks pass; ordinary delivery does not require installing a renderer.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -36,13 +36,19 @@ Mount this provider beside the skill registry and `dsh-tool-skill` to expose `of
|
|
|
36
36
|
| Field | Default | Meaning |
|
|
37
37
|
|---|---|---|
|
|
38
38
|
| `assetRoot` | Packaged `assets/` | Absolute resource directory containing the three skill folders and shared `scripts/`; deployments can place it outside an application archive. |
|
|
39
|
+
| `node` | Current standalone Node process | Absolute Node executable; Electron and SDK executables must supply a standalone Node. |
|
|
40
|
+
| `cli` | Installed kit’s `lib/cli.js` | Absolute CLI entry; `false` explicitly disables the CLI. |
|
|
39
41
|
|
|
40
42
|
Relative paths, missing resources, and skill files without a YAML frontmatter description reject activation. Disposing the plugin removes its candidates. Project and user skill precedence remains owned by the skill registry.
|
|
41
43
|
|
|
44
|
+
Loaded skills append an `Installed LibreOffice Kit` section with absolute `libreofficeKit.node` and `libreofficeKit.cli` paths. Agents use the bundled binaries unless the user explicitly opts out, passing the CLI as Node’s first argument without relying on the working directory or searching PATH. A bundled CLI failure is reported rather than replaced with a system executable. Activation checks both paths are files. npm deployments use their installed kit by default; Desktop supplies standalone Node and the complete unpacked Office dependencies; the Python SDK supplies standalone Node and its adjacent Office directory. Custom Python-only deployments must set `cli: false` or supply standalone Node.
|
|
45
|
+
|
|
42
46
|
### Structural checks
|
|
43
47
|
|
|
44
48
|
The shared Python checker reads DOCX, PPTX, or XLSX without modifying the source. It recognizes Transitional and Strict OOXML namespaces, validates ZIP/XML and internal package relationships, reports document structure, and optionally checks required text or slide/sheet count. DOCX text assertions cover the main body, section-referenced headers and footers, and body-referenced footnotes and endnotes; comments, glossary text, and unreferenced parts or notes do not satisfy them. It uses only the Python standard library. Invalid packages, corrupt or encrypted ZIP members, and report-file write failures produce a JSON failure report on stdout. A passing report does not establish appearance, feature preservation, or calculated formula results.
|
|
45
49
|
|
|
50
|
+
Excel data and formula tasks skip visual inspection; formatting, layout, chart appearance, printing, or known display problems require checking relevant regions. Basic styling does not itself trigger inspection, and formula recalculation and requested exports remain independent operations. Blank or transparent previews do not pass visual inspection. A failed preview ends visual checking without diagnostic workbooks, PDF conversion, or unrequested print-setting changes; the usable workbook is delivered with the inspection limitation.
|
|
51
|
+
|
|
46
52
|
-----
|
|
47
53
|
|
|
48
54
|
<a id="understand-the-implementation"></a>
|
|
@@ -85,7 +91,7 @@ Mounting the provider adds three catalog entries; loading a skill adds its body
|
|
|
85
91
|
|
|
86
92
|
<a id="known-limitations-and-deferred-work"></a>
|
|
87
93
|
|
|
88
|
-
- The provider does not install Python
|
|
94
|
+
- The provider depends on LibreOffice Kit but does not install Python or authoring libraries. The checker requires Python 3.9 or later.
|
|
89
95
|
- Structural checks do not judge pagination, clipping, fonts, chart appearance, or Excel recalculation.
|
|
90
96
|
- The checker accepts DOCX, PPTX, and XLSX only; legacy, encrypted, and macro-enabled formats require an appropriate separate workflow.
|
|
91
97
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
Agent(智能体)可以加载 Word、PowerPoint 和 Excel 工作流,默认使用内置 Python 环境,并遵循用户或 AGENTS.md 明确指定的环境。这些 skill
|
|
12
|
+
Agent(智能体)可以加载 Word、PowerPoint 和 Excel 工作流,默认使用内置 Python 环境,并遵循用户或 AGENTS.md 明确指定的环境。这些 skill(技能)涵盖创建、局部编辑、结构检查和文件交付。环境提供 LibreOffice Kit CLI 时,可直接渲染选定页面或工作表区域、转换所需 PDF,并将重新计算后的工作簿保存为新文件。视觉检查要求模型支持图片输入,复用源文件未变时的预览,并在适用检查通过后结束;普通交付不要求安装渲染器。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -36,13 +36,19 @@ Agent(智能体)可以加载 Word、PowerPoint 和 Excel 工作流,默认
|
|
|
36
36
|
| 字段 | 默认值 | 含义 |
|
|
37
37
|
|---|---|---|
|
|
38
38
|
| `assetRoot` | 包内的 `assets/` | 包含三个 skill 文件夹和共享 `scripts/` 的绝对资源目录;部署可将其放在应用归档之外。 |
|
|
39
|
+
| `node` | 当前独立 Node 进程 | Node 可执行文件的绝对路径;Electron 和独立 SDK 可执行文件必须显式提供。 |
|
|
40
|
+
| `cli` | 已安装 kit 的 `lib/cli.js` | CLI 入口的绝对路径;`false` 显式禁用 CLI。 |
|
|
39
41
|
|
|
40
42
|
相对路径、资源缺失或 skill 文件的 YAML frontmatter 缺少描述都会导致激活失败。卸载插件会移除其候选项。项目和用户 skill 的优先级仍由 skill 注册表负责。
|
|
41
43
|
|
|
44
|
+
加载的技能在 `Installed LibreOffice Kit` 段落中提供 `libreofficeKit.node` 和 `libreofficeKit.cli` 的绝对路径。除非用户明确要求不用内置二进制,Agent 将内置 CLI 作为 Node 的第一个参数运行,无需依赖工作目录或搜索 PATH。内置 CLI 失败时报告错误,不替换为系统可执行文件。激活时检查两个路径是否为实际文件。npm 部署默认使用已安装的 kit;Desktop 提供独立 Node 和 ASAR 外的完整 Office 依赖;Python SDK 提供独立 Node 和可执行文件旁的 Office 目录。仅有 Python 的自定义部署必须配置 `cli: false`,或提供独立 Node。
|
|
45
|
+
|
|
42
46
|
### 结构检查
|
|
43
47
|
|
|
44
48
|
共享 Python 检查器读取 DOCX、PPTX 或 XLSX,不修改源文件。它识别 Transitional 与 Strict OOXML 命名空间,验证 ZIP/XML 和包内引用关系,报告文档结构,并可检查必需文本或幻灯片/工作表数量。DOCX 文本断言覆盖正文、分节引用的页眉和页脚,以及正文引用的脚注和尾注;批注、词库文本与未引用的部件或脚注/尾注不能满足断言。它只使用 Python 标准库。无效包、损坏或加密的 ZIP 成员和报告文件写入失败都会在标准输出中产生 JSON 失败报告。检查通过不代表外观、特性保留或公式计算结果已得到验证。
|
|
45
49
|
|
|
50
|
+
Excel 数据和公式任务跳过视觉检查;涉及格式、排版、图表外观、打印或已知显示问题时,检查相关区域。基础样式设置本身不触发视觉检查,公式重算和用户要求的导出仍是独立操作。 空白或透明预览不能通过视觉检查。预览失败时结束视觉检查,不创建诊断工作簿、不转换 PDF,也不擅自修改打印设置;交付可用工作簿并说明检查限制。
|
|
51
|
+
|
|
46
52
|
-----
|
|
47
53
|
|
|
48
54
|
<a id="understand-the-implementation"></a>
|
|
@@ -85,7 +91,7 @@ Agent(智能体)可以加载 Word、PowerPoint 和 Excel 工作流,默认
|
|
|
85
91
|
|
|
86
92
|
<a id="known-limitations-and-deferred-work"></a>
|
|
87
93
|
|
|
88
|
-
-
|
|
94
|
+
- 提供方依赖 LibreOffice Kit,但不安装 Python 或编写库。检查器要求 Python 3.9 或更高版本。
|
|
89
95
|
- 结构检查不判断分页、裁切、字体、图表外观或 Excel 重算。
|
|
90
96
|
- 检查器只接受 DOCX、PPTX 和 XLSX;传统格式、加密文件和启用宏的格式需要合适的其他工作流。
|
|
91
97
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: office-docx
|
|
3
|
-
description: Create, read, edit, and check Word documents (.docx), including reports, letters, and formatted tables. Use when a DOCX file is an input or requested deliverable.
|
|
3
|
+
description: Create, read, edit, and check Word documents (.docx), including reports, letters, and formatted tables. Use when a DOCX file is an input or requested deliverable. Load this skill before running Office commands. Use only bundled LibreOffice unless the user explicitly opts out; without that opt-out, do not search for another LibreOffice executable.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Word documents
|
|
@@ -39,8 +39,19 @@ Run the shared checker with the selected Python executable; `<skill-directory>`
|
|
|
39
39
|
|
|
40
40
|
It checks ZIP/XML integrity and internal relationships, and reports paragraphs, logical table dimensions, and sections. Optional `--contains TEXT` arguments assert required text. A successful structural check does not verify pagination, clipping, fonts, or visual appearance. Compare the summary and reopened document with the user's request, including unchanged content that matters to an edit.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Render for a requested image/PDF deliverable or an actionable layout check. Before generating images only for inspection, establish that the current model accepts images. If image input is unavailable, finish structural and content checks and state that visual layout was not inspected; do not generate unreadable previews, retry `read_image`, or choose a second model.
|
|
43
43
|
|
|
44
|
-
Use the
|
|
44
|
+
Use the bundled LibreOffice binaries unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If the bundled CLI is unavailable or fails, report that failure instead of substituting another executable.
|
|
45
|
+
|
|
46
|
+
Use the `libreofficeKit.node` and `libreofficeKit.cli` absolute paths supplied in the loaded skill's **Installed LibreOffice Kit** section. Run Node with the CLI entry as its first argument, then `capabilities --json` once. For the bundled runtime, these paths work from the task directory; do not search PATH, guess a package directory, use `npx`, or install a renderer. Quote each path separately; PowerShell also requires the `&` invocation operator. The examples below use `<node>` and `<cli>` for those two returned paths. Direct rendering avoids an intermediate PDF:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
"<node>" "<cli>" render --input report.docx --output-dir preview-v1 --pages 1,3 --dpi 144
|
|
50
|
+
"<node>" "<cli>" convert --input report.docx --output report.pdf
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Choose pages relevant to the requested edit; inspect all pages when whole-document layout is required. Batch selected pages in one call and use the returned manifest's page count, image paths, and missing-font diagnostics. Output directories and converted files must be new. Reuse images for the same saved document; render again only after a source change, for an unrendered page, or to diagnose a concrete failure. Check page breaks, clipped text, headings, and table widths. Do not repeatedly export unchanged documents or infer visual overflow solely from guessed text geometry.
|
|
54
|
+
|
|
55
|
+
If this deployment explicitly disables the CLI but `render_document` is provided, use it without `pages` first and read its returned images only on a ready result; `status: "skipped"` ends visual checking. If neither renderer is available or rendering fails, preserve the usable source and report the inspection limit. Do not search for COM automation, install conversion packages, or build another rendering pipeline for routine QA. LibreOffice pagination can differ from Microsoft Word. Once the requested content and applicable checks pass, deliver the document.
|
|
45
56
|
|
|
46
57
|
Call `present({"files":[{"path":"report.docx"}]})` with the actual final DOCX path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and do not present temporary QA reports unless requested. If `present` is unavailable, provide the final workspace path using the session's supported file delivery method.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: office-pptx
|
|
3
|
-
description: Create, read, edit, and check PowerPoint presentations (.pptx), including slide text, tables, images, and charts. Use when a PPTX file is an input or requested deliverable.
|
|
3
|
+
description: Create, read, edit, and check PowerPoint presentations (.pptx), including slide text, tables, images, and charts. Use when a PPTX file is an input or requested deliverable. Load this skill before running Office commands. Use only bundled LibreOffice unless the user explicitly opts out; without that opt-out, do not search for another LibreOffice executable.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PowerPoint presentations
|
|
@@ -63,8 +63,19 @@ Run the shared checker with the selected Python executable; `<skill-directory>`
|
|
|
63
63
|
|
|
64
64
|
It checks ZIP/XML integrity and internal relationships and reports slide count and extracted text. Use repeated `--contains TEXT` arguments for required slide text and `--count N` for a requested slide count; `--contains` excludes chart text and speaker notes. Reopen the file to check the requested edits, chart data, and notes. Structural success does not establish text fit, alignment, readable contrast, or rendering fidelity.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Render for requested images/PDFs or an actionable layout check. Before generating images only for inspection, establish that the current model accepts images. If it does not, finish structural and content checks and state that visual layout was not inspected; do not rasterize slides the model cannot read, retry `read_image`, or choose a second model.
|
|
67
67
|
|
|
68
|
-
Use the
|
|
68
|
+
Use the bundled LibreOffice binaries unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If the bundled CLI is unavailable or fails, report that failure instead of substituting another executable.
|
|
69
|
+
|
|
70
|
+
Use the `libreofficeKit.node` and `libreofficeKit.cli` absolute paths supplied in the loaded skill's **Installed LibreOffice Kit** section. Run Node with the CLI entry as its first argument, then `capabilities --json` once. For the bundled runtime, these paths work from the task directory; do not search PATH, guess a package directory, use `npx`, or install a renderer. Quote each path separately; PowerShell also requires the `&` invocation operator. The examples below use `<node>` and `<cli>` for those two returned paths. Render slides directly:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
"<node>" "<cli>" render --input report.pptx --output-dir preview-v1 --pages 1,3,4 --dpi 144
|
|
74
|
+
"<node>" "<cli>" convert --input report.pptx --output report.pdf
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Batch affected slides in one call; inspect every slide for a new deck or a whole-deck design review. Read the returned manifest and selected image paths, including missing-font diagnostics. Outputs must be new directories/files. Retain and reuse previews for the same saved source; rerender only after edits, for missing slides, or to diagnose a concrete failure. Check clipping, alignment, contrast, and chart labels. Do not substitute guessed geometry for visual evidence or repeat successful exports of unchanged slides.
|
|
78
|
+
|
|
79
|
+
If this deployment explicitly disables the CLI but `render_document` is provided, call it without `pages` first and inspect images only on a ready result; `status: "skipped"` ends visual checking. If rendering is unavailable or fails, retain the usable source and report the inspection limit. Do not search for COM automation, install conversion packages, or build another renderer for routine QA. LibreOffice previews do not certify pixel-identical PowerPoint or Keynote output, animation, or media playback. Deliver once the requested content and applicable checks pass.
|
|
69
80
|
|
|
70
81
|
Call `present({"files":[{"path":"report-edited.pptx"}]})` with the actual final PPTX path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and leave intermediate images and reports out of delivery unless requested. If `present` is unavailable, use the session's supported file delivery method.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: office-xlsx
|
|
3
|
-
description: Read, create, and modify Excel workbooks (.xlsx), including
|
|
3
|
+
description: Read, create, and modify Excel workbooks (.xlsx), including data, formulas, formatting, and pandas analysis. Use for Excel inputs or deliverables. Load before running Office commands. Data and formula tasks skip visual inspection; inspect only for formatting or layout needs. Use only bundled LibreOffice unless the user explicitly opts out; without that opt-out, do not search for another LibreOffice executable.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Excel workbooks
|
|
@@ -35,7 +35,7 @@ workbook.save("report.xlsx")
|
|
|
35
35
|
|
|
36
36
|
Preserve numbers, dates, booleans, and identifiers as the intended cell types; formatting is not a type conversion. For modifications, load the existing file with `openpyxl.load_workbook("input.xlsx", data_only=False)`, change the requested ranges, and save a separate result. Avoid a DataFrame round trip when workbook features must survive.
|
|
37
37
|
|
|
38
|
-
Writing a formula does not calculate its result. openpyxl and XlsxWriter do not evaluate Excel formulas; `data_only=True` returns stored cached values that may be absent or stale.
|
|
38
|
+
Writing a formula does not calculate its result. openpyxl and XlsxWriter do not evaluate Excel formulas; `data_only=True` returns stored cached values that may be absent or stale. Read the installed CLI paths and capabilities as described below. When it supports `recalculate`, use `"<node>" "<cli>" recalculate --input report.xlsx --output recalculated.xlsx` to save formulas and refreshed cached results to a new workbook. Reopen that result with both `data_only=False` and `data_only=True` to check formulas and calculated values against the requested logic. Recalculation does not validate business logic or guarantee Excel-specific feature compatibility. Without a recalculation engine, state the limit; do not replace requested formulas with constants or report old cached values as newly calculated results.
|
|
39
39
|
|
|
40
40
|
Do not rename `.xls`, `.xlsb`, encrypted files, or macro-enabled files to `.xlsx`. They need an appropriate supported operation. `keep_vba=True` can preserve VBA package content in an XLSM workflow, but does not execute or edit macros and does not guarantee every advanced workbook feature survives. Preserve the original and verify such requirements explicitly.
|
|
41
41
|
|
|
@@ -49,8 +49,26 @@ Run the shared checker with the selected Python executable; `<skill-directory>`
|
|
|
49
49
|
|
|
50
50
|
It checks ZIP/XML integrity and internal relationships, and reports sheet names, populated-cell counts, and formula counts. Repeated `--contains TEXT` arguments check string cells and sheet names, and `--count N` checks sheet count. `--contains` excludes numeric cells and does not validate formula results; verify those separately with openpyxl. The checker does not calculate formulas or judge workbook appearance. Compare relevant values, types, formulas, styles, and totals with the task's source data.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
For data and formula tasks, deliver after structural and data checks pass. Skip preview rendering and visual inspection, and do not add an unrequested caveat that visual inspection was omitted. Basic styling such as bold headers or number formats does not itself require visual inspection. Formula recalculation is independent of rendering and remains necessary when calculated results must be refreshed.
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Inspect relevant regions when the task concerns formatting, layout, chart appearance, print layout, or a known display problem. Before generating inspection images, establish that the current model accepts images. If it does not, finish structural and data checks and report the requested visual check as unavailable; do not rasterize unreadable previews, retry `read_image`, or choose a second model. Export requested images or PDFs even when visual inspection is unnecessary.
|
|
55
|
+
|
|
56
|
+
A successful command or image read does not prove that a preview contains workbook content. For a populated range, a fully transparent or uniformly blank image is a renderer failure, not evidence that the workbook needs fixing. Stop all visual QA for that workbook immediately; do not try a wider range, another sheet, a different DPI, or another output format. Check suspicious previews with the bundled Pillow library, compositing RGBA onto white before comparing pixels. Do not create diagnostic workbooks, repeatedly retry rendering, modify print settings, or convert to PDF solely to investigate a failed preview. Preserve the requested workbook changes, finish structural and data checks, and report the visual check as unavailable. Only change print areas or scaling when the user requests printed layout.
|
|
57
|
+
|
|
58
|
+
## LibreOffice operations
|
|
59
|
+
|
|
60
|
+
Use the bundled LibreOffice binaries unless the user explicitly asks not to use them. Without that explicit opt-out, never search for or invoke system LibreOffice, `soffice`, an application-installed binary, or a downloaded replacement. If the bundled CLI is unavailable or fails, report that failure instead of substituting another executable.
|
|
61
|
+
|
|
62
|
+
When recalculation, a requested export, or visual inspection is needed, use the `libreofficeKit.node` and `libreofficeKit.cli` absolute paths supplied in the loaded skill's **Installed LibreOffice Kit** section. Run Node with the CLI entry as its first argument, then `capabilities --json` once. For the bundled runtime, these paths work from the task directory; do not search PATH, guess a package directory, use `npx`, or install a renderer. Quote each path separately; PowerShell also requires the `&` invocation operator. The examples below use `<node>` and `<cli>` for those two returned paths. For worksheet rendering, select an exact sheet name and the relevant cell range:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
"<node>" "<cli>" render --input report.xlsx --output-dir preview-v1 --sheet Summary --range A1:D20 --dpi 144
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For a user-requested PDF export, use `"<node>" "<cli>" convert --input report.xlsx --output report.pdf`. PDF conversion is not a fallback for failed visual QA.
|
|
69
|
+
|
|
70
|
+
Use `--sheet`/`--range` for worksheets, not `--pages`. Direct worksheet images cover cell regions; PDF pages follow print settings and are not worksheet numbers. Include chart/drawing regions explicitly. Read the manifest's image paths, fragment rectangles, and missing-font diagnostics; large regions may split across images. Outputs must be new directories/files. Reuse previews for the same saved workbook and inspect additional regions only when needed. Check widths, formats, clipping, and charts; set print areas/scaling when printed layout is requested. Render each relevant region once. Rerender only after requested source changes; an empty or failed preview ends visual checking for the whole workbook.
|
|
71
|
+
|
|
72
|
+
When visual inspection is needed and this deployment explicitly disables the CLI but provides `render_document`, call it without `pages` first and inspect returned images only on a ready result; `status: "skipped"` ends visual checking. If required rendering is unavailable or fails, preserve the usable workbook and report the inspection or export limit. Do not search for COM automation, install conversion packages, or build another renderer for routine QA. Preview rendering does not refresh the original workbook's formula caches or certify native Excel appearance. Deliver once the requested data and applicable checks pass.
|
|
55
73
|
|
|
56
74
|
Call `present({"files":[{"path":"report.xlsx"}]})` with the actual final workbook path. It exposes the current source file without copying or preserving its bytes, so keep that file in place and omit intermediate scripts and reports unless requested. If `present` is unavailable, use the session's supported file delivery method.
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { isAbsolute, join } from "node:path";
|
|
3
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
4
|
+
import { isSea } from "node:sea";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
import z from "@deepseek-ai/schemastery";
|
|
6
7
|
import { BUNDLED_SKILL_RANK } from "@deepseek-ai/dsh-skill";
|
|
@@ -13,7 +14,11 @@ const SKILL_NAMES = [
|
|
|
13
14
|
"office-xlsx"
|
|
14
15
|
];
|
|
15
16
|
/** Validated resource configuration. */
|
|
16
|
-
const Config = z.object({
|
|
17
|
+
const Config = z.object({
|
|
18
|
+
assetRoot: z.string().min(1),
|
|
19
|
+
node: z.string().min(1),
|
|
20
|
+
cli: z.union([z.string().min(1), z.const(false)])
|
|
21
|
+
});
|
|
17
22
|
/** Cordis plugin identity. */
|
|
18
23
|
const name = "skill-office";
|
|
19
24
|
/** Registry used by the bundled provider. */
|
|
@@ -29,6 +34,18 @@ function parseSkill(raw, path) {
|
|
|
29
34
|
content: raw.slice(frontmatter[0].length).trim()
|
|
30
35
|
};
|
|
31
36
|
}
|
|
37
|
+
function officeRuntime(config) {
|
|
38
|
+
if (config.cli === false) return "\n\nLibreOffice Kit is disabled in this deployment.";
|
|
39
|
+
if (config.node === void 0 && (isSea() || process.versions.electron !== void 0)) throw new Error("skill-office: packaged applications must supply a standalone Node executable");
|
|
40
|
+
const node = config.node ?? process.execPath;
|
|
41
|
+
let cli = config.cli;
|
|
42
|
+
if (cli === void 0) cli = join(dirname(fileURLToPath(import.meta.resolve("@deepseek-ai/libreoffice-kit/package.json"))), "lib", "cli.js");
|
|
43
|
+
for (const path of [node, cli]) if (!isAbsolute(path) || !statSync(path).isFile()) throw new Error(`skill-office: expected an absolute executable file: ${path}`);
|
|
44
|
+
return `\n\n## Installed LibreOffice Kit\n\nUse these absolute paths for every LibreOffice Kit command. Pass the CLI entry as the first argument to Node.\n\n${JSON.stringify({ libreofficeKit: {
|
|
45
|
+
node,
|
|
46
|
+
cli
|
|
47
|
+
} }, void 0, 2)}`;
|
|
48
|
+
}
|
|
32
49
|
/**
|
|
33
50
|
* Register Office skills with resources readable by the script interpreter.
|
|
34
51
|
* @param ctx - Context carrying the skill registry.
|
|
@@ -38,6 +55,7 @@ function apply(ctx, config = {}) {
|
|
|
38
55
|
const assetRoot = config.assetRoot ?? fileURLToPath(new URL("../assets/", import.meta.url));
|
|
39
56
|
if (!isAbsolute(assetRoot)) throw new Error("skill-office: assetRoot must be an absolute directory");
|
|
40
57
|
if (!statSync(join(assetRoot, "scripts", "check_office.py")).isFile()) throw new Error("skill-office: assets must contain scripts/check_office.py");
|
|
58
|
+
const runtime = officeRuntime(config);
|
|
41
59
|
const candidates = SKILL_NAMES.map((skillName) => {
|
|
42
60
|
const directory = join(assetRoot, skillName);
|
|
43
61
|
const path = join(directory, "SKILL.md");
|
|
@@ -70,7 +88,7 @@ function apply(ctx, config = {}) {
|
|
|
70
88
|
});
|
|
71
89
|
return {
|
|
72
90
|
...summary,
|
|
73
|
-
content: parseSkill(raw, locator).content
|
|
91
|
+
content: parseSkill(raw, locator).content + runtime
|
|
74
92
|
};
|
|
75
93
|
}
|
|
76
94
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import z from '@deepseek-ai/schemastery';
|
|
|
5
5
|
export interface Config {
|
|
6
6
|
/** Absolute assets directory containing the three skill folders and shared scripts; defaults to packaged assets. */
|
|
7
7
|
assetRoot?: string;
|
|
8
|
+
/** Standalone Node executable; defaults to the current executable outside Electron and SEA. */
|
|
9
|
+
node?: string;
|
|
10
|
+
/** Absolute LibreOffice Kit CLI entry; false explicitly disables CLI access. */
|
|
11
|
+
cli?: string | false;
|
|
8
12
|
}
|
|
9
13
|
/** Validated resource configuration. */
|
|
10
14
|
export declare const Config: z<Config>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-skill-office",
|
|
3
3
|
"description": "Bundled Word, PowerPoint, and Excel workflows and structural checks",
|
|
4
|
-
"version": "0.1.7-
|
|
4
|
+
"version": "0.1.7-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,16 +27,17 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-skill": "0.1.7-
|
|
30
|
+
"@deepseek-ai/dsh-skill": "0.1.7-rc.1",
|
|
31
31
|
"@deepseek-ai/cordis": "~4.0.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@deepseek-ai/dsh-skill": "0.1.7-
|
|
34
|
+
"@deepseek-ai/dsh-skill": "0.1.7-rc.1",
|
|
35
35
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
36
36
|
"@deepseek-ai/cordis-plugin-loader": "~1.0.5",
|
|
37
37
|
"@deepseek-ai/cordis-plugin-include": "~1.0.9"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@deepseek-ai/libreoffice-kit": "^0.1.0",
|
|
40
41
|
"yaml": "^2.4.2",
|
|
41
42
|
"@deepseek-ai/schemastery": "~3.18.4"
|
|
42
43
|
}
|