From 0ee4f462edb275a83cb0d9dd633227611eed1884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=85=B5?= Date: Fri, 27 Nov 2026 14:10:48 +0800 Subject: [PATCH 1/3] Build the publish arguments from the interface that was detected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish call filled three arguments and left the rest of the interface's schema alone, so an interface that publishes a article from a title, a cover file and a body was handed the styled export: 2.3 million characters of inline-styled HTML with every image embedded as a base64 data URI, against a field that declares 20,000. The call was rejected as invalid before it left the app. Each part of the article now has a role, and every role is known by a list of names; the first name the detected interface itself declares is the one that is filled. The value follows the schema too: the kind is the enum value that means an article, the action the one that means publish, and the body is the styled HTML unless the interface takes the images separately or the HTML does not fit its declared limit — then it is the plain body with every image named inside it. An interface that asks for something this draft cannot provide is not called, and the page says which argument was missing. 「复制正文」 copies that plain body, so the clipboard holds the text with the images named by their local paths; the preview and the HTML download keep the styled export. The cover and every illustration can now be re-rendered on their own, with the requirements that are current for this version. Tests: node --test "tests/**/*.test.mjs" (76 checks, up from 62). --- .../wechat-mp-article-studio/README.md | 45 +++- .../wechat-mp-article-studio/README.zh-CN.md | 31 ++- .../miniapp/client/app.js | 12 +- .../miniapp/node/content.mjs | 48 ++++ .../miniapp/node/images.mjs | 13 +- .../miniapp/node/publishing.mjs | 213 ++++++++++++++++-- .../miniapp/node/server.mjs | 44 +++- .../tests/client.test.mjs | 87 ++++++- .../tests/content.test.mjs | 77 +++++++ .../tests/publishing.test.mjs | 184 +++++++++++++++ 10 files changed, 703 insertions(+), 51 deletions(-) create mode 100644 plugins/xiaobinger/wechat-mp-article-studio/tests/content.test.mjs diff --git a/plugins/xiaobinger/wechat-mp-article-studio/README.md b/plugins/xiaobinger/wechat-mp-article-studio/README.md index fa7e56e2..aeb80e46 100644 --- a/plugins/xiaobinger/wechat-mp-article-studio/README.md +++ b/plugins/xiaobinger/wechat-mp-article-studio/README.md @@ -27,7 +27,12 @@ and a paste-ready WeChat Official Account (公众号) body. A tool only counts when its *identity* says so — see [How the publish gate decides](#how-the-publish-gate-decides). - **Publish-ready content** — the body becomes inline-styled HTML that 公众号 accepts (no class selectors, no `