Scan your whole stack
Are you using dsh-gui-turn?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.0
dsh-gui-turn was last scanned on 28 Nov 2026 at version 1.0.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.0 LATEST | 28 Nov 2026 | No rules fired |
| 0.0.0-stage | 28 Nov 2026 | Not shown |
Findings for v1.0.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.0.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
dsh-gui-turn 是一个 DeepSeek Harness(DSH)桌面端插件:它把「跑一整轮 agent 对话」暴露成一条本机 loopback HTTP 接口,让 QQ 机器人、定时脚本、CLI 工具等外部进程,直接借用桌面端已经配好的模型、人设和 MCP 工具跑一轮,回答同时出现在桌面界面里并以 JSON 返回。
English one-liner: dsh-gui-turn is a DeepSeek Harness desktop plugin that exposes one full agent turn as a loopback HTTP route, so any local process can reuse the app's model, persona and MCP tools without the page token that
/api/*requires.
外部进程 ──POST /gui-turn/turn──▶ dsh-gui-turn(在桌面端进程内)
├─ 注入本轮人设(systemPrompt)
├─ 起本轮 MCP 服务
├─ 工具白名单(默认只放行本轮 MCP)
├─ sessionController.prompt() → wait()
└─ finally 全部释放
▼
回答显示在桌面界面 + 作为 finalText 返回
| 类型 | DeepSeek Harness / DSH 插件(cordis 插件) |
| 解决的问题 | 外部进程调桌面端 /api/* 一律 401,拿不到页面 token |
| 对外接口 | POST http://127.0.0.1:<port>/gui-turn/turn |
| 运行环境 | DSH 桌面端(Electron),需要 webServer 服务 |
| 语言 / 依赖 | JavaScript(ESM),无第三方依赖 |
| 许可证 | MIT |
already owned by an active write handle),你需要一个「让桌面端自己跑一轮」的入口。@modelcontextprotocol/sdk,不需要这个。webServer 不存在,路由不会注册。| 方案 | 能复用桌面端的模型/人设/工具 | 回答进界面 | 外部进程能调 | 需要页面 token |
|---|---|---|---|---|
直接调 /api/* |
✅ | ✅ | ❌ 401 | ✅ 需要(拿不到) |
| 另起 headless 实例 | ❌ 配置要重来 | ❌ | ✅ | ❌ |
| 包一个独立 MCP server | ❌ | ❌ | ✅ | ❌ |
| dsh-gui-turn | ✅ | ✅ | ✅ | ❌ 不需要 |
finally 里反向 dispose,超时和异常路径也不例外。allowedTools 时,只有本轮 mcpServers 注册的工具可见,桌面端全局工具(shell、文件、插件管理)一律被 restrict() 屏蔽。systemPrompt 作为 order 120 的系统提示段落加入,interpolate: false。mcpServers 项映射成 dsh-mcp-client 配置(stdio 或 URL),本轮结束连接即关。{origin, pid, at} 写进 $DSH_HOME/gui-turn.endpoint.json,App 换端口重启也不用改配置。127.0.0.1 / ::1 直接 403;Origin 头与 App 不同源的跨站请求同样拒绝。克隆到任意目录:
git clone https://github.com/SuRanHF/dsh-gui-turn.git
在你的 DSH profile 的 cordis.patch.yml 里挂上它(绝对路径):
- insert:
- id: dsh-gui-turn
name: "file:///C:/path/to/dsh-gui-turn/index.js"
也可以放进 profile 的 node_modules 后用包名 dsh-gui-turn 引用。
重启桌面端,确认端点文件生成:
// $DSH_HOME/gui-turn.endpoint.json
{ "origin": "http://127.0.0.1:49213", "pid": 12345, "at": "2026-01-01T00:00:00.000Z" }
POST /gui-turn/turn请求体上限 4 MiB,必须是 JSON。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt |
string | ✅ | 本轮用户输入,空白字符串会被拒 |
sessionId |
string | 指定已有会话;不传则新建(响应 created: true) |
|
cwd |
string | 新建会话时匹配已注册 Workspace;匹配不到则作为 cwd |
|
agentPreset |
string | 新建会话使用的 agent preset | |
systemPrompt |
string | 本轮人设,作为系统提示段落注入 | |
mcpServers |
array | 本轮临时挂载的 MCP 服务 | |
allowedTools |
string[] | 全局工具白名单,支持 * / prefix* / 精确名;默认只放行本轮 MCP 工具 |
|
timeoutMs |
number | 等待时长,1000–1800000,默认 600000 |
mcpServers[] 每项映射到 dsh-mcp-client 配置:
| 字段 | 说明 |
|---|---|
serverName |
✅ 服务名,工具名形如 mcp__<serverName>__<tool> |
transport |
stdio 或 HTTP 传输名 |
command / args |
stdio 启动命令 |
url |
远程 MCP 端点 |
env |
子进程环境变量 |
toolCallTimeoutMs |
单次工具调用超时 |
{
"ok": true,
"value": {
"sessionId": "...",
"created": false,
"personaApplied": "system", // system | none
"allowedToolsApplied": ["mcp__sing__sing"],
"restrictDebug": { "globalCount": 21, "allowedCount": 1, "visibleAfter": ["..."] },
"toolsApplied": ["sing"],
"toolsFailed": [],
"toolErrors": [],
"reason": "completed",
"truncated": false,
"finalText": "本轮最后一条 assistant 文本"
}
}
失败时返回 { "ok": false, "error": { "code": "...", "message": "..." } }:
| code | HTTP | 触发条件 |
|---|---|---|
bad-request |
400 | 体过大 / 非 JSON / prompt 为空 |
forbidden |
400 | 非 loopback 调用或跨源请求 |
method-not-allowed |
405 | 非 POST |
session/agent-unavailable |
400 | 会话拿不到 agent context |
gateway/internal |
500 | 其他内部异常 |
最小调用:
ORIGIN=$(node -p "require(process.env.DSH_HOME + '/gui-turn.endpoint.json').origin")
curl -s "$ORIGIN/gui-turn/turn" \
-H 'content-type: application/json' \
-d '{"prompt":"用一句话说明这个仓库干什么"}'
带人设 + 一个 MCP 工具 + 白名单(典型机器人用法):
{
"prompt": "帮我把这句话改得更自然一点",
"cwd": "C:/Users/me/Documents/work",
"systemPrompt": "你是这个工作区里的助手,回答简短,不要客套。",
"mcpServers": [
{
"serverName": "memory",
"transport": "stdio",
"command": "node",
"args": ["C:/tools/memory-mcp.js"],
"env": { "DATA_DIR": "C:/data/memory" },
"toolCallTimeoutMs": 30000
}
],
"allowedTools": ["mcp__memory__*"],
"timeoutMs": 120000
}
完整示例见 examples/:node-turn.mjs(Node 调用 + 端点发现)、curl.ps1。
remoteAddress 必须是 127.0.0.1 / ::1,否则 403。不要反代到公网。Origin 且不等于 App 自身 origin 时拒绝,避免浏览器页面顺手打一枪。allowedTools 就只给本轮 MCP 工具;能执行命令、读文件、改插件的全局工具不会因为一条 curl 就交出去。finally 里释放,异常与超时路径同样释放。dsh-gui-turn 是什么?
一个 DeepSeek Harness 桌面端插件,把「跑一整轮 agent 对话」暴露成本机 loopback HTTP 接口 POST /gui-turn/turn,让外部进程借用桌面端的模型、人设和 MCP 工具。
它和 DeepSeek Harness 官方的 HTTP API 有什么区别?
官方 /api/* 命名空间对外部进程返回 401,因为页面 token 是启动时注入 renderer 的。这个插件在 App 进程内部注册路由,走进程内的 sessionController,不需要 token。
*为什么不能直接在外部调 `/api/?** 因为拿不到页面 token,且/api/*` 对非页面来源一律拒绝。这是设计使然,不是配置问题。
支持 QQ 机器人吗? 支持,这也是它最初的用途:机器人进程通过 localhost 发一轮请求,人设和 MCP 工具按轮传入,用完即弃,桌面端的全局工具不会暴露给群聊。
回答会不会出现在桌面界面里?
会。走的是真实的 session(会话),回答既渲染在界面上,也作为 finalText 返回给调用方。
会不会污染我已经配好的人设和工具?
不会。人设是 order 120 的临时系统提示段落,MCP 连接是本轮临时实例,工具白名单是本轮 restrict(),全部在 finally 释放。
能同时跑多轮吗?
同一会话用 mode: 'queue',并发请求排队;不同会话互不影响。
需要 Node 环境吗?
不需要单独装。插件跑在桌面端主进程里,MCP 客户端从安装目录的 app.asar 动态加载。
在 headless / CLI profile 上能用吗?
不能。它依赖 webServer,headless profile 没有这个服务,路由不会注册。
DSH 升级会不会坏?
有可能。它用到 sessionController.resolveAgent、tools.restrict、systemPrompt.section 等非公开接口,大版本变动时需要跟着改,README 会同步更新。
| 项 | 要求 |
|---|---|
| 宿主 | DeepSeek Harness 桌面端(Electron),含 webServer / sessionController / workspaceRegistry |
| Node | >= 22(宿主自带运行时) |
| 平台 | Windows / macOS / Linux(跟宿主一致) |
| 协议 | HTTP/1.1,JSON body,4 MiB 上限 |
DSH_INSTALL_DIR。MIT © 2026 SuRanHF
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.