dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Paper Design MCP bridge as a DeepSeek Harness bundle.
Connects to the Paper Desktop MCP server (http://127.0.0.1:29979/mcp), registers every Paper tool as a native paper_* tool with image screenshot support, injects Cursor-parity design guidance, registers the Paper skills, and exposes reconnect + OAuth auth commands.
paper_* tools — every tool advertised by Paper Desktop MCP (get_basic_info, get_screenshot, write_html, update_styles, …), registered natively on ctx.tools. Raw MCP inputSchemas are normalized to the enforced DSH JSON-Schema subset ($schema/format/pattern/propertyNames/min*/max* stripped, anyOf→oneOf).get_screenshot image blocks are decoded and durably committed through ctx.attachments (saveImage), then emitted as attachment-backed image blocks (and deferred as plugin-sourced context for nested run_code dispatches), so screenshots reach image-capable models.paper-mcp-instructions guide injected for the first 2 agent turns after connect/reconnect. paper_get_guide also caches the guide body.code-to-design, design-to-code (Cursor Paper plugin bodies verbatim), and paper-design (progressive-disclosure tool reference index)./paper-reconnect — re-initializes the MCP session, (re)registers the paper_* tools, clears the guide cache, and resets the early-turn guide-injection budget.retryMs changes it) and publishes the tools as soon as the server answers. The prompt section, skills, and commands register up front, so /paper-reconnect exists even while Paper is closed.WWW-Authenticate challenge handling (RFC 9728). Tokens persist to $DSH_HOME/paper-design/oauth.json. Paper Desktop currently runs unauthenticated on localhost (no discovery/challenge), so the bridge stays dormant there and the auth layer activates only when a server advertises or challenges auth. Commands:
/paper-auth-status — show mode (unauthenticated vs oauth), configured/authenticated state, expiry, discovery endpoints, last challenge/error./paper-auth-login — start the OAuth authorization flow (opens the browser; falls back to printing the URL)./paper-auth-logout — clear stored tokens.0.2.0-rc.2 or 0.1.0-rc.5+ — the plugin declares matching @deepseek-ai/dsh-* peer ranges, and DSH refuses to load it on a runtime outside them.@deepseek-ai/dsh-base (or the services it mounts): tools, systemPrompt, attachments (for images), skills, commands, llm.Add this package to the profile and its bundles list, e.g. in ~/.dsh/profiles/<name>/package.json:
{
"dependencies": {
"@try-works/dsh-paper-design": "^0.1.6"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@try-works/dsh-paper-design"
]
}
}
}
Then pnpm install in the profile and restart the running DSH process. The bridge ships its src/*.ts sources directly (DSH loads them through tsx), mirroring dsh-recursive-mode.
Restart is required for host/bundle changes: the web client-plugin HMR only rebuilds the web shell, not host plugins.
paper_get_basic_info, paper_open_file, paper_get_screenshot, and the rest./paper-reconnect republishes the tools and re-syncs after restarting Paper Desktop. You normally do not need it: the tools appear on their own when Paper starts./paper-auth-status / /paper-auth-login / /paper-auth-logout manage OAuth auth when a server requires it.pnpm install
pnpm run build # type-check (tsc -p tsconfig.build.json)
pnpm run verify # live MCP bridge verification (needs Paper Desktop)
pnpm run verify:bridge # in-process plugin boot + live paper_get_basic_info
pnpm run verify:parity # Cursor/pi skill-body parity
pnpm run verify:injection # prompt-section marker/budget logic
pnpm run verify:auth # OAuth flow vs a mock authorization server
pnpm run test:unit # bridge + late-start recovery (stub MCP; no Paper needed)
pnpm test # everything above
src/index.ts — bundle entry: register prompt/skills/commands, then connect, normalize, and (re)register tools with late-start retry.src/mcp-client.ts — minimal Streamable HTTP MCP client (initialize/tools-list/tools-call, session tracking, SSE parsing, one-shot re-init, bearer-token + challenge hooks).src/auth.ts — discovery-driven MCP OAuth 2.1 client (RFC 8414/OIDC discovery, DCR, PKCE, loopback redirect, token exchange/refresh, persisted store, challenge handling).src/schema.ts — raw Paper JSON Schema → enforced DSH subset normalizer.src/guide.ts — standing rules + early-turn guide markers and builder.src/skills.ts — runtime skill registrations.skills/*/SKILL.md — on-disk skill bodies (parity artifacts).cordis.patch.yml — loader patch inserting the bridge into a cordis:group realm.MIT