dshbase

插件目录 / Knowledge / dsh-plugin-wepre

dsh-plugin-wepre

已验证 · 实测可装 shujiTech

✓ 持续维护 基于 3 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-15最近推送
跨平台平台

功能简介

dsh-plugin-wepre — DSH 插件(会话)

✅
我们的评价
可用 — 实测通过,早期项目

dsh-plugin-wepre — DSH 插件(会话) 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-plugin-wepre

English | 中文

A DeepSeek Harness (dsh) plugin that lets your agent publish single-screen content cards to WePre Next — a platform that pushes offline, single-viewport cards to users while they wait on AI generations.

With this plugin installed, a dsh session goes from "write me a card" to "it's live" in one conversation:

you:   Build a pomodoro-timer card and publish it to WePre
agent: <writes index.html, calls wepre_publish>
agent: QA gate rejected it — OVERFLOW_Y at 390x600. Fixing… <edits, republishes>
agent: Published. contentId=cnt_xxx, version v1 (QA: passed)

Install

dsh plugin --profile web add dsh-plugin-wepre

Verify the layer composed, then boot:

dsh --profile web --dump-config   # shows a "# == dsh-plugin-wepre" layer
dsh --profile web

No build step and no prepare script — installing from a git host works too:

dsh plugin --profile web add github:shujiTech/dsh-plugin-wepre

What the agent gets

Five model-facing tools on ctx.tools:

Tool What it does
wepre_request_code Send a one-time login code (SMS / email)
wepre_login Redeem the code; the session cookie is persisted locally
wepre_whoami Show current login state
wepre_publish Upload an index.html / .zip card through the server-side QA gate
wepre_qa_report Fetch the full QA report (per-viewport issues) for a content

The tools' descriptions teach the model WePre's content rules (single-screen layout, no network calls, no external resources, the wepre-next:execute postMessage contract) and the QA fix loop: when the gate answers QA_GATE_FAILED, the agent reads the structured per-viewport issues, fixes the card, and republishes with the same contentId — no human in the loop.

Authentication

wepre_publish / wepre_qa_report resolve credentials in this order:

  1. token config field — a short-lived publish token from the WePre publish page
  2. WEPRE_PUBLISH_TOKEN environment variable
  3. The stored login session — created by wepre_login, persisted to sessionFile (default ~/.dsh/wepre-session.json, mode 0600)

For interactive use, just ask the agent to log in: "log in to WePre with 13800138000" — it will send the code, ask you for it, and store the session. For CI / headless (dsh --profile headless "…"), set a token.

Configuration

Override the plugin row in your profile's cordis.patch.yml (a patch replaces the row's whole config — restate keys you keep):

- id: wepre-publish
  name: dsh-plugin-wepre
  config:
    endpoint: 'https://wepre.cn/next-test'
    token: !!js process.env.WEPRE_PUBLISH_TOKEN
    sessionFile: '/home/me/.dsh/wepre-session.json'
Key Default Meaning
endpoint https://wepre.cn/next-test WePre Next site root
token — Short-lived publish token (Bearer)
sessionFile ~/.dsh/wepre-session.json Persisted login session

What a publish call looks like

wepre_publish maps to POST /next-test/api/next-contents (multipart). Parameters: title, path (absolute, .html or .zip), description, contentId (for in-place version updates), changeNote, versionLabel, downloadEnabled (default false), and manifest fields viewports (all/desktop/mobile), interaction (execute/passive), capabilities.

On success it returns contentId, versionId, versionNumber and the QA status. On QA_GATE_FAILED (HTTP 422) it returns the structured issues and reportId as a canonical value — not an exception — so the agent can iterate. Before uploading, the tool runs a local pre-flight scan for WePre's banned tokens (fetch, localStorage, Worker, overflow:auto, …) and external links, and reports them as non-blocking warnings.

Content rules in one paragraph

WePre Next cards are single-screen, offline, sandboxed pages: one index.html (or a zip with it at the root), root container at 100dvh with overflow:hidden, no overflow:auto/scroll, no network calls / localStorage / Worker (the words are banned even in comments), no external or root-absolute URLs, and execute-mode cards must run their main action on the wepre-next:execute postMessage. The full contract: WePre Next 内容发布规范 (see the publish guide on the site).

Development

Plain ESM JavaScript, no build step. Behavioral tests drive the tools against a mock WePre server:

npm install
npm test

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-wepre」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:shujiTech/dsh-plugin-wepre

Headless(CLI)profile:

dsh plugin --profile headless add github:shujiTech/dsh-plugin-wepre

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

给 agent 一套记忆、知识库或检索层,让它不再跨会话丢上下文。

适合谁

跑长项目、想让 agent 记住决策、文档和偏好而不用每次重讲的人。

二次开发建议

记忆/检索后端是缝——插新存储、调蒸馏策略,或加引用与审计轨迹。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Knowledge 里更多

浏览全部 7797 个插件 →