dsh-office-kit 0.1.0 → 0.3.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/CAPABILITY.md +147 -68
- package/LICENSE.md +21 -21
- package/README.md +108 -106
- package/assets/skills/excel-live-control/SKILL.md +234 -0
- package/assets/skills/excel-live-control/container_tools/live_excel.py +1589 -0
- package/assets/skills/excel-live-control/domain_guidance/financial_models.md +86 -0
- package/assets/skills/excel-live-control/domain_guidance/healthcare.md +58 -0
- package/assets/skills/excel-live-control/domain_guidance/marketing_advertising.md +53 -0
- package/assets/skills/excel-live-control/domain_guidance/scientific_research.md +53 -0
- package/assets/skills/excel-live-control/references/office-automation.md +207 -0
- package/assets/skills/excel-live-control/references/read_only_qna.md +59 -0
- package/assets/skills/excel-live-control/style_guidelines.md +87 -0
- package/assets/skills/excel-live-control/workflows/create_workflows.md +78 -0
- package/assets/skills/excel-live-control/workflows/edit_workflows.md +72 -0
- package/assets/skills/office-documents/SKILL.md +90 -77
- package/assets/skills/office-documents/examples/end_to_end_smoke_test.md +86 -0
- package/assets/skills/office-documents/ooxml/comments.md +40 -0
- package/assets/skills/office-documents/ooxml/hyperlinks_and_fields.md +66 -0
- package/assets/skills/office-documents/ooxml/rels_and_content_types.md +62 -0
- package/assets/skills/office-documents/ooxml/tracked_changes.md +53 -0
- package/assets/skills/office-documents/references/docx-structure.md +83 -0
- package/assets/skills/office-documents/references/template-elicitation.md +49 -0
- package/assets/skills/office-documents/references/writing-quality.md +49 -0
- package/assets/skills/office-documents/render_docx.py +92 -0
- package/assets/skills/office-documents/scripts/a11y_audit.py +194 -0
- package/assets/skills/office-documents/scripts/accept_tracked_changes.py +151 -0
- package/assets/skills/office-documents/scripts/add_tracked_replacements.py +148 -0
- package/assets/skills/office-documents/scripts/append_blocks.py +108 -0
- package/assets/skills/office-documents/scripts/apply_template_styles.py +104 -0
- package/assets/skills/office-documents/scripts/captions_and_crossrefs.py +102 -0
- package/assets/skills/office-documents/scripts/comments_add.py +136 -0
- package/assets/skills/office-documents/scripts/comments_apply_patch.py +114 -0
- package/assets/skills/office-documents/scripts/comments_extract.py +85 -0
- package/assets/skills/office-documents/scripts/comments_strip.py +74 -0
- package/assets/skills/office-documents/scripts/content_controls.py +192 -0
- package/assets/skills/office-documents/scripts/core_properties.py +124 -0
- package/assets/skills/office-documents/scripts/docx_kit.py +587 -0
- package/assets/skills/office-documents/scripts/docx_ooxml_patch.py +225 -0
- package/assets/skills/office-documents/scripts/docx_table_to_csv.py +99 -0
- package/assets/skills/office-documents/scripts/fields_materialize.py +66 -0
- package/assets/skills/office-documents/scripts/fields_report.py +59 -0
- package/assets/skills/office-documents/scripts/flatten_ref_fields.py +62 -0
- package/assets/skills/office-documents/scripts/footnotes_report.py +77 -0
- package/assets/skills/office-documents/scripts/google_docs_title_sanitize.py +96 -0
- package/assets/skills/office-documents/scripts/heading_audit.py +81 -0
- package/assets/skills/office-documents/scripts/images_audit.py +80 -0
- package/assets/skills/office-documents/scripts/insert_note.py +126 -0
- package/assets/skills/office-documents/scripts/insert_ref_fields.py +90 -0
- package/assets/skills/office-documents/scripts/insert_toc.py +84 -0
- package/assets/skills/office-documents/scripts/internal_nav.py +146 -0
- package/assets/skills/office-documents/scripts/make_fixtures.py +169 -0
- package/assets/skills/office-documents/scripts/merge_docx_append.py +239 -0
- package/assets/skills/office-documents/scripts/privacy_scrub.py +131 -0
- package/assets/skills/office-documents/scripts/redact_docx.py +113 -0
- package/assets/skills/office-documents/scripts/render_and_diff.py +101 -0
- package/assets/skills/office-documents/scripts/replace_text.py +154 -0
- package/assets/skills/office-documents/scripts/section_audit.py +91 -0
- package/assets/skills/office-documents/scripts/set_protection.py +92 -0
- package/assets/skills/office-documents/scripts/style_lint.py +111 -0
- package/assets/skills/office-documents/scripts/style_normalize.py +103 -0
- package/assets/skills/office-documents/scripts/table_geometry.py +167 -0
- package/assets/skills/office-documents/scripts/watermark_add.py +48 -0
- package/assets/skills/office-documents/scripts/watermark_audit_remove.py +67 -0
- package/assets/skills/office-documents/scripts/xlsx_to_docx_table.py +117 -0
- package/assets/skills/office-documents/tasks/accessibility_a11y.md +45 -0
- package/assets/skills/office-documents/tasks/captions_crossrefs.md +49 -0
- package/assets/skills/office-documents/tasks/clean_tracked_changes.md +49 -0
- package/assets/skills/office-documents/tasks/comments_manage.md +59 -0
- package/assets/skills/office-documents/tasks/compare_diff.md +40 -0
- package/assets/skills/office-documents/tasks/create_edit.md +107 -0
- package/assets/skills/office-documents/tasks/equations.md +59 -0
- package/assets/skills/office-documents/tasks/fields_update.md +44 -0
- package/assets/skills/office-documents/tasks/fixtures_edge_cases.md +50 -0
- package/assets/skills/office-documents/tasks/footnotes_endnotes.md +38 -0
- package/assets/skills/office-documents/tasks/forms_content_controls.md +48 -0
- package/assets/skills/office-documents/tasks/headings_numbering.md +55 -0
- package/assets/skills/office-documents/tasks/images_figures.md +63 -0
- package/assets/skills/office-documents/tasks/multi_doc_merge.md +43 -0
- package/assets/skills/office-documents/tasks/navigation_internal_links.md +38 -0
- package/assets/skills/office-documents/tasks/privacy_scrub_metadata.md +45 -0
- package/assets/skills/office-documents/tasks/protection_restrict_editing.md +41 -0
- package/assets/skills/office-documents/tasks/read_review.md +50 -0
- package/assets/skills/office-documents/tasks/redaction_anonymization.md +42 -0
- package/assets/skills/office-documents/tasks/sections_layout.md +54 -0
- package/assets/skills/office-documents/tasks/style_lint_normalize.md +44 -0
- package/assets/skills/office-documents/tasks/tables_spreadsheets.md +64 -0
- package/assets/skills/office-documents/tasks/templates_style_packs.md +53 -0
- package/assets/skills/office-documents/tasks/toc_workflow.md +39 -0
- package/assets/skills/office-documents/tasks/verify_render.md +50 -0
- package/assets/skills/office-documents/tasks/watermarks_background.md +35 -0
- package/assets/skills/office-documents/troubleshooting/libreoffice_headless.md +47 -0
- package/assets/skills/office-documents/troubleshooting/run_splitting.md +36 -0
- package/assets/skills/office-pdf/SKILL.md +73 -56
- package/assets/skills/office-pdf/references/form-fields.md +56 -0
- package/assets/skills/office-pdf/references/geometry.md +44 -0
- package/assets/skills/office-pdf/references/layout-quality.md +41 -0
- package/assets/skills/office-pdf/references/limits.md +58 -0
- package/assets/skills/office-pdf/scripts/extract_text.py +172 -0
- package/assets/skills/office-pdf/scripts/forms.py +556 -0
- package/assets/skills/office-pdf/scripts/metadata.py +161 -0
- package/assets/skills/office-pdf/scripts/page_ops.py +198 -0
- package/assets/skills/office-pdf/scripts/redact_region.py +347 -0
- package/assets/skills/office-pdf/scripts/render_pages.py +207 -0
- package/assets/skills/office-pdf/scripts/split_pages.py +155 -0
- package/assets/skills/office-pdf/scripts/stamp_overlay.py +199 -0
- package/assets/skills/office-pdf/tasks/annotations.md +98 -0
- package/assets/skills/office-pdf/tasks/create.md +75 -0
- package/assets/skills/office-pdf/tasks/edit-pages.md +71 -0
- package/assets/skills/office-pdf/tasks/forms.md +67 -0
- package/assets/skills/office-pdf/tasks/read.md +62 -0
- package/assets/skills/office-pdf/tasks/redact.md +72 -0
- package/assets/skills/office-pdf/tasks/stamp.md +60 -0
- package/assets/skills/office-presentations/SKILL.md +141 -87
- package/assets/skills/office-presentations/container_tools/add_slides.py +136 -0
- package/assets/skills/office-presentations/container_tools/core_properties.py +120 -0
- package/assets/skills/office-presentations/container_tools/create_montage.py +126 -0
- package/assets/skills/office-presentations/container_tools/inspect_presentation_layout_geometry.py +285 -0
- package/assets/skills/office-presentations/container_tools/inspect_presentation_package_integrity.py +157 -0
- package/assets/skills/office-presentations/container_tools/native_chart_title_gate.py +144 -0
- package/assets/skills/office-presentations/container_tools/native_quantitative_chart_gate.py +199 -0
- package/assets/skills/office-presentations/container_tools/native_table_arithmetic_gate.py +212 -0
- package/assets/skills/office-presentations/container_tools/ooxml_helpers.py +345 -0
- package/assets/skills/office-presentations/container_tools/preview_render.py +375 -0
- package/assets/skills/office-presentations/container_tools/render_slides.py +139 -0
- package/assets/skills/office-presentations/container_tools/replace_text.py +168 -0
- package/assets/skills/office-presentations/container_tools/template_source_fidelity_gate.py +229 -0
- package/assets/skills/office-presentations/domain_guidance/finance.md +66 -0
- package/assets/skills/office-presentations/recipes/README.md +71 -0
- package/assets/skills/office-presentations/recipes/autolayout.md +88 -0
- package/assets/skills/office-presentations/recipes/connectors.md +83 -0
- package/assets/skills/office-presentations/recipes/images.md +80 -0
- package/assets/skills/office-presentations/recipes/master-and-layouts.md +127 -0
- package/assets/skills/office-presentations/recipes/native-charts.md +87 -0
- package/assets/skills/office-presentations/recipes/rich-text-runs.md +86 -0
- package/assets/skills/office-presentations/recipes/speaker-notes.md +65 -0
- package/assets/skills/office-presentations/recipes/tables.md +88 -0
- package/assets/skills/office-presentations/recipes/textbox-at-coordinate.md +71 -0
- package/assets/skills/office-presentations/recipes/theme-tokens.md +87 -0
- package/assets/skills/office-presentations/references/authoring-workflow.md +65 -0
- package/assets/skills/office-presentations/references/finalization.md +63 -0
- package/assets/skills/office-presentations/references/native-bullets.md +78 -0
- package/assets/skills/office-presentations/references/native-evidence.md +67 -0
- package/assets/skills/office-presentations/references/style-guidelines.md +66 -0
- package/assets/skills/office-presentations/references/templates.md +76 -0
- package/assets/skills/office-presentations/routing/google_slides.md +45 -0
- package/assets/skills/office-presentations/tasks/apply-annotations.md +83 -0
- package/assets/skills/office-presentations/tasks/charts-tables-notes.md +79 -0
- package/assets/skills/office-presentations/tasks/create-deck.md +106 -0
- package/assets/skills/office-presentations/tasks/edit-deck.md +93 -0
- package/assets/skills/office-presentations/tasks/inspect-and-verify.md +107 -0
- package/assets/skills/office-presentations/tasks/template-following.md +132 -0
- package/assets/skills/office-presentations/template_following_scripts/check_template_fidelity.py +176 -0
- package/assets/skills/office-presentations/template_following_scripts/inspect_template_deck.py +154 -0
- package/assets/skills/office-presentations/template_following_scripts/make_contact_sheet.py +111 -0
- package/assets/skills/office-presentations/template_following_scripts/prepare_template_starter_deck.py +239 -0
- package/assets/skills/office-presentations/template_following_scripts/validate_template_plan.py +185 -0
- package/assets/skills/office-spreadsheets/SKILL.md +105 -101
- package/assets/skills/office-spreadsheets/container_tools/add_chart.py +236 -0
- package/assets/skills/office-spreadsheets/container_tools/add_image.py +107 -0
- package/assets/skills/office-spreadsheets/container_tools/append_rows.py +122 -0
- package/assets/skills/office-spreadsheets/container_tools/diff_workbooks.py +306 -0
- package/assets/skills/office-spreadsheets/container_tools/inspect_workbook.py +398 -0
- package/assets/skills/office-spreadsheets/container_tools/recalc_gate.py +275 -0
- package/assets/skills/office-spreadsheets/container_tools/set_cells.py +135 -0
- package/assets/skills/office-spreadsheets/container_tools/sheet_ops.py +134 -0
- package/assets/skills/office-spreadsheets/container_tools/style_cells.py +133 -0
- package/assets/skills/office-spreadsheets/recipes/charts.md +66 -0
- package/assets/skills/office-spreadsheets/recipes/conditional-formats.md +69 -0
- package/assets/skills/office-spreadsheets/recipes/data-tables.md +58 -0
- package/assets/skills/office-spreadsheets/recipes/named-ranges.md +41 -0
- package/assets/skills/office-spreadsheets/recipes/number-formats.md +72 -0
- package/assets/skills/office-spreadsheets/recipes/sparklines.md +43 -0
- package/assets/skills/office-spreadsheets/references/charts.md +63 -0
- package/assets/skills/office-spreadsheets/references/domain/financial-models.md +40 -0
- package/assets/skills/office-spreadsheets/references/domain/healthcare.md +22 -0
- package/assets/skills/office-spreadsheets/references/domain/marketing.md +28 -0
- package/assets/skills/office-spreadsheets/references/domain/research.md +22 -0
- package/assets/skills/office-spreadsheets/references/formula-patterns.md +78 -0
- package/assets/skills/office-spreadsheets/references/style-guidelines.md +69 -0
- package/assets/skills/office-spreadsheets/references/workbook-structure.md +60 -0
- package/assets/skills/office-spreadsheets/routing/google-sheets.md +36 -0
- package/assets/skills/office-spreadsheets/tasks/analyze-workbook.md +37 -0
- package/assets/skills/office-spreadsheets/tasks/annotations.md +51 -0
- package/assets/skills/office-spreadsheets/tasks/create-workbook.md +66 -0
- package/assets/skills/office-spreadsheets/tasks/diff-workbooks.md +38 -0
- package/assets/skills/office-spreadsheets/tasks/edit-workbook.md +69 -0
- package/assets/skills/office-spreadsheets/tasks/inspect-workbook.md +38 -0
- package/assets/skills/office-spreadsheets/tasks/recalc-and-check.md +57 -0
- package/assets/skills/shared/annotation-recipes.md +252 -0
- package/assets/skills/shared/check_runtime.py +253 -0
- package/assets/skills/shared/common-workflow.md +139 -0
- package/assets/skills/shared/scripts/ensure_raster_image.py +187 -0
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/index.js +239 -89
- package/package.json +146 -149
- package/postinstall.mjs +92 -82
- package/python/office_cli.py +171 -246
package/CAPABILITY.md
CHANGED
|
@@ -1,75 +1,154 @@
|
|
|
1
1
|
# Capability report
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Capability trace
|
|
6
|
-
|
|
7
|
-
| User capability | Original mechanism | DSH execution chain | Acceptance | State |
|
|
8
|
-
| --- | --- | --- | --- | --- |
|
|
9
|
-
| Create a DOCX report | `documents` skill; Python OOXML scripts; `mark_artifact_operation_started.mjs` | `/documents` chip → `office-documents` skill → `office_status` → `office_cli.py docx create/edit` (python-docx, OMML) → Word/LibreOffice render → PNG inspection | Create with headings, lists, table, image, equation, header/footer; read back counts; edit text and append section; equation survives; rendered page inspected | Supported |
|
|
10
|
-
| Read a DOCX | Same skill | `docx read` → JSON counts/text/tables/images | Counts and text match the created document | Supported |
|
|
11
|
-
| Create a PDF | `pdf` skill; reportlab/pdfplumber/pypdf | `/pdf` chip → `office-pdf` skill → `office_cli.py pdf create/read/edit/render` | Chinese text embeds with registered CJK font; read extracts text; metadata edit; PyMuPDF render inspected | Supported |
|
|
12
|
-
| Inspect a PDF | Same | `pdf read` → page count, text, metadata, form fields | Page count and Chinese/English text extracted | Supported |
|
|
13
|
-
| Edit a PDF | Same | `pdf edit` → metadata, rotate, merge, remove pages | Metadata edit and read-back verified | Supported |
|
|
14
|
-
| Create/edit a PPTX | `presentations` skill; `@oai/artifact-tool` | `/presentations` chip → `office-presentations` skill → `office_cli.py pptx create/edit` (python-pptx) → PowerPoint/LibreOffice render | Three slides with bullets, table, chart, image; edit text and append a slide; four rendered pages inspected; layout overlap fixed with explicit coordinates | Supported, with a different authoring engine than the original |
|
|
15
|
-
| Create/edit an XLSX | `spreadsheets` skill; `@oai/artifact-tool` | `/spreadsheets` chip → `office-spreadsheets` skill → `office_cli.py xlsx create/edit/recalc` (openpyxl + Excel COM) | Formulas, styles, widths, frozen panes, chart; edit cells/append rows; Excel recalculation persists cached values (`40`, `58`, `228`); data-only read confirms | Supported, with a different authoring engine than the original |
|
|
16
|
-
| Render for visual QA | Original render helpers / artifact tool | `render` → Microsoft Office COM (Word/PowerPoint/Excel) or LibreOffice headless; PyMuPDF for PDF | DOCX page, PPTX pages, PDF page rendered and inspected | Supported when a renderer exists; explicit error otherwise |
|
|
17
|
-
| `/` menu with names and icons | Original skill menu (not `InputTrigger`) | Public `ctx.inputTriggers` source named `office`; four candidates with Gravity UI Icons SVGs and locale labels | Typecheck/build; not yet exercised in a running DSH window | Implemented, GUI interaction unverified |
|
|
18
|
-
| Enter → reference chip | Original artifact reference | `onPick` returns `ReferenceInsert`; host `codec` persists `/documents` and serializes a skill instruction | Build/typecheck; chip persistence is the documented public contract, not live-tested | Implemented, GUI interaction unverified |
|
|
19
|
-
| Chip preview | Original skill preview | `openReference` maps feature id → skill name → `SKILL.md` path → `sidebarRight.openResource` | Code path implemented; GUI unverified | Implemented, GUI unverified |
|
|
20
|
-
| Python setup | Original bundled runtime | `postinstall.mjs` detect/download/verify/install/venv/pip/import check/config/PATH | Auto-install path not run (a working Python already existed); venv creation, dependency install, import verification, config write, idempotent rerun all verified | Supported; installer download path unverified in this environment |
|
|
21
|
-
|
|
22
|
-
## Dependency mapping
|
|
23
|
-
|
|
24
|
-
| Original dependency | DSH replacement | Notes |
|
|
25
|
-
| --- | --- | --- |
|
|
26
|
-
| `load_workspace_dependencies` | `office_status` + absolute paths embedded in each skill body | No hidden workspace loader; the host verifies the interpreter and packages. |
|
|
27
|
-
| `mark_artifact_operation_started.mjs` | None | It only marked artifact sessions in the original runtime; DSH has no equivalent and the CLI does not pretend to. |
|
|
28
|
-
| `@oai/artifact-tool` (PPTX/XLSX) | `python-pptx`, `openpyxl` | Different API and some different capabilities; see limits. |
|
|
29
|
-
| Google Drive/Slides/Sheets plugins | None | Remote editing is explicitly unsupported, not silently replaced by local files. |
|
|
30
|
-
| Original render helpers | Microsoft Office COM or LibreOffice headless; PyMuPDF | Renderer availability is reported by `office_status`. |
|
|
31
|
-
| Original `agents/openai.yaml` manifests | DSH skill frontmatter + `ctx.skills.registerProvider` | The four DSH skills live in `assets/skills`. |
|
|
32
|
-
|
|
33
|
-
## Python and renderer environment
|
|
34
|
-
|
|
35
|
-
- Python: 3.12.12 in `%LOCALAPPDATA%\dsh-office-kit\venv`, created by `postinstall.mjs` from an existing CPython 3.12.12.
|
|
36
|
-
- Installed and import-verified: python-docx 1.2.0, openpyxl 3.1.5, python-pptx 1.0.2, pypdf 6.21.1, reportlab 4.5.1, pdfplumber 0.11.9, PyMuPDF 1.28.2, Pillow 11.3.0, latex2mathml 3.81.1, mathml2omml 0.0.2.
|
|
37
|
-
- Renderers: Microsoft Word/PowerPoint/Excel 16 installed. LibreOffice is not installed on this machine. OCR (`tesseract`) and Poppler `pdftoppm` are not installed; PDF rendering uses PyMuPDF instead.
|
|
3
|
+
What this plugin can do, verified 2026-10-21 on Windows by reading the code and
|
|
4
|
+
running the helper CLI. Unverified items are marked as such.
|
|
38
5
|
|
|
39
|
-
##
|
|
6
|
+
## Runtime model
|
|
7
|
+
|
|
8
|
+
Every operation goes through one spec-driven helper CLI, addressed by the
|
|
9
|
+
absolute `python` and `cli` paths the host appends to each skill body as the
|
|
10
|
+
`## Office runtime` block. It prints one JSON object; failures print JSON on
|
|
11
|
+
stderr and exit non-zero.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
<python> <cli> {docx|pptx|xlsx|pdf} {create|read|render}
|
|
15
|
+
<python> <cli> xlsx recalc | status
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`create` takes `--spec --out`, `read` takes `--input`, `render` takes
|
|
19
|
+
`--input --out-dir`; all accept `--json-out`, `xlsx read` also `--data-only`.
|
|
20
|
+
The CLI has no `edit` verb on purpose: changing a file is a set of narrow pack
|
|
21
|
+
scripts (one operation each), so a new capability is a new script rather than a
|
|
22
|
+
new verb in a shared dispatcher that every format has to keep in step.
|
|
23
|
+
Every verb prints one JSON object; failures print JSON on stderr, exit non-zero.
|
|
24
|
+
These verbs are the common path, not the ceiling: specialised work uses the pack
|
|
25
|
+
scripts (`scripts/`, `container_tools/`), and the rest uses short snippets
|
|
26
|
+
against the installed libraries, run with the same `python` and verified the same
|
|
27
|
+
way. A missing verb is a missing shortcut, not a missing capability.
|
|
28
|
+
|
|
29
|
+
## Packs and shared layer
|
|
30
|
+
|
|
31
|
+
| Format | Router | Pack helpers | CLI verbs |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| DOCX | `assets/skills/office-documents/SKILL.md` | `scripts/` — OOXML kit, comments, fields, tracked changes, template styles, accessibility audit, text/blocks/properties edits | create, read, render |
|
|
34
|
+
| PDF | `assets/skills/office-pdf/SKILL.md` | `scripts/` — text/table extraction, page rendering, form inspect/fill, page ops, region redaction | create, read, render |
|
|
35
|
+
| PPTX | `assets/skills/office-presentations/SKILL.md` | `container_tools/` — OOXML helpers, preview rendering, text/slide/properties edits | create, read, render |
|
|
36
|
+
| XLSX | `assets/skills/office-spreadsheets/SKILL.md` | `container_tools/` — workbook inspection, diff, recalculation gate, sheet/cell/row/style/chart edits | create, read, render, recalc |
|
|
37
|
+
| live XLSX | `assets/skills/excel-live-control/SKILL.md` | `container_tools/live_excel.py` — attach to a running Excel/WPS window: read, write, formulas, styles, tables, charts, recalc, save | — |
|
|
38
|
+
| shared | `assets/skills/shared/` | `common-workflow.md`, `annotation-recipes.md`, `check_runtime.py`, `scripts/ensure_raster_image.py` | — |
|
|
39
|
+
|
|
40
|
+
The four routers register through `ctx.skills.registerProvider` in
|
|
41
|
+
`src/index.ts`; `/` commands, labels and skill names come from
|
|
42
|
+
`src/features.ts`. Helper scripts are argparse-based with `--help`.
|
|
43
|
+
|
|
44
|
+
## What each format does
|
|
45
|
+
|
|
46
|
+
- **DOCX** — create from a block spec: headings, paragraphs, bullets, numbered
|
|
47
|
+
lists, tables, images, LaTeX equations (OMML, fallbacks counted in
|
|
48
|
+
`equation_fallbacks`), quotes, page breaks, spacers, header/footer, page size,
|
|
49
|
+
margins. Read returns styled text, tables, images, equations, counts. Edits run
|
|
50
|
+
as pack scripts (text replacement, block append, core properties).
|
|
51
|
+
- **PDF** — create with reportlab; the CJK font is auto-detected (named in the
|
|
52
|
+
report, e.g. `OfficeCJK`). Read returns page text, metadata, word counts and
|
|
53
|
+
form fields; OCR is not bundled (`ocr.available: false`). Edits run as pack
|
|
54
|
+
scripts: metadata, rotation, page order, merge, page removal, region
|
|
55
|
+
redaction. Render uses PyMuPDF.
|
|
56
|
+
- **PPTX** — create 16:9 decks: layouts `title`, `bullets`, `section`,
|
|
57
|
+
`title_only`, `blank`; bullet levels, tables, bar/column/line/pie charts,
|
|
58
|
+
images. Read returns slides, text, tables and charts but **no shape geometry**,
|
|
59
|
+
so annotation work computes overlap with python-pptx. Edits run as pack
|
|
60
|
+
scripts: run-level text replacement, added slides, core properties.
|
|
61
|
+
- **XLSX** — create sheets with rows, formulas, styles (cell or `A1:B2` range),
|
|
62
|
+
widths, row heights, frozen panes, merges, charts, anchored images. Read
|
|
63
|
+
returns rows, formulas with cached values, merges, charts, images, dimensions.
|
|
64
|
+
Edits run as pack scripts: sheets, cells, appended rows, range styles, charts,
|
|
65
|
+
images, rows.
|
|
66
|
+
- **Live XLSX** — `excel-live-control` drives a workbook that is already open in
|
|
67
|
+
Excel or WPS Spreadsheets through COM (`GetActiveObject`, Windows PowerShell
|
|
68
|
+
5.1), never by writing the file behind the user's back: `info`, `read_range`,
|
|
69
|
+
`write_range`, `set_formula`, `style_range`, `add_chart`, `add_table`,
|
|
70
|
+
`recalc`, `save`, `close`, plus `--diagnose`. It refuses to start a hidden
|
|
71
|
+
instance for normal work and reports exactly which sheet and range it touched;
|
|
72
|
+
sheet create/rename/delete/reorder are deliberately absent (use a tab the user
|
|
73
|
+
has, or the file route).
|
|
74
|
+
|
|
75
|
+
## Delivery rule
|
|
40
76
|
|
|
41
|
-
|
|
77
|
+
Hand the file over with `present` and summarise the change in one sentence. A
|
|
78
|
+
bare path is not delivery: `.docx`/`.pptx`/`.xlsx`/`.pdf` links in the transcript
|
|
79
|
+
render as "二进制文件,无法显示改动". Edits go to `<original>-edited.<ext>` (or
|
|
80
|
+
the name the user asked for); never overwrite the original, report both paths.
|
|
81
|
+
|
|
82
|
+
## Annotations
|
|
83
|
+
|
|
84
|
+
A preview arrives as `<office-annotations>` wrapping a JSON array of items keyed
|
|
85
|
+
`target`, `fileName`, `requirement`, `text` and a 0–1 `region`. `docx`/`pptx`
|
|
86
|
+
add `page` (rendered PDF page; pptx one slide per page) and `pdf` adds a 1-based
|
|
87
|
+
PDF `page` plus `imageName`. `xlsx` items are always `unmapped: true` with
|
|
88
|
+
`text: ""` and no page/sheet/range: resolve cells from the `imageName` screenshot
|
|
89
|
+
and `xlsx read`, and state the resolved sheet/A1 range before editing. Treat it
|
|
90
|
+
as a change request — locate, smallest edit, re-render, confirm. Recipes:
|
|
91
|
+
`assets/skills/shared/annotation-recipes.md`; unmappable payloads are reported,
|
|
92
|
+
never guessed.
|
|
93
|
+
|
|
94
|
+
## Renderer dependency
|
|
95
|
+
|
|
96
|
+
- `docx`, `pptx` and `xlsx` rendering needs an office suite: Microsoft Office
|
|
97
|
+
(Word/PowerPoint/Excel over COM), WPS Office (`KWps`/`KWpp`/`Ket` over COM) or
|
|
98
|
+
LibreOffice (headless conversion). `render` names the one it used in its
|
|
99
|
+
`renderer` field (`microsoft-office`, `kingsoft-wps`, `libreoffice`). With none
|
|
100
|
+
installed it exits non-zero: `no document renderer found: install LibreOffice,
|
|
101
|
+
Microsoft Office, or WPS Office`.
|
|
102
|
+
- `xlsx recalc` needs a real calculation engine: Excel or WPS Spreadsheets over
|
|
103
|
+
COM. It reports `renderer` and the count of cached values it filled in.
|
|
104
|
+
- `pdf render` needs no external renderer; PyMuPDF rasterises it directly.
|
|
105
|
+
- The PPTX pack's `container_tools/preview_render.py` is a geometry-only draft:
|
|
106
|
+
it redraws shapes, text boxes and images from the package with PyMuPDF and
|
|
107
|
+
labels itself `draft-preview` / `geometry-only`. It proves placement, not
|
|
108
|
+
typography (bullet glyphs are not drawn), and `render_slides.py` prefers the
|
|
109
|
+
real renderer whenever one exists.
|
|
110
|
+
- **This machine renders through WPS Office.** `office_status` reports
|
|
111
|
+
`kingsoft_wps: {writer, presentation, spreadsheet}` from `wps.exe`/`wpp.exe`/
|
|
112
|
+
`et.exe` under `%LOCALAPPDATA%\Kingsoft\WPS Office\<version>\office6`;
|
|
113
|
+
`docx`/`pptx`/`xlsx render` return `"renderer": "kingsoft-wps"`, and `xlsx
|
|
114
|
+
recalc` fills cached values through `Ket.Application`.
|
|
115
|
+
- `assets/skills/shared/scripts/ensure_raster_image.py` turns SVG, a chosen PDF
|
|
116
|
+
page, or a raster file into a PNG (PyMuPDF for vectors, Pillow for rasters), so
|
|
117
|
+
artwork can be embedded and then looked at. It never overwrites its input.
|
|
118
|
+
- `assets/skills/shared/check_runtime.py` imports every package from
|
|
119
|
+
`python/requirements.txt` and runs `<cli> status`; it exits non-zero on a
|
|
120
|
+
missing package or broken CLI, and 4 with `--require-renderer` when no renderer
|
|
121
|
+
is installed (a missing renderer is otherwise only a warning).
|
|
122
|
+
|
|
123
|
+
## Verification evidence
|
|
42
124
|
|
|
43
125
|
| Check | Result |
|
|
44
126
|
| --- | --- |
|
|
45
|
-
|
|
|
46
|
-
| `
|
|
47
|
-
|
|
|
48
|
-
| DOCX
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
| XLSX
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- The public composer `ReferenceChip` shows a custom icon only for `session`, `file`, and `folder`. This plugin uses `appearance: 'file'` in the composer, so the chip shows the built-in file glyph plus the friendly format label. The `/` menu candidates and transcript chips use four Gravity UI Icons SVGs (`file-text`, `file-letter-p`, `display`, `layout-cells`), vendored in `assets/icons` under MIT.
|
|
74
|
-
- `matchEnter` cannot create a reference chip; Enter on a highlighted `/` candidate goes through the source's `onPick`, which is the implemented path.
|
|
75
|
-
- The chip's stable internal ref is the feature id; clipboard/persistence text is `/documents` etc.; model serialization names the skill explicitly so the agent loads it before file work.
|
|
127
|
+
| Packages on the runtime venv (3.13.12, `~/.dsh/office/runtime/venv`) | 10/10 import — python-docx 1.2.0, openpyxl 3.1.5, python-pptx 1.0.2, pypdf 6.21.1, reportlab 4.5.1, pdfplumber 0.11.9, PyMuPDF 1.28.2, Pillow 11.3.0, latex2mathml 3.81.1, mathml2omml 0.0.2 |
|
|
128
|
+
| `check_runtime.py` (venv / `--require-renderer` / bare `py -3.14`) | exit 0 + renderer warning / exit 4 / exit 1 listing the 8 missing packages and the pip remedy |
|
|
129
|
+
| DOCX create / read / `replace_text.py` / `append_blocks.py` | ok — counts returned, styles preserved, `replacements: 1`, `appended: 1`, equation intact |
|
|
130
|
+
| DOCX / PPTX render | ok through WPS — `renderer: kingsoft-wps`, DOCX 2 pages, PPTX 3 pages, PNGs opened and checked |
|
|
131
|
+
| PPTX create / read / `add_slides.py` | ok — 3 slides, texts and charts read back |
|
|
132
|
+
| XLSX create / read / `set_cells.py` | ok — formula read back uncached, one cell written |
|
|
133
|
+
| XLSX recalc | ok through WPS — `renderer: kingsoft-wps`, 34 cached values filled, `A3 = 7` after `CalculateFull` |
|
|
134
|
+
| `ensure_raster_image.py` | ok — 120×60 SVG at `--dpi 300` → 500×250, `--page` on a 2-page PDF, `--width 400` upscale, JSON errors on missing/unwritable input |
|
|
135
|
+
| `excel-live-control/container_tools/live_excel.py` | ok against WPS — attach refusal with remediation when nothing runs; `write_range` A1:B3 (6 cells), `set_formula` C1, `read_range` values `[[10,20,30],[30,40,null],[50,60,null]]`, `save` 9,268 bytes, `--diagnose` lists the workbook/sheet, `close --quit-app` refuses a dirty book, `--discard` leaves zero `et.exe` |
|
|
136
|
+
| PDF create / read / render / `metadata.py` / `page_ops.py` / `redact_region.py` | ok — CJK font applied, metadata written, merge→remove→rotate, region redaction removed 170 chars and 11 drawings, `page-1.png` produced |
|
|
137
|
+
| Annotation geometry helpers | pymupdf rect conversion, python-pptx overlap scan, A1 text matching run against those files |
|
|
138
|
+
| Forbidden-vocabulary grep over the delivered docs | empty |
|
|
139
|
+
|
|
140
|
+
Not claimed (no evidence here): installer or self-heal timings, live GUI
|
|
141
|
+
interaction (`/` menu, chip, sidebar preview, annotation overlay), and macOS/Linux
|
|
142
|
+
renderer support.
|
|
143
|
+
|
|
144
|
+
## Explicitly out of scope
|
|
145
|
+
|
|
146
|
+
- Google Docs/Slides/Sheets or Drive-backed editing; visual verification of
|
|
147
|
+
docx/pptx/xlsx without a renderer (skills say so instead of claiming a page was
|
|
148
|
+
inspected).
|
|
149
|
+
- In-place PDF page-content editing (rebuild from a `pdf create` spec and say
|
|
150
|
+
so); OCR and scanned-PDF text extraction.
|
|
151
|
+
- PPTX animations, speaker notes, slide masters; XLSX pivots, macros, data
|
|
152
|
+
validation, conditional formatting — no spec keys or verbs in the helper.
|
|
153
|
+
- Formula evaluation without Microsoft Excel or WPS Spreadsheets; macOS/Linux
|
|
154
|
+
installation and renderer behaviour (only Windows was exercised).
|
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025-PRESENT dsh-tauri-desk
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-PRESENT dsh-tauri-desk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,106 +1,108 @@
|
|
|
1
|
-
<div align="center"><a name="readme-top"></a>
|
|
2
|
-
|
|
3
|
-
<img src="./public/hero.png" alt="安装插件" />
|
|
4
|
-
|
|
5
|
-
# DSH Office Kit
|
|
6
|
-
|
|
7
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
8
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
9
|
-
[![bundle][bundle-src]][bundle-href]
|
|
10
|
-
[![JSDocs][jsdocs-src]][jsdocs-href]
|
|
11
|
-
[![License][license-src]][license-href]
|
|
12
|
-
|
|
13
|
-
为 DeepSeek Harness (DSH) 提供本地 Word、PDF、演示文稿与电子表格能力,支持 `/` 菜单、引用 Chip,以及侧边栏预览中的选区标注与修改请求。
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
## 📦 安装
|
|
17
|
-
|
|
18
|
-
在官方插件中安装 `dsh-office-kit`
|
|
19
|
-
|
|
20
|
-
<img src="https://raw.githubusercontent.com/hairyf/dsh-office-kit/refs/heads/main/public/install.png" alt="安装插件" />
|
|
21
|
-
|
|
22
|
-
或使用命令行安装
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
dsh plugin add dsh-office-kit
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
- 在 **设置 → 插件** 中启用。
|
|
29
|
-
- 需要 DSH ≥ `0.2.1-rc.2`、Python(无需,没有将自动安装) `3.10`–`3.13`。
|
|
30
|
-
- Windows 缺少兼容 Python 时自动安装;macOS / Linux 使用现有 Python。
|
|
31
|
-
|
|
32
|
-
## 特性
|
|
33
|
-
|
|
34
|
-
- 📝 **Word**:`/documents` 创建、读取和编辑 DOCX,支持表格、图片、公式与页眉页脚。
|
|
35
|
-
- 📄 **PDF**:`/pdf` 创建、读取和编辑 PDF,支持合并、旋转、删页与元数据。
|
|
36
|
-
- 📽️ **演示文稿**:`/presentations` 创建、读取和编辑 PPTX,支持项目符号、表格、图表与图片。
|
|
37
|
-
- 📊 **电子表格**:`/spreadsheets` 创建、读取和编辑 XLSX,支持公式、样式、图表、冻结窗格与重算。
|
|
38
|
-
- 🖍️ **侧边栏标注**:在 PDF、DOC/DOCX 预览中吸附段落或框选区域,批量提交修改要求。
|
|
39
|
-
- 🔗 **会话引用**:通过 Chip 调用文档技能;注释链接可悬停查看文件名与要求,PDF 标注附选区截图。
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- [
|
|
70
|
-
- [
|
|
71
|
-
- [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
pnpm
|
|
86
|
-
pnpm run
|
|
87
|
-
pnpm run
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
[npm-
|
|
100
|
-
[npm-
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
1
|
+
<div align="center"><a name="readme-top"></a>
|
|
2
|
+
|
|
3
|
+
<img src="./public/hero.png" alt="安装插件" />
|
|
4
|
+
|
|
5
|
+
# DSH Office Kit
|
|
6
|
+
|
|
7
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
8
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
9
|
+
[![bundle][bundle-src]][bundle-href]
|
|
10
|
+
[![JSDocs][jsdocs-src]][jsdocs-href]
|
|
11
|
+
[![License][license-src]][license-href]
|
|
12
|
+
|
|
13
|
+
为 DeepSeek Harness (DSH) 提供本地 Word、PDF、演示文稿与电子表格能力,支持 `/` 菜单、引用 Chip,以及侧边栏预览中的选区标注与修改请求。
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## 📦 安装
|
|
17
|
+
|
|
18
|
+
在官方插件中安装 `dsh-office-kit`
|
|
19
|
+
|
|
20
|
+
<img src="https://raw.githubusercontent.com/hairyf/dsh-office-kit/refs/heads/main/public/install.png" alt="安装插件" />
|
|
21
|
+
|
|
22
|
+
或使用命令行安装
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
dsh plugin add dsh-office-kit
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- 在 **设置 → 插件** 中启用。
|
|
29
|
+
- 需要 DSH ≥ `0.2.1-rc.2`、Python(无需,没有将自动安装) `3.10`–`3.13`。
|
|
30
|
+
- Windows 缺少兼容 Python 时自动安装;macOS / Linux 使用现有 Python。
|
|
31
|
+
|
|
32
|
+
## 特性
|
|
33
|
+
|
|
34
|
+
- 📝 **Word**:`/documents` 创建、读取和编辑 DOCX,支持表格、图片、公式与页眉页脚。
|
|
35
|
+
- 📄 **PDF**:`/pdf` 创建、读取和编辑 PDF,支持合并、旋转、删页与元数据。
|
|
36
|
+
- 📽️ **演示文稿**:`/presentations` 创建、读取和编辑 PPTX,支持项目符号、表格、图表与图片。
|
|
37
|
+
- 📊 **电子表格**:`/spreadsheets` 创建、读取和编辑 XLSX,支持公式、样式、图表、冻结窗格与重算。
|
|
38
|
+
- 🖍️ **侧边栏标注**:在 PDF、DOC/DOCX、PPTX、XLSX 预览中吸附段落或框选区域,批量提交修改要求。
|
|
39
|
+
- 🔗 **会话引用**:通过 Chip 调用文档技能;注释链接可悬停查看文件名与要求,PDF 标注附选区截图。
|
|
40
|
+
- 🖼️ **渲染校验**:DOCX/PPTX/XLSX 经 Microsoft Office、WPS Office 或 LibreOffice 导出 PDF 再栅格化,PDF 直接用 PyMuPDF;SVG/PDF 素材可用 `ensure_raster_image.py` 转成 PNG 后嵌入。
|
|
41
|
+
- 🧮 **活体表格**:`excel-live-control` 技能通过 COM 驱动已经打开的 Excel / WPS 表格(读区、写值、样式、图表、重算、保存)。
|
|
42
|
+
|
|
43
|
+
## 🚀 快速开始
|
|
44
|
+
|
|
45
|
+
### 通过菜单处理文档
|
|
46
|
+
|
|
47
|
+
<img src="https://raw.githubusercontent.com/hairyf/dsh-office-kit/refs/heads/main/public/image.png" alt="Office 菜单与文档预览" />
|
|
48
|
+
|
|
49
|
+
1. 在输入框键入 `/`,选择 **文档**、**PDF 文档**、**演示文稿** 或 **电子表格**。
|
|
50
|
+
2. 回车插入 Chip,描述创建、读取或修改任务。
|
|
51
|
+
3. 打开生成的文件,在侧边栏预览结果。
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### 在预览中请求修改
|
|
55
|
+
|
|
56
|
+
| <img src="https://raw.githubusercontent.com/hairyf/dsh-office-kit/refs/heads/main/public/annotation-selection.png" alt="段落吸附与修改要求输入" /> | <img src="https://raw.githubusercontent.com/hairyf/dsh-office-kit/refs/heads/main/public/annotation-conversation.png" alt="注释列表与会话引用" /> |
|
|
57
|
+
| ------------- | ------------- |
|
|
58
|
+
|
|
59
|
+
1. 打开 PDF 或 DOC/DOCX,点击工具栏的 **请求修改**。
|
|
60
|
+
2. 悬停吸附段落,点击或拖动框选,输入要求并添加注释。
|
|
61
|
+
3. 悬停底部 **注释数量** 查看列表,点击 **发送**;**取消** 清空本批。
|
|
62
|
+
|
|
63
|
+
- **Esc**:先取消当前选区,再按一次退出标注模式。
|
|
64
|
+
- **附件**:PDF 附选区截图;DOC/DOCX 仅发送文字与定位信息。
|
|
65
|
+
- **草稿**:已有输入时先合入草稿,由你确认发送;暂存注释刷新后不保留。
|
|
66
|
+
|
|
67
|
+
## 💡 示例文档
|
|
68
|
+
|
|
69
|
+
- [Word](<public/samples/sample.docx>)
|
|
70
|
+
- [PDF](<public/samples/sample.pdf>)
|
|
71
|
+
- [演示文稿](<public/samples/sample.pptx>)
|
|
72
|
+
- [电子表格](<public/samples/sample.xlsx>)
|
|
73
|
+
- [来源与许可](<public/samples/README.md>)
|
|
74
|
+
|
|
75
|
+
## 📚 配置与限制
|
|
76
|
+
|
|
77
|
+
- **Python**:`DSH_OFFICE_PYTHON` 可指定解释器。
|
|
78
|
+
- **标注范围**:仅 PDF、DOC/DOCX;扫描 PDF 可框选截图,不提供 OCR。
|
|
79
|
+
- **本地文件**:不支持 Google Docs / Slides / Sheets 或远程编辑。
|
|
80
|
+
- **完整清单**:[能力与未支持项](<CAPABILITY.md>)。
|
|
81
|
+
|
|
82
|
+
## 🛠️ 开发与贡献
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
pnpm install
|
|
86
|
+
pnpm run lint --fix
|
|
87
|
+
pnpm run typecheck
|
|
88
|
+
pnpm run test -- --run
|
|
89
|
+
pnpm run build
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 📜️ 许可证
|
|
93
|
+
|
|
94
|
+
- [MIT](<LICENSE.md>)
|
|
95
|
+
- 示例文档保留 [Apache Tika 的许可与声明](<public/samples/README.md>)。
|
|
96
|
+
|
|
97
|
+
<!-- Badges -->
|
|
98
|
+
|
|
99
|
+
[npm-version-src]: https://img.shields.io/npm/v/dsh-office-kit?style=flat&colorA=080f12&colorB=1fa669
|
|
100
|
+
[npm-version-href]: https://npmjs.com/package/dsh-office-kit
|
|
101
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/dsh-office-kit?style=flat&colorA=080f12&colorB=1fa669
|
|
102
|
+
[npm-downloads-href]: https://npmjs.com/package/dsh-office-kit
|
|
103
|
+
[bundle-src]: https://img.shields.io/bundlephobia/minzip/dsh-office-kit?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
|
104
|
+
[bundle-href]: https://bundlephobia.com/result?p=dsh-office-kit
|
|
105
|
+
[license-src]: https://img.shields.io/github/license/hairyf/dsh-office-kit.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
106
|
+
[license-href]: https://github.com/hairyf/dsh-office-kit/blob/main/LICENSE
|
|
107
|
+
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
|
108
|
+
[jsdocs-href]: https://www.jsdocs.io/package/dsh-office-kit
|