Skip to content

Update docx_generator to 0.0.9 - #3040

Merged
crazywoola merged 1 commit into
langgenius:mainfrom
zhangyuqz:codex/docx-generator-0.0.9
Sep 11, 2026
Merged

Update docx_generator to 0.0.9#3040
crazywoola merged 1 commit into
langgenius:mainfrom
zhangyuqz:codex/docx-generator-0.0.9

Conversation

@zhangyuqz

Copy link
Copy Markdown
Contributor

Plugin Submission

Plugin information

Submission type

  • New plugin
  • Version update

What changed

This update fixes a JSON-input regression in the four tools introduced during 0.0.8 development and improves their instructions and Marketplace documentation. It also includes that earlier letter-template work; this description does not assume that 0.0.8 was published to Marketplace.

Restore tolerant JSON input

  • Restore tolerant parsing in letter_double_rule, letter_office, letter_composite and simple_notice_table. Each tool owns its dedicated implementation.
  • Accept escaped structural newlines, Markdown code fences, nested JSON strings, common tool-output wrappers and recoverable syntax errors, including common quote/comma mistakes.
  • Preserve intended line breaks, literal backslashes and document content inside quoted values. Do not fix input by blindly replacing every \n.
  • Report unrecoverable or ambiguous input explicitly. Never substitute a hidden example or invent missing document content. Relevant parsing errors now provide plain-language Chinese guidance and, where available, the error position.

Make the instructions visible before input

  • Put a prominent literal-\n notice in all seven tools' JSON parameter labels and preceding help text, with English and Chinese labels/help.
  • Keep the complete editable defaults visible. Explain where to copy a complete example and distinguish the letter_json and notice_json parameters.
  • Include seven complete JSON examples directly in each README, so users can copy them from Marketplace without downloading a separate file.
  • Keep the root README.md entirely in English, with zero CJK characters. Its examples use valid JSON Unicode escapes; the Chinese README displays the corresponding Chinese text.
  • Preserve existing tutorials, preview images, DOCX download links and supported-feature documentation.

Retain the templates and existing tools

  • Include three separate letter tools: double-rule letter, office red-header letter and composite red-header letter, plus a simple notice with an appendix table.
  • Retain distinct fictional public-service subjects, editable content and attachments in the examples.
  • Keep generate_docx, simple_telegram and simple_redhead available. Their document-generation behavior is unchanged in this update.
  • Leave the four newer tools' renderer classes unchanged from the 0.0.8 development baseline, including their fonts, geometry, signoffs and attachment handling. This is not a claim of pixel-identical rendering across different office applications.

Risk level

  • Low risk
  • Medium risk
  • High risk

The existing plugin processes files, writes temporary rendering artifacts, can retrieve user-specified image URLs and uses fixed Python rendering workers in its general-purpose tool paths. These existing capabilities are disclosed below; this update does not add arbitrary user-code or shell-command execution.

Required checks

  • I have read and followed the Marketplace submission requirements.
  • I have read and comply with the Plugin Developer Agreement.
  • I tested this plugin on Dify Community Edition and Dify Cloud, or documented any limitation below.
  • The package contains only files needed at runtime.
  • The package does not contain secrets, local credentials, .env files, .git directories, virtual environments, caches, logs, or IDE files.
  • The package does not contain executables or bundled binaries, or I explained why they are required below.
  • The plugin README includes setup steps, usage instructions, required APIs or credentials, connection requirements, and the source repository link.
  • The plugin includes PRIVACY.md or a hosted privacy policy, and manifest.yaml references it.
  • All user-facing text is primarily in English, with any localized README files following the i18n guidance.

Security and privacy notes

  • Document generation runs inside the Dify plugin runtime; it does not use a third-party document-generation service. Invocation data is not intentionally retained by the plugin after processing.
  • File inputs and explicitly supplied HTTP(S) image references may contain personal or confidential information. URL retrieval sends a request to the specified destination, including any supplied query parameters. Administrators control permitted destinations and network access.
  • Self-hosted Dify file retrieval can involve private-network addresses. This is an existing capability, not a new capability introduced by the JSON parser fix.
  • The existing worker paths execute fixed plugin Python code, not user-supplied programs. The recovery parsers do not use eval to execute input.
  • Required non-text data assets include an open-licensed Noto font subset and a DOCX layout template. They support document rendering and are accompanied by the applicable font licensing notices. No executable program is bundled.
  • PRIVACY.md documents processing, temporary files, URL retrieval and the platform's responsibility for storage and logs. No new credentials or external service integrations are required by this release.

Local validation

Built with the official Dify CLI 0.6.10. The runtime dependency remains pinned to dify-plugin==0.9.1; dependencies were installed in the isolated Dify validation environment.

Packaging commands, run from the build workspace:

& .\work\tools\dify-plugin-0.6.10-windows-amd64.exe version
& .\work\tools\dify-plugin-0.6.10-windows-amd64.exe plugin package .\work\v0.0.9-json-recovery_20260908\source -o .\work\v0.0.9-json-recovery_20260908\zhangyu-docx_generator_0.0.9.difypkg

Results:

  • Reproduced the original 0.0.8 escaped-newline failure in a real, isolated Dify Community Edition 1.7.1 workflow.
  • Passed 112 focused parser checks across the four affected tools, covering accepted input variants and explicit rejection of unrecoverable or ambiguous input.
  • Installed the final Marketplace package and successfully ran all four affected tools through the real Dify workflow using the English README examples. Downloaded the returned DOCX files.
  • Also exercised literal-newline input and Chinese README input with the final intranet build. The intranet package is not included in this PR.
  • Verified that malformed input returns an actionable error instead of silently generating the example document.
  • Opened, edited, undid the edits and exported the returned documents in Microsoft Word. Visually inspected eight representative pages across the four outputs, including attachment/table pages, without repeating every page of long, repetitive documents.
  • Checked all seven inline examples in both README languages, the English README's zero-CJK requirement, package metadata, privacy reference and package contents. Confirmed that the four renderer classes were not modified by this fix.

Submitted package:

File: zhangyu-docx_generator_0.0.9.difypkg
Size: 3144363 bytes
Unpacked size: 5330409 bytes
SHA-256: bd7a75cc97eac5268eb19b9a75b28c6cf6741b0354db379eca6542569731a235

Reviewer notes

  • This PR adds only zhangyuqz/docx_generator/zhangyu-docx_generator_0.0.9.difypkg. It does not delete or replace any previously published package, change another plugin, or include the intranet package, development environment or test outputs.
  • Plugin identity remains zhangyu/docx_generator; the GitHub account/directory name zhangyuqz is not a plugin-author rename. Existing tool identifiers and input parameter names remain unchanged.
  • Minimum declared Dify version: 1.7.1. Dify Cloud was not tested in this round. WPS and LibreOffice were not tested in this round; visual acceptance was performed in Microsoft Word only. Unrelated existing functionality was not exhaustively retested.
  • Localization limitation: English metadata, labels/help and the English root README are provided, with Chinese documentation under readme/README_zh_Hans.md. Detailed recovery errors in the four Chinese-document tools currently use Chinese wording, so the blanket English-facing-text checkbox is left unchecked for review.

Restore independent tolerant JSON parsing in the four tools introduced during 0.0.8 development. Put literal-newline guidance before JSON input and include seven complete copy-ready examples in both READMEs. Preserve existing document layouts, fonts, attachments, tutorials and previously released packages.
@github-actions github-actions Bot added the risk: high High-risk Marketplace submission label Sep 8, 2026
@crazywoola
crazywoola merged commit 325eb97 into langgenius:main Sep 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high High-risk Marketplace submission

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants