dsh
OpenPetsHQ/openpets将 DeepSeek Harness 的生命周期状态、错误与审批请求,桥接到本地运行的 OpenPets 桌面伙伴。
微信遥控 DeepSeek Harness:iLink 双向加密文件收发(入站自动解密落盘 + /send 出站)、weixin_send 主动通知、完成通知、多会话切换、健康面板与文件日志。
Your phone's WeChat becomes the remote control for your DeepSeek Harness agent.
Scan a QR code to bind a WeChat bot, then drive your dsh agent from WeChat over any network (4G / any WiFi): send commands, assign tasks, receive results, browse directories with /ls — plus two-way file transfer, proactive notifications, and multi-session switching.
strict escape hatch is reserved via permissionMode)Compared with other dsh WeChat bridges (dsh-weixin, dsh-chatnode-wechat, dsh-im-bridge, …):
docs/) — outbound aes_key encoding, the two separate media-type numbering schemes, and the CDN upload/download flows all match the official SDK. Both inbound AES key encodings (base64 of raw bytes / base64 of hex) are supported, with explicit errors on bad keys (no silent truncation)/send command or a [[send-file:path]] line in the model's reply — both share a single allowlist path check (symlink escapes, out-of-root paths and directories are rejected)weixin_send model tool (text + file) plus completion notifications for unbound sessions (rule-based dedup against double-send). Expired session tokens (-14) return an exact message, the health panel degrades and prompts a re-scan, and re-scanning while running hot-rotates credentials without a restart/sessions listing + /switch with number/title dual semantics; when a session is taken over by another chat, the previous chat is notified — no cross-window output mixing/health endpoint (allowlisted fields, no internal identifiers), a three-state status bar on the login page (running / missing credential / stopped + reason), and a gateway.log file log (1 MB rotation, 0600)weixin_send file sending is constrained by the same path allowlist as /send# 1. Install the plugin into the web profile
npx @deepseek-ai/dsh plugin --profile web add dsh-mobile-remote
# 2. Start (or restart) dsh web
dsh web
dsh web running, open http://127.0.0.1:3080/mobile-remote-weixin/login in a browser on this machineThe login page shows a gateway status bar (green = running / yellow = missing credential / red = stopped + reason); GET /mobile-remote-weixin/health returns a health snapshot (loopback-only, no internal identifiers).
| Command | Effect |
|---|---|
/status | Session state + session id + workspace |
/new | Unbind current session; next message starts a new one |
/stop | Stop the running task |
/reply <text> | Follow up on the current task |
/sessions | Last 10 sessions (current binding marked ⭐) |
/switch <number-or-title> | Switch session: pure digits resolve by /sessions number first, fall back to title match |
/切换聊天窗口:<title> | Always match by title (use this for titles that are pure digits) |
/send <file-path> | Send a file from the workspace/inbox to WeChat |
/ls [path] | List a computer directory |
/workspace | Show the current workspace |
/help | Show the command list again |
<workspace>/.wechat-inbox/<date>/ (name = original + message hash, stable naming prevents crash-replay duplicates; maxMediaBytes cap, 100 MiB default). The model sees a [received file] <absolute path> hint and can continue with vision tools./send <path> sends directly; the agent can also put a single [[send-file:path]] line in its final reply (the line itself is never shown to the user). Paths must be inside the workspace or the inbox directory (one shared check; symlink escapes and out-of-root paths are rejected).weixin_send tool: agents in WeChat sessions can push text/files to WeChat (to the bound chat window; falls back to notifyChatId when unbound). Disable with enableWeixinSendTool: false.notifyChatId + notifyOnTurnEnd: true, and when a task finishes in a session not bound to WeChat, a ✅ Task complete: session「title」 push goes to the notification target (bound sessions are never double-notified; deduped when the tool already pushed this turn).Environment variables:
| Variable | Default | Meaning |
|---|---|---|
WEIXIN_BOT_TOKEN | none | Login token (auto-saved after QR login; normally not needed) |
WEIXIN_ALLOWED_USERS | the scanner | Allowed user ids, comma-separated |
WEIXIN_ALLOWED_GROUPS | empty | Allowed group ids (groups need user+group match) |
WEIXIN_BOT_API_BASE | https://ilinkai.weixin.qq.com | iLink gateway |
WEIXIN_CDN_BASE | https://novac2c.cdn.weixin.qq.com/c2c | Media CDN |
WEIXIN_MAX_MESSAGE_CHARS | 3500 | Reply chunk length |
WEIXIN_MAX_MEDIA_BYTES | 100 MiB | Media size cap |
WEIXIN_PERMISSION_MODE | full | full = full permission; strict = reserved escape hatch |
WEIXIN_DSH_WORKSPACE | auto | Default workspace for new WeChat sessions (this var > explicit config > dsh current workspace > process cwd) |
cordis config keys:
| Key | Default | Meaning |
|---|---|---|
inboxDir | '' (=workspace/.wechat-inbox) | Inbox directory; out-of-root values fall back with a warning |
enableWeixinSendTool | true | Master switch for the weixin_send tool |
notifyChatId | '' | Notification target / tool fallback (Web sessions can also push once set) |
notifyOnTurnEnd | false | Push completion notifications for unbound sessions |
logDir | '' (=state dir) | Gateway log directory (gateway.log, 1 MB rotation) |
statePath | ~/.dsh/mobile-remote-weixin/gateway-state.json | Gateway state file |
/health): running state, poll activity, consecutive error count, binding counts, backlog, credential presence, start-failure reason — allowlisted fields only, never chat/session ids or progress.gateway.log (append-only, 0600, 1 MB single-generation rotation, silent degradation on write failure), tee'd to the dsh logger.weixin_send outbound surface: the tool is visible to in-scope agents; injected inbound messages could convince the model to push workspace text/files to WeChat. filePath is constrained by the same allowlist as /send, but text content is not path-checked — do not use in untrusted groups..wechat-inbox.vision_analyze)strict mode is a reserved escape hatch (approval flow not implemented)npm install
npm run typecheck
npm test
npm run build
MIT