Introduction¶
Xiumi has no public API and no developer documentation; the only way to automate layout is to control a browser. There are two unavoidable pitfalls on this path.
The first pitfall is that rewriting the DOM results in data loss upon saving. Xiumi’s editor is an Angular application, where the body exists in the scope.cell model, and the DOM is merely the rendering result. Feeding innerHTML directly into [contenteditable] may look correct on the page, but it reverts to the old content as soon as it is saved. The second pitfall is invisible: a headless browser only tells you “success,” leaving you unaware of what the layout actually looks like.
The alk233/xiumi-assistant introduced below uses a strategy of a fixed visible Edge window with headless=False, and writes all inputs directly to the Angular model, simultaneously solving both issues. The plugin is delivered as a Cordis plugin with a Host + Client split, exposing 17 xiumi_* tools, with zero @deepseek-ai/* runtime dependencies.
What is this¶
- Name: xiumi-assistant
- Maintainer: alk233
- Version: 0.2.0 (MIT)
- Platform: Windows + Microsoft Edge
- Source: Unofficial third-party plugin, no affiliation or endorsement with DeepSeek Harness, Xiumi, Tencent, or WeChat.
In one sentence: Make the AI in DSH truly use Xiumi for layout—create new posts, pick templates, insert images, set styles, save. Every step happens in a human-visible window where a human can take over at any time.
Core Features¶
- Visible Browser: Fixed
headless=False, opens on a machine with a monitor, can be taken over at any time. - Angular Model Write: Body, styles, and backgrounds are written to
scope.cell/scope.comp; only persist on save. - Real Components from Library: Titles, dividers, and cards are picked from Xiumi’s free component library, not manually typed symbols.
- Independent Save Verification: After saving, open a separate page to read back and compare the full model hash; report
saveVerified: falseif inconsistent. - Independent Cells: One cell per paragraph of text, consistent with the structure when manually laying out in Xiumi.
- Inline Edit: Use
xiumi_editfor modifying old text; do not create new drafts to avoid clutter in “My Posts”. - Capacity Guard: Image library 100, posts 30; warn before full, do not auto-delete user content.
- Continuous Learning: Learn layout rules from reference posts, remember the template library directory structure.
17 Tools¶
Below is only a list of the division of labor; see the repo README for command-level parameters.
| Tool | What it does |
|---|---|
xiumi_guide |
Must be called before creating. Returns creation guide + R1–R17 hard rules; if not called, all output tools will be rejected. |
xiumi_browser |
Open/close browser, check status, site navigation (back/home/editor/list), screenshot. |
xiumi_login |
Login (read local config auto-fill, wait for user to scan QR code), logout account. |
xiumi_articles |
Post list, open, new, save. |
xiumi_write |
Write body to the current draft (plain text / HTML with styles). |
xiumi_edit |
Inline add/remove/modify: inspect / replace_body / set_cell / clear_cell / append_cell. |
xiumi_compose |
One-shot composition: create (from scratch) / layout-only (layout only, no text changes). |
xiumi_review |
Score the current draft (100 scale + 5-dim score + actionable suggestions), read-only, no save. |
xiumi_reference |
Learn layout from others by link, save as reusable style profile. |
xiumi_template |
Search Xiumi template library, apply template. |
xiumi_component |
Insert single component (title/divider/card) from library, batch support, replace placeholder text. |
xiumi_catalog |
Template library directory (category tree + cache). |
xiumi_asset |
Xiumi asset library (shapes/illustrations/icons), only handles free assets. |
xiumi_upload |
Upload local images to “My Image Library”. |
xiumi_image_insert |
Insert image from library after the corresponding paragraph based on anchor text. |
xiumi_image_manifest |
Batch insert images: insert multiple at once based on anchors in manifest. |
xiumi_quota |
Check capacity, clean specific entries (needs confirm=true, and only deletes named ones). |
R1–R17 Hard Rules¶
These rules are not suggestions but code gatekeepers written into the system. Worth highlighting a few because they directly determine output quality and account security:
- R1: Titles, chapters, and dividers must use Xiumi template library components; manual symbols are not allowed.
- R3: Every paragraph of text must have an independent cell.
- R4: Images must be positioned by paragraph; they cannot all be stacked at the end of the text.
- R8: Use
xiumi_editto modify old text in place; do not create new ones and copy-paste. - R9: Call
xiumi_guidebefore creating; read the rules before starting (valid within 60 minutes). - R10: Must save after creating and confirm save success.
- R11: Must score after creating; provide the score and modification suggestions to the user.
- R13: Account passwords are filled by the user in the settings page and saved locally to
config.json. - R17: Do not perform any GitHub write operations without the user’s explicit consent.
The full version, including original user requirements and exceptions for each rule, is in the repo docs/HARD_RULES.md.
Installation and Enablement¶
First, install Python dependencies. Python 3.12 is recommended; the plugin reuses the system’s existing Microsoft Edge, so playwright install is not needed:
python -m venv .venv
.venv\Scripts\activate
pip install playwright==1.64.1
Next, deploy to the DSH profile:
# Install from GitHub
npx @deepseek-ai/dsh plugin --profile <profile> add github:alk233/xiumi-assistant
# Local development (link method)
npx @deepseek-ai/dsh plugin --profile <profile> add "file:/path/to/xiumi-assistant"
# Verify combined config, you should see a "- id: xiumi-assistant" line
npx @deepseek-ai/dsh --profile <profile> --dump-config
It takes effect after restarting DSH. Note to use the full @deepseek-ai/dsh package name; do not use npx dsh plugin—the dsh name on npm was taken by an unrelated JS shell package long ago, which will cause an error saying could not determine executable to run.
After installation, click “Open Browser” in the DSH settings page, and an Edge window will pop up.
Typical Workflow¶
Run through it for a new project; the order is:
- Open DSH settings → Xiumi Assistant, fill in Xiumi account (phone or email) and password, click “Save Account & Theme”.
- Click “Open Browser”, then “Login Xiumi”; the plugin auto-fills credentials and submits.
- If Xiumi requires a CAPTCHA, complete it manually in the popup window.
- Let the AI call
xiumi_guideto read R1–R17. - Call
xiumi_composeorxiumi_write/xiumi_editto produce the body and styles. - Call
xiumi_reviewfor a score and provide the score and suggestions to the user. - Save and confirm that
saveVerifiedis true.
The browser will stay open; the login state only exists within the window and is not saved or reused. Close the window to re-login next time.
Themes and Template Directory¶
The settings page provides a selection of 13 layout styles × 12 color schemes; the selected combination renders a real-time preview. When no specific style is selected, it uses auto mode, judging based on title and body content. The priority is: style rule library match → keyword mapping → fallback simple + vermilion. The return value includes resolvedStyle / resolvedTheme / resolveReason, allowing you to see why this choice was made.
The Xiumi template library has 7 groups and over 90 categories (the baseline directory in the package is 92 categories). The plugin caches the directory structure to ~/.xiumi-assistant/template-catalog.json. The read priority is: runtime cache (within 30 days) → package baseline → on-site scan. If the number of added/deleted categories or the total count changes by more than 20%, a full refresh and report of changed/diff is performed; otherwise, only lastVerifiedAt is refreshed. The cache only stores category names and template id/title/whether it is free, and does not store account information.
Architecture¶
DSH Agent
│ Tool calls (17 xiumi_* tools)
▼
index.js (Host side)
│ 1. Validate hard rule gatekeepers (no guide read → reject)
│ 2. Serialize parameters into JSON lines
▼
bridge.py (Python daemon, stdin/stdout JSON lines protocol)
│ 3. Playwright drives visible Edge
│ 4. Write Angular cell model (not DOM)
│ 5. Open separate page to read back and compare after save
▼
Xiumi Editor (xiumi.us)
The Host side’s index.js uses inject = ['tools', 'webServer'] to register tools and /__xiumi/* routes; output tools check gate.at at the start of execute; if the guide hasn’t been read or it’s been over 60 minutes, it throws an error directly. The Python interpreter probes in order: pythonPath in config → XIUMI_PYTHON → system python/python3, and validates that playwright version ≥ 1.40.
The Client side’s client.js uses inject = ['slots'] to register settings.section (id: 'xiumi', order: 105), calling interfaces like /__xiumi/config, /__xiumi/login, /__xiumi/open via same-origin fetch. The theme table is in theme.js; Host and Client share the same definition.
Credentials and Security¶
- Account passwords are only stored in
~/.xiumi-assistant/config.json; file permissions are set to read/write for the current user only. - Passwords do not go into source code, logs, or tool return values.
- HTTP interfaces only accept
127.0.0.1same-origin requests; the response carriesno-store. - The plugin connects to no third-party servers; all operations happen within the local browser.
Suitable Scenarios and Notes¶
Suitable for people who want to automatically complete Xiumi post layout in DSH, want to see every actual operation, and need verifiable results. Not suitable for people who want to bulk spam, marketing promotion, or commercial use—the README explicitly limits this project to personal learning, technical research, and exchange.
First, look at three hard limitations:
- Only supports Windows + Microsoft Edge; Playwright reuses system Edge.
- Xiumi’s frontend structure may change at any time; the plugin may become invalid at that time.
- Only handles free assets from the template library; VIP/paid assets are skipped and counted; it does not publish to WeChat Official Accounts; publishing requires a separate process via the WeChat Public Platform.
More importantly, look at the upstream disclaimer. This project’s README states: All code, documentation, and tests are generated by AI without professional software engineer human review; AI-generated content may contain logic flaws, security holes, or descriptions inconsistent with facts; the project is provided AS IS; the author and contributors are not liable for lost content, layout errors, account restrictions, etc.; users bear the risk of use. The plugin runs with the permissions of the current DSH process. Install only after reviewing the source code yourself, confirming the MIT license and the LICENSE file, and then deciding whether to enable it.
Summary¶
The value of xiumi-assistant is not “letting AI layout,” but that it explicitly handles the two problems most easily overlooked in Xiumi automation: writing to the Angular model instead of the DOM, and verifying the save by reading back. Paired with a visible window, a human can take over directly when problems occur. The prerequisites are an environment of Windows + Edge, a scope of learning and research, and accepting the upstream disclaimer of “AI generated, AS IS, at your own risk.”
Directory page: https://www.skillhub.cn/plugins/alk233/xiumi-assistant
Repo: https://github.com/alk233/xiumi-assistant