Repository navigation
Add WeChat Official Account Article Studio Mini App - #168
Conversation
Adds plugins/xiaobinger/wechat-mp-article-studio: a workbench that turns an article topic, body, cover and illustration requirements, and a visual style into a cover/illustration plan, a duplication check against the previous article, versioned drafts with publish states, and paste-ready inline-styled HTML. Publishing is gated on account authorisation, material access scope, and an available publish interface. With no WeChat interface connected the app keeps everything as a draft and never claims to have published.
|
We confirmed several blocking issues at Publish-interface matching is too broad, and a connector error can still be recorded as a successful publish. After A polish turn that includes a questionnaire cannot save a new version. When there is no questionnaire, Separately, Please tighten publish-tool matching, judge success or failure from the connector's actual result, avoid overwriting the original file when the state file is corrupt, call |
…ionnaire polish Addresses the blocking findings from the review at 82b07e7. - classify() now matches a tool by its identity (provider/server/tool) only and on whole tokens. A description that mentions a WeChat official account draft no longer promotes an unrelated tool, immediate is no longer media, and the role keyword has to come from the operation name. A draft interface such as draft_add is not a publish interface. - publishViaInterface() lists and classifies the inventory again, then picks a target that declares a field for the article body and sends only the names that tool declares, so the article is never handed to a tool that cannot receive it. - Success is read from what the interface returned. An MCP result with isError or an error code in structuredContent or a content block is a failure, and a Connector payload with a non-zero errcode/code, success:false or a non-empty failed_items is a failure. The version is only written as published_api after that. - Interface publish asks for a confirmation, like the manual one does. - A state file that cannot be read is moved aside as state.corrupt-<stamp>.json with its bytes intact instead of being overwritten, the page renders the notice that names the copy, and the previous good state is kept as state.backup.json. - A polish turn with a questionnaire keeps the requestId beside the questionnaire, answers with requestId as the docs require, and commits the result as a new version. The page only says a version was saved when one really was. - downloadAsset() accepts only HTTPS URLs on an Alibaba Cloud OSS host and checks every redirect hop against the same rule. - Adds tests/ with 36 regression checks.
|
Fixed in Publish-interface matching.
The role words are now Which tool is called. Success is read from the answer. An MCP result is a failure when A damaged state file. On A questionnaire polish. The The download host. Regression tests.
Two notes for the re-review. The Agent polish turn and the interface publish path still have not run against a real Agent or a real WeChat interface on this machine; both are covered by mocks, and the PR body says so. And the page test caught a null-state crash in my own first attempt at the polish-status wording, which is why |
|
We re-reviewed
A few secondary points that are not merge blockers on their own: As you noted, the Agent polish turn and the interface publish path are still only covered by mocks, not a real Agent turn or a real WeChat publish interface. We'll re-review against the new commit. |
findErrorMarker treated any non-empty errmsg as a failure, so a publish that
answered {errcode: 0, errmsg: "ok"} was recorded as not published. The result
code decides first: a zero errcode/code is a success and the status string next
to it is informational, while success=false and a non-empty failed_items still
fail. An explicit error field stays an error beside a zero code.
submit is no longer a publish role word. When more than one publish interface is
detected the page lists them and the user picks one; until then nothing is
published and the publish button stays disabled. Only the picked interface is
called, the confirmation dialog names it, and it is never swapped for another
one. The download allowlist is pinned to the matrix-internal-cn bucket, and a
redirect may no longer leave the host the signed URL named.
Tests: node --test "tests/**/*.test.mjs" (62 checks, up from 36).
|
Fixed in
The other failure shapes are unchanged and still fail: Regressions added for exactly the shape you named:
Several matching tools: you name the one. The first match with a body field is never used any more. When more than one publish interface is detected, the page lists them in a picker and you pick the one to publish through; until that pick is made nothing is published and the publish button stays disabled. Only the picked interface is called — it is never swapped for another one — and if the picked interface declares no field for the article body the publish is refused rather than rerouted. The picked name is stored on the check record and validated server-side: the server rejects a name that is not in the detected list. Regressions cover: two interfaces and no pick (nothing is called), the pick is the one that is called, a picked interface that cannot carry the body (nothing is called, no fallback), and a picked interface that vanished from the live inventory (nothing is called). The confirmation dialog names the tool. The publish confirmation reads 「将通过「wechat / freepublish」真实提交这篇文章。确认发布?」 — the label of the interface that will actually be called. The manual publish confirmation still names no interface, because it calls none. The download allowlist is pinned. The host must now be the one bucket, Tests. The README (English and 简体中文) and the PR description were updated to match: the role words, the interface picker, the result-code rule and the pinned bucket are described in both languages, and the test count now reads 62. One thing stays as it was and is stated in the PR description: the Agent polish turn and the interface publish path are still covered by mocks only — this machine has no WeChat publish interface, and the polish turn was not submitted. |
Adds
wechat-mp-article-studio: a Mini App that turns an article topic, body, cover and illustration requirements, and a visual style into a cover/illustration plan, a duplication check against the previous article, versioned drafts with publish states, and paste-ready inline-styled HTML. Publishing is gated on account authorisation, material access scope, and an available publish interface, so with no WeChat interface connected the app keeps everything as a draft and never claims to have published.Tested environment
toolAccess, which older clients reject.agentAccess,agentConcurrencyandsurface.windowneed 3.1.2.200 image/jpegserved by the app), read the cover/illustration plan, ran the publish check against the live tool inventory, previewed the exported HTML (cover embedded as a base64 JPEG, inline styles only), and deleted drafts singly and in bulk. The console showed no errors and the network log no failed request. The article in the screenshots is synthetic sample content.state.corrupt-<stamp>.json, the page shows the notice that names the copy, and a later write leaves that copy untouched.node --test "tests/**/*.test.mjs"— 62 checks covering the publish gate's matching, the interface answer, the durable state, the questionnaire flow, the download allowlist and the page.npm run checkreportsplugins/xiaobinger/wechat-mp-article-studio: OK— no errors and no warnings for this package — andrepository: OK.Not verified
Remaining
npm run checkfindingsnpm run checkruns 92 repository tests; 90 pass. The two failures are the repository's own symlink tests (test/files.test.mjs): creating a symlink on this Windows machine needs Developer Mode or an elevated shell, and the test aborts withEPERMbefore it reaches any assertion. Both tests build their own fixture under a temporary directory and never touch this package — they fail identically on a clean checkout ofmain.New access and minimum client version
toolAccess: ["call"]— the app callsconnector__matrix__generate_imageandconnector__matrix__get_asset_url, and readscontext.tool.list()for the publish check and for the asset-URL tool's argument schema. This is what raises the minimum client version to 3.1.6.agentAccess: ["session.run"]andagentConcurrency: 2— one Agent turn, started only when you press 「交给 Agent 润色」. The turn is asked to rewrite the body only; if it requests a tool permission, the request is shown in the page and answered only after you choose Allow once or Deny.deviceAccess, nohostAccess, nosession.read: the app uses no microphone, camera or notification, reads no Host navigation, and reads no other conversation.context.dataDir; the only outbound traffic is the two Connector calls above plus the download of the signed image URL they return.Written by MiniMax M3.1 Flash
What the app does
##section, each with a ratio, a pixel target, a generation prompt and a short checklist.connector__matrix__generate_imagecall at 1K, so one slow image cannot cancel the rest. The asset-URL tool is looked up in the live inventory by providermatrix, and its argument key is read from the tool's own schema rather than guessed.草稿,待发布,已发布(接口)or已发布(手动).<style>block) with the images embedded as data URIs; preview it, copy it, or download it as a standalone file.Notes for the reviewer
wechat-mp-article-studio; the directory name matchesplugin.json.nameand the ID is not used anywhere else in the repository. The package is self-contained and depends on no other directory in this repository.miniapp/miniapp.jsondeclaressurface.windowso the app can be popped out of the side panel into its own window.##and###headings,>quotes,-lists and**bold**.README.zh-CN.mdalongside it and links between the two.