Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques
| [FactScribe Paper Workbench](plugins/unclemoc/factscribe/) | A local workbench for writing papers: open your manuscript projects, read the check report, the fact ledger and the knowledge base, and let the assistant propose edits you approve before anything reaches the file. 17 MCP tools, read-mostly by design; every write is gated by your confirmation. Requires MiniMax Code 3.1.2 or later | [UncleMoc (BGISMALL)](https://github.com/UncleMoc) |
| [GitHub Star Shelf](plugins/start3208/github-star-shelf/) | Turn your GitHub stars into collections you can search and ask the AI to explain in plain language: from the README alone, or after it has read a shallow clone of the code. One session per project, your own notes, and collections the Agent can arrange | [start3208](https://github.com/start3208) |
| [Plugin Listing Workbench](plugins/zhuyankarl/submission-workbench/) | Prepare a plugin submission: fill in the manifest and listing fields, check every required field and cross-file consistency, then download a reviewable listing package that names what is missing; a bundled Skill gives the Agent the same checklist | [zhuyankarl](https://github.com/zhuyankarl) |
| [WeChat Article Studio](plugins/xiaobinger/wechat-mp-article-studio/) | Plan a WeChat Official Account article: cover and illustration slots rendered as real images, a duplication check against your previous piece, versioned drafts with publish states, and paste-ready inline-styled HTML. Publishing stays blocked until account authorisation, material access and a publish interface are confirmed; with no interface connected it only ever saves a draft. Requires MiniMax Code 3.1.6 or later | [xiaobinger](https://github.com/xiaobinger) |

<details>
<summary>Preview: Cutline</summary>
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求
| [FactScribe 论文工作台](plugins/unclemoc/factscribe/README.zh-CN.md) | 写论文的本地工作台:打开你的稿盘,看检查报告、事实账与知识库,助手给的改动先成提议单,你在页面上点采纳才落盘。17 个 MCP 工具以只读为主,写盘一律由你确认。需要 MiniMax Code 3.1.2 或更高版本 | [UncleMoc (BGISMALL)](https://github.com/UncleMoc) |
| [GitHub 收藏夹](plugins/start3208/github-star-shelf/README.zh-CN.md) | 把 GitHub Star 分进收藏夹,按名称、README 和备注搜索;让 AI 用大白话讲清每个项目:只看 README 讲,或读一遍浅克隆的代码再讲。一个项目一个会话,可以写备注,也能让 Agent 整理收藏夹 | [start3208](https://github.com/start3208) |
| [插件上架材料工作台](plugins/zhuyankarl/submission-workbench/README.zh-CN.md) | 填写插件清单与上架信息,逐项核对必填字段与内容一致性,生成可审核的上架材料包并标出缺失项;内置 Skill 让 Agent 拿到同一套检查清单 | [zhuyankarl](https://github.com/zhuyankarl) |
| [公众号图文工作台](plugins/xiaobinger/wechat-mp-article-studio/README.zh-CN.md) | 输入主题、正文、封面与插图需求,选一个视觉风格,产出封面与插图方案、与上一篇的查重结论、带版本和发布状态的草稿箱,以及可以直接粘贴进公众号的内联样式 HTML;发布前必须确认账号授权、素材范围与可用发布接口,没接接口时只存草稿。需要 MiniMax Code 3.1.6 或更高版本 | [xiaobinger](https://github.com/xiaobinger) |

<details>
<summary>预览:Cutline</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"schemaVersion": 1,
"name": "wechat-mp-article-studio",
"displayName": "公众号图文工作台",
"version": "1.0.0",
"description": "输入公众号文章主题与正文,产出封面与插图方案、查重结论、版本管理与可发布内容;发布前须确认账号授权、素材范围与发布接口。",
"author": "xiaobinger",
"icon": "icon.png",
"category": "Business",
"exampleQueries": [
"新建一篇公众号文章并生成封面与插图方案",
"看看草稿箱里有没有和上一篇重复的文章",
"为这篇公众号文章生成可发布内容"
],
"apps": [],
"mcpServers": [],
"skills": []
}
21 changes: 21 additions & 0 deletions plugins/xiaobinger/wechat-mp-article-studio/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 xiaobinger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
167 changes: 167 additions & 0 deletions plugins/xiaobinger/wechat-mp-article-studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# 公众号图文工作台 (WeChat Official Account Article Studio)

English | [简体中文](README.zh-CN.md)

Turns an article topic, body text, cover and illustration requirements, and a visual style into a
cover/illustration plan, a duplication check against your previous article, a versioned draft list,
and a paste-ready WeChat Official Account (公众号) body.

## What it does

- **Plan** — enter a topic, the body, a cover requirement, an illustration requirement, and pick one
of the built-in visual styles or create your own. The app derives a cover slot (2.35:1 or 1:1) and
one illustration slot per `##` section, each with its ratio, pixel target, generation prompt, and a
short checklist.
- **Render** — every slot can be rendered as a real image through the `matrix` Connector
(`connector__matrix__generate_image`). Each slot is a separate call at 1K, so one slow image
cannot cancel the rest.
- **Duplication check** — the draft is compared with the previous draft and with the previous
published article (title, body, and key-point overlap) and reports a percentage plus a verdict.
- **Versions and states** — editing the body creates a new version of the same article and keeps the
older ones. A version is `草稿`, `待发布`, `已发布(接口)`, or `已发布(手动)`.
- **Cleanup** — select several versions and delete them together. A published record is protected
unless you confirm the deletion.
- **Publish gate** — before anything is published the app checks account authorisation, material
access scope, and an available publish interface. It reports only what it actually detects: with no
WeChat interface connected it keeps everything as a draft and never claims to have published.
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 `<style>` block), with the images embedded as data URIs. Preview it, copy it, or
download it as a standalone HTML file.
- **Agent polish (optional)** — hand the body to the Agent for rewriting. The result is saved as a
new version and the original version is kept. A turn that asks a question is answered and then
saved exactly like a turn that did not, and the page says so only when a version was really saved.
- **A damaged state file** — if `state.json` cannot be read it is never overwritten. Its bytes are
kept under `state.corrupt-<stamp>.json`, the page shows a notice that names the copy, and the
workbench starts empty.

## Screenshots

The article below is synthetic sample content.

![The cover and illustration plan, with a rendered cover and its ratio, pixel target and checklist](docs/preview-cover.png)

![The publish gate: account, material and interface all report as not connected, so both publish buttons stay disabled](docs/preview-publish-gate.png)

## Install and open

1. Copy this directory into `plugins/<your-github-username>/<plugin-id>/` of your MiniMax Code
MiniApps clone, or install the plugin directory directly as a MiniMax Code plugin.
2. Restart MiniMax Code, then open the plugin from the plugin list. The app opens in the side
panel at `/dashboard`; you can also pop it out into its own window.

The app has no build step and no runtime dependencies. Node.js 22 or later is only needed to run the
repository's own `npm run check` and this package's own tests:

```sh
node --test "tests/**/*.test.mjs"
```

## How the publish gate decides

The gate never trusts a tool's prose and never trusts a cached answer.

- **Identity only.** A tool is matched on `provider`, `server` and `tool` — the runtime name an
Agent sees. Its `description` is never read, because a description that happens to mention
"WeChat official account draft" says nothing about what the tool does.
- **Whole words.** Every keyword is matched on whole tokens, so `immediate` is not `media` and
`publisher` is not `publish`. Camel case is split first, so `freePublish` is `free` + `publish`.
- **The role comes from the operation.** A tool must be named 公众号 — in its namespace
(`wechat`, `weixin`, `gzh`, `mp_weixin`, `公众号`) or in its own name — *and* its operation name
must carry the role (`publish`, `freepublish`, `发布`, `群发` for the publish gate;
`material`, `thumb`, `media` for the asset gate). A draft interface (`draft_add`, `add_news`) is
not a publish interface, so it can never open the gate. A generic `submit` operation does not
name a publish role either, so it is not treated as one.
- **The live list is re-read.** When you press 「通过接口发布」 the inventory is listed and classified
again, and the tool is picked from that fresh result — never from the label shown earlier. An
interface that is no longer in the fresh list publishes nothing.
- **You name the interface.** When more than one publish interface is detected, the page lists them
and you pick the one to publish through; until that pick is made nothing is published, and the
publish button stays disabled. The confirmation dialog names the chosen interface, and only that
interface is called — it is never quietly swapped for another one.
- **Only declared fields are sent.** The arguments are built from the target tool's own
`inputSchema`. A tool that declares no field for the article body is not called at all, so the
article is never handed to a tool that cannot receive it.
- **The answer decides.** Success is read from what the interface returned, not from the absence of
a transport error: an MCP result is a failure when `isError` is set or when its
`structuredContent` or content blocks carry an error code, and a Connector result is a failure
when its payload carries a non-zero `errcode` / `code`, `success: false`, or a non-empty
`failed_items`. A zero result code wins over the status string next to it — 公众号 answers a
successful publish with `{errcode: 0, errmsg: "ok"}`, and that is a success. Only then is the
version written as `已发布(接口)`.

## Tested environment

- MiniMax Code 3.1.19 on Windows 11 (x64)
- Minimum client version: **MiniMax Code 3.1.6** — the manifest declares `toolAccess`, which older
clients reject. `agentAccess` and `surface.window` need 3.1.2.
- Client acceptance exercised in the app's own Browser tab: created a draft, rendered a cover
(11.9 s, `200 image/jpeg` served from the app), inspected 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 both singly and in bulk. The console showed
no errors and the network log no failed request.
- The publish gate was re-run against the live inventory of this machine (203 tools): all three
checks report 「未接入」 and both publish buttons stay disabled, with no console error.
- The interface picker was exercised in the app's own Browser tab against a draft whose check record
listed two publish interfaces: the picker is rendered, the publish button stays disabled until an
interface is picked, the pick is sent to the server, and the confirmation dialog names the picked
interface.
- The damaged-state path was exercised on a throwaway data directory: the damaged file keeps its
exact bytes under `state.corrupt-<stamp>.json`, the page shows the notice that names the copy,
and a later write leaves that copy untouched.
- This package's own tests: `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.
- Not verified: the Agent polish turn and the interface publish path were implemented but never
triggered, because this machine has no WeChat publish interface and the polish turn was not
submitted.

## Data & access

- **Files read and written** — reads and writes only inside `context.dataDir`: `state.json` (drafts,
custom styles, publish checks), `state.backup.json` (the previous good state), `assets/<id>.jpg`
(rendered images), and `state.corrupt-<stamp>.json` (a state file that could not be read).
`state.json` is replaced atomically with a temporary file plus rename, and the previous state is
kept as `state.backup.json`. A state file that cannot be read is moved aside under its own name
instead of being overwritten, and the page is told about it. No Host or user files are read or
written.
- **Network hosts** — the app makes no request of its own. It calls the Connector tools listed below
and fetches the short-lived signed URL that `connector__matrix__get_asset_url` returns. That URL
must be HTTPS and its host must be the pinned bucket
(`matrix-internal-cn.oss-<region>.aliyuncs.com`, in practice
`matrix-internal-cn.oss-cn-shanghai.aliyuncs.com`); a literal address, a loopback or link-local
host, and any other host — including another bucket on the same domain — are refused. Redirects are
followed by hand: every hop is checked against the same rule *and* against the host the first URL
named, so a 302 cannot move the request to another bucket or another region.
- **Spawned processes** — none. No CLI, no shell, no child process.
- **Agent turns** — declares `agentAccess: ["session.run"]` and runs one Agent turn when you press
「交给 Agent 润色」. The turn is asked to rewrite only the article body and to return nothing else;
the result is saved as a new draft version. If the turn asks a question, the questionnaire is
answered by its `requestId` and the continuation is saved the same way. If the Agent asks for a
tool permission, the app shows the request in the page and answers it only after you choose Allow
once or Deny.
- **Conversations read** — none. The app does not declare `session.read` and never reads your other
conversations.
- **Tools called** — `connector__matrix__generate_image` to render a cover or illustration, and
`connector__matrix__get_asset_url` to turn the resulting node id into a download URL. The asset-URL
tool is looked up in the live inventory by provider `matrix` and its argument key is read from the
tool's own schema, so a renamed argument does not break the app. The app also calls
`context.tool.list()` to read the inventory for the publish check, and calls the detected WeChat
publish tool only when the publish gate confirms one exists and that tool declares a field for the
article body. Every call is judged by your own permission rules; if the tool list contains a
WeChat account, material, or publish interface, the publish check reports it as detected evidence.
- **Microphone, camera, notifications** — not used.
- **Host navigation read** — not used. The page only follows the Host's light/dark theme, which
needs no permission.
- **Where state is stored** — in the Host-owned `context.dataDir` for this plugin. Nothing is sent
anywhere except the Connector calls listed above. Drafts stay on your machine.

## Notes

- The app is designed for Chinese WeChat Official Account articles. The body parser understands a
small Markdown subset: `##` and `###` headings, `>` quotes, `-` lists, and `**bold**`.
- The duplication check is a deterministic text-overlap heuristic, not a semantic comparison. Treat
the percentage as a prompt to look, not as a verdict.
- The publish gate is checked against the tool inventory of the running client. On a machine with no
WeChat Connector or MCP server connected, all three checks report 「未接入」 and the two publish
buttons stay disabled.
Loading