- Startseite
- Plugins
- Integrationen & Fernzugriff
- dsh-remote-peers
dsh-remote-peers
ownduck/dsh-remote-peers
DeepSeek Harness plugin: peer with another DSH over LAN — token-gated gateway plus a remote-sessions panel
Installation
dsh plugin --profile web add github:ownduck/dsh-remote-peersREADME
dsh-remote-peers
English | 中文
Drive another DeepSeek Harness instance from your own sidebar, over the local network. Community DeepSeek Harness plugin — not an official DeepSeek AI product.
Two things, one plugin, no changes to DSH itself:
- This machine publishes its capabilities as an HTTP gateway guarded by a shared token (listening on
0.0.0.0, port assigned by the OS). - Your desktop grows a Remote peers panel: enter a peer's
ip:port+ token and you get that peer's sessions, grouped by their workspaces — read history, send messages with streaming replies, answer approvals, preview and download files.
The peer does not need a separate API. The gateway dispatches requests into the peer's own /api channel as that machine's operator peer (connection.createSharedFetchHandler('/api')), so the peer exposes exactly what its desktop exposes.
Install
Requires DSH with the dsh CLI (desktop or web).
dsh plugin --profile desktop add dsh-remote-peers
# or: dsh plugin --profile web add dsh-remote-peers
# or: dsh plugin --profile desktop add github:ownduck/dsh-remote-peers
Restart DSH, then open the Remote peers entry in the sidebar.
The package ships ssh2 and its pure-JS dependencies inside its own node_modules, so a pnpm install runs no dependency build scripts and never asks to approve cpu-features or ssh2 (the optional native crypto binding is absent; ssh2 falls back to its JS implementation).
dsh plugin --profile desktop remove dsh-remote-peers
Both machines run this plugin. On the machine you want to reach, the panel shows its LAN address, port and token; on the machine you sit at, add that address + token as a peer.
What you can do
- Sessions: every session of the peer, grouped by the peer's workspaces, archived ones pushed to the bottom
- Chat: read history in pages, send a prompt, watch the reply stream in; thinking rows, code blocks, markdown and file cards follow the host app's look
- Attachments: paste files with Ctrl+V or pick them from
+ → 文件; images arrive as 64×64 thumbnails, every other file as a 240×64 file card. Each draft uploads to the peer as soon as it is picked and is sent with the prompt as a{ type: 'file', receiptId }part - Approvals and questions: approve or answer here; the decision is relayed to the peer
- Files: preview PDF / Word / Excel / PPT / images / text in the right pane; downloads land in one shared local copy, and Open, Download and Show in folder all reuse it
- Run state: a remote session that is still working keeps showing its running state, including after you reopen the panel
- Cross-network link: the 跨域网关 card at the top of the panel joins an EasyTier virtual network, so two machines on different networks can reach each other. Enable it on one machine and send its connection code to the other; pasting that code there brings it in, and pasting the other machine's code links back the other way. The core runs with
--no-tun(no admin rights, no virtual adapter) and is a separate step: download it first (~33 MB into<stateDir>/easytier/), then enable — or paste the other side's code to join without creating your own network. Each machine then forwards through a local port derived from the peer's virtual address (127.0.0.1:37500+the address's last octet), and a peer joined this way is an ordinary peer record, so sessions, attachments, files and approvals behave exactly as on a LAN. The peer list has no hub and no announcements: every node reads the core's peer table for the network's virtual addresses, derives the plug-in port as37000 + last octet, and derives the token from the network secret, so all nodes reach the same answer without telling each other anything. - One link mode at a time: LAN and cross-network each have their own enable switch, both off on first launch (nothing listens until one is enabled). Only one can be on; whichever is on decides which peers appear in the list and in sessions and attachments. Switching turns the other off but keeps its peer records, so switching back restores them. Turning the gateway off keeps the network identity on disk, so enabling it again rejoins the same network with the same virtual address; 重置 discards that identity and starts a fresh network (new name and secret, virtual address back to
.1), which invalidates every connection code already handed out. - Pinned peers only in the sidebar: nothing is added to the left rail by default. Each row in the peer table carries a pin toggle; a pinned peer gets a
远程 · nameentry just below the fixed 本机端 row, and un-pinning removes it again. The pin list lives in the host state directory (pinned.json), so it survives restarts. - The sidebar follows the peer: the left rail is always 远程端 → 本机端 → peers. While a peer page is open, the workspaces block is replaced by that peer's session tree (grouped by remote workspace, collapsible, pin/archive, one click opens the session in the main pane); returning to 本机端 or the peer list restores the host's own workspace browser immediately. A switcher at the footer lists the local side plus every peer, pinned or not.
Security
Two gates, both on the gateway:
| Gate | Default |
|---|---|
| Source CIDR allow-list | private ranges only: 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, ::1/128 |
| Shared token | x-dsh-lan-token header or Authorization: Bearer, compared in fixed time |
The token is generated on first launch (43 chars) and can be reset from the panel; resetting invalidates the old token immediately, and peers that registered this machine elsewhere must be updated. Under the cross-network gateway the token is not local: it is derived from the network secret, so changing it means changing the secret and rebuilding the whole network — there is no reset there, only a new connection code. Anyone holding the code can derive every node's token: the code is the admission ticket. The port is open on the LAN — on Windows, allow it on Private networks when the firewall asks.
The gateway neither exposes DSH's source nor carries any local credential; the token stays inside the peer's Host process and is never handed to a browser.
Endpoints
Exposed through the gateway (token required):
GET /remote-peers/hello→{ type, instanceId, port, version }POST /api/<namespace>/<method>→ the same envelope the desktop browser uses:{ type: 'client-request', rpcId, method, payload: { args: {...} } }GET /remote-peers/stream?endpoint=<ns>/<method>&payload=<urlencoded json>→ real SSE, forwarded frame by frame; ends withevent: end, failures withevent: error
Local-only routes (the browser talks to its own Host; peer tokens stay there):
/remote-peersRPC:status,token/reset,peers/list|upsert|remove|ping,proxy,file/size(s),open-local,local/copy,download/status|save|cancel,diagPOST /api/remote-peers/upload?id=<peer>&sessionId=<id>[&name=<name>][&mediaType=<type>]→ the raw request body is streamed to the peer's own/api/session/uploadFileBinary; returns that route's{ ok, value: { receiptId, image | file } }GET|HEAD /api/remote-peers/file?id=<peer>&path=<absolute path>[&v=<version>][&download=1]GET /api/remote-peers/export|markdown|stream|call|diag|vendor|office|present-open|changes
Known limits
- LAN only. No NAT traversal or relay yet; both machines must reach each other directly (same subnet, or a VPN that keeps layer-3 reachability).
- The sidebar workspace is borrowed.
sidebar.workspacesis a single slot the host also owns. While a peer page is open the plugin registers a higher-priority occupant there that renders the peer's session tree, and removes it on leaving, so the host's own workspace browser comes back. Inside a peer page the host's new workspace is therefore absent, and view options becomes the peer-side three: group by, order by, archived filter — remembered locally, kept across peer switches. - Peer entries stay flat.
sidebar.panellisthas no nesting, so peers can only sit in a flat line with 远程端 and 本机端 — no folder-style menu is possible. - Attachments stream as bytes. A picked file leaves the browser as the request body of the local
/api/remote-peers/uploadroute and is piped to the peer without base64 expansion, the same path the desktop app takes. Footprint is one in-flight request per file; very large archives still belong to the file download path. - Preview only, no editing. Formats mirror the host's renderers (PDF via pdf.js, Office via the peer's
officeKit). - No
Trajectorytab. It needs event-level call trees, which this plugin does not reconstruct. Show in foldertakes about 2 seconds. Explorer itself takes that long to raise a window, so the button shows a fixed 2-second "Opening…" state instead of polling for the window.
Development
npm install
npm test # build, then unit tests + self-contained smoke probes (non-zero exit on failure)
npm run build # src/client.js -> lib/client.js (preview libs stay in vendor/)
npm run probe # headless render smoke for the panel only
npm run audit # dead declarations / duplicated blocks in src/client.js
npm run pack # publish tarball into dist/ (same exclusions as npm publish)
npm test runs two layers:
tests/*.test.mjs—node:testunit tests over the pure faces: gateway derivation (vipIndex/gatewayPortOf/forwardPortOf/gatewayTokenOf, with pinned vectors so both ends keep agreeing), the vendor asset whitelist (resolveVendorAsset), the conversation semantics insrc/conversation.js(model/permission selection, metric folding, token and cache formatting), and the pack holdout plan.probes/run-all.mjs— the self-contained smoke probes (no live host, EasyTier kernel or peer needed): render page, session menu, session open, modes, identity, asset route, bundle budget, glyph execution, vendor library loading, queue, stop and the SFTP client path (two plugin instances in one process: one dials the other's node SSH, then lists, stats, downloads, streams, and creates/renames/removes/chunk-writes files over that same connection, checking the per-permission starting roots and the readonly write refusal). Each reportsok/FAILper checkpoint and exits non-zero if any fails. Probes that need real machines (probe-gateway-link,probe-live-gateway,probe-ssh-link/-status/-key/-embedded/-scp/-sftp,probe-peer-*,probe-stream,probe-open-cache, …) stay manual.
npm pack / npm publish run prepack, which builds the client with --minify and hides ssh2's optional native pieces (cpu-features and its MSVC build tree) plus its test/examples/docs before the tarball is cut; postpack puts them back with scripts/holdout.mjs. Without that step npm recurses into cpu-features and ships roughly 10 MB of .pdb/.obj build output.
The preview libraries are not bundled. lib/client.js carries only plugin code; pdf.min.mjs, pdf.worker.min.mjs and xlsx.full.min.js live in vendor/ and are fetched from the plugin's own /api/remote-peers/asset route the first time a PDF or spreadsheet preview opens (the pdf.js worker text is fetched the same way and turned into a blob worker). Copy them from node_modules/pdfjs-dist/build/pdf.min.mjs, node_modules/pdfjs-dist/build/pdf.worker.min.mjs and node_modules/xlsx/dist/xlsx.full.min.js when upgrading those dev dependencies — probes/probe-assets.mjs checks that every whitelisted asset is served with the byte length on disk.
Layout: index.mjs is the Host face (gateway, routes, local copies); src/client.js is the Client face (panel UI: state, RPC, layout), with src/theme.js (style tokens), src/icons.js (inline SVG glyphs), src/preview.js (PDF/image/Excel preview), src/files.js (the file browser behind both「访问」tabs — the peer page's and the session page's) and src/conversation.js (model, usage and process-label helpers) split out; scripts/build.mjs bundles the client; probes/ holds smoke scripts; vendor/pdfjs and vendor/xlsx carry the assets the preview serves. Deep implementation notes live in docs/internals.zh-CN.md (Chinese).
License
MIT. Bundled third-party code keeps its own license: pdf.js (pdfjs-dist) and SheetJS (xlsx) are Apache-2.0.
Ähnliche Plugins
dsh-purge
kingcharleslzy-ai/dsh-purge
dsh-web (dsh-ssh)
zhu1090093659/dsh-web
dsh-web (dsh-remote-web-ui)
zhu1090093659/dsh-web
dsh-web-ui (dsh-ssh)
zhu1090093659/dsh-web-ui