会话与记忆 · v0.5.3
dsh-context-mode
dsh-context-mode 将自包含的 context-mode 服务器作为原生 DeepSeek Harness 工具对外提供。
作者原文(英文)
dsh-context-mode exposes a self-contained context-mode server as native DeepSeek Harness tools.
简介取自插件 README 开头,由 DeepSeek 模型翻译,仅供参考。
dshdsh-tuicontext-modemcpcontext-windowcode-executionfts5
认证 L1已扫描 ✓健康 A/90周下载 105
11 项能力安装命令
dsh plugin --profile web add dsh-context-mode@0.5.3
强装可用 · 需绕过门禁
当前 DSH 版本上 CLI 拒绝安装这个包。用 --accept-risk 绕过门禁之后,它能装上并挂载——限制来自版本策略,不是包坏了。要用它,得自己决定这个风险值不值得承担。
检测报告
关注度高。命中了不少能力模式,其中可能有需要留意的。逐条看下面的清单。
2高关注4需留意5一般13未命中
高关注需留意一般
能力清单
- 以 shell 执行命令
shell-exec高关注32 处命中…xt-mode/src/session/analytics.ts:1891const out = execFileSync("defaults", ["read", "-g", "AppleLocale"], {vendor/context-mode/src/cli.ts:275* - shell: true required (Node v20+ CVE-2024-27980 mitigation)vendor/context-mode/src/cli.ts:281execFileSync(isWin ? "npm.cmd" : "npm", args, {vendor/context-mode/src/cli.ts:283...(isWin ? { shell: true } : {}),- 看命令字符串是拼出来的还是写死的。拼接用户输入才是真正的风险。
- 可执行外部程序
spawns-processes高关注11 处命中lib/types/mcp-client.js:7import { spawn } from 'node:child_process';…xt-mode/src/session/analytics.ts:12import { execFileSync } from "node:child_process";vendor/context-mode/src/cli.ts:19import { execFileSync, execSync, execFile as nodeExecFile, type ExecSyncOptions } from "node:child_process";…r/context-mode/src/session/db.ts:14import { execFileSync } from "node:child_process";- 看它调用哪些程序。调用本机已有的工具是常见做法。
- 写入文件
writes-files需留意42 处命中lib/types/output-containment.js:65mkdirSync(spillDir, { recursive: true });lib/types/output-containment.js:66writeFileSync(path, text, 'utf8');package.json:51"clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\""vendor/context-mode/src/cli.ts:1321rmSync(tmpDir, { recursive: true, force: true });- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 可终止进程
kills-processes需留意6 处命中…dor/context-mode/src/executor.ts:205process.kill(-proc.pid, "SIGKILL");…dor/context-mode/src/executor.ts:276process.kill(isWin ? pid : -pid, "SIGTERM");…ext-mode/src/util/sibling-mcp.ts:34/** Inject `process.kill(pid, 0)` for tests. */…ext-mode/src/util/sibling-mcp.ts:37/** Inject `process.kill(pid, signal)` for tests. */- 看它终止的是自己启动的进程,还是按名字匹配到的任意进程。
- 发起网络请求
network需留意4 处命中vendor/context-mode/src/server.ts:3043// chain manually so every hop runs through classifyIp before the next fetch.vendor/context-mode/src/server.ts:3048const resp = await fetch(currentUrl, { redirect: 'manual' });vendor/context-mode/src/server.ts:3169* Pure fetch step — TTL cache check + subprocess fetch. SAFE TO RUN IN PARALLEL.vendor/context-mode/src/server.ts:3462- You want a long-lived cache window (override \`ttl\` upward for stable specs) or a guaranteed-fresh fetch (\`ttl: 0\` …- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 启动伪终端
spawns-pty需留意4 处命中vendor/context-mode/src/runtime.ts:100const out = execSync(`where ${cmd}`, { encoding: "utf-8", stdio: "pipe" });vendor/context-mode/src/runtime.ts:119execSync(`"${cmd}" --version`, { stdio: "pipe", timeout: 5000 });vendor/context-mode/src/runtime.ts:201const result = execSync("where bash", { encoding: "utf-8", stdio: "pipe" });vendor/context-mode/src/server.ts:121? spawnSync("cmd.exe", ["/d", "/s", "/c", "codex plugin list"], {- 伪终端等于给了一个完整 shell。确认这是插件的核心功能。
- 读取文件
reads-files一般170 处命中lib/types/index.js:205const content = readFileSync(new URL(`../../${skill.path}`, import.meta.url), 'utf8');lib/types/index.js:280if (!existsSync(candidate))lib/types/index.js:294if (existsSync(bundled))scripts/cleanup-injected.mjs:37if (!existsSync(dbPath)) {- 读文件是绝大多数插件的正常工作方式,本身不构成顾虑。
- 读取环境变量
reads-env一般75 处命中lib/types/index.js:152...process.env,…xt-mode/src/session/analytics.ts:1882const env = (process.env ?? {}) as Record<string, string | undefined>;…xt-mode/src/session/analytics.ts:2003process.env.PI_CONTEXT_MODE_PRICE_OUTPUT_PER_TOKEN !== undefined;…xt-mode/src/session/analytics.ts:2004const modelId = process.env.PI_CONTEXT_MODE_MODEL_ID;- 环境变量里常混有密钥。看它是否把整个 env 都读走。
- 动态加载模块
dynamic-import一般29 处命中vendor/context-mode/src/cli.ts:184await import(pathToFileURL(join(pluginRoot, scriptPath)).href);vendor/context-mode/src/cli.ts:260import("./server.js");vendor/context-mode/src/cli.ts:288// Issue #511: use top-level static import (line 17) — never inline `require("node:...")`vendor/context-mode/src/cli.ts:291// Cast preserves the prior `require()`-as-`any` shape; `shell: true` is the documented- 动态导入本身无害,但会让依赖关系难以静态审阅。
- 文中出现远程脚本地址
remote-url-reference一般3 处命中vendor/context-mode/src/cli.ts:748"\n Or: curl -fsSL https://bun.sh/install | bash && bun add -g context-mode",vendor/context-mode/src/runtime.ts:622" Tip: Install Bun for 3-5x faster JS/TS execution → https://bun.sh",vendor/context-mode/src/server.ts:5037console.error(" curl -fsSL https://bun.sh/install | bash");- 只是文本里出现了远程脚本地址,没有看到加载它的调用。多半是文档或注释;若确实可疑,搜一下这个地址在包里的其他出现位置。
- 接触凭据或密钥
credentials一般2 处命中…xt-mode/src/session/analytics.ts:2003process.env.PI_CONTEXT_MODE_PRICE_OUTPUT_PER_TOKEN !== undefined;…xt-mode/src/session/analytics.ts:2491// process.env.PI_CONTEXT_MODE_PRICE_OUTPUT_PER_TOKEN is unset at…xt-mode/src/session/analytics.ts:2502const env = process.env.PI_CONTEXT_MODE_PRICE_OUTPUT_PER_TOKEN;- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 以 shell 执行命令 | shell-exec | 高关注 | 32 |
| 可执行外部程序 | spawns-processes | 高关注 | 11 |
| 写入文件 | writes-files | 需留意 | 42 |
| 可终止进程 | kills-processes | 需留意 | 6 |
| 发起网络请求 | network | 需留意 | 4 |
| 启动伪终端 | spawns-pty | 需留意 | 4 |
| 读取文件 | reads-files | 一般 | 170 |
| 读取环境变量 | reads-env | 一般 | 75 |
| 动态加载模块 | dynamic-import | 一般 | 29 |
| 文中出现远程脚本地址 | remote-url-reference | 一般 | 3 |
| 接触凭据或密钥 | credentials | 一般 | 2 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 68 个文件,扫描于 2026-10-15。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。
可信度
90
健康分 A
扣分项下方逐条附证据
- -10声明与实物不符:client-present-undeclaredmajor:['vendor/context-mode/src/platform/client-map.ts']
认证等级 L1
- L0静态结构与契约✓sha512-IxOfmeMkgdf1Chv7… 与本地 tarball 复算一致,补丁与入口齐备,另有 1 项声明不一致(计入健康扣分)
- L1配置组合与依赖图✓跨包无 entry id 冲突,插入模块可解析,目录内 peer 满足
- L2隔离沙箱冒烟—试装未通过(forced-ok)
- L3运行时健康监控—未抽样(本层是抽样检测:没有会话不等于干净)
评分口径与作者信息
从 100 分开始按规则扣减:fail −20 / major −10 / warn −5 / minor −2;star 数、下载量、LLM 输出都不参与评分
- 维护者
- sujiu522
- 仓库
- https://github.com/52sujiu/dsh-context-mode
- 许可
- MIT
- 最后发布
- 2026-09-14
- 周下载
- 105
- star
- 0
扫描状态:已扫描。能力是事实,不是缺陷; 周下载与 star 只作参考,不参与评分。
认证等级只回答四件事:包本身是否完整可解析(L0)、能不能与别的插件组合(L1)、隔离环境里装不装得上并起得来(L2)、抽样运行时有没有异常(L3)。依赖漏洞、仓库存活、下载量都不参与评级,只作为独立信号标注。可信 ≠ 无漏洞,上架 ≠ 推荐。
| DSH peer 依赖 | 4 个cordisdsh-llmdsh-system-promptdsh-tools均为 @deepseek-ai/ 下的包 |
|---|---|
| Node 要求 | ^22.19 || >=24 |
| 第三方依赖 | 1 个 |
| bundle patch | ./cordis.patch.yml |
| 依赖安全公告 | 已查询全部依赖,没有匹配到已公开的安全公告(含 DSH 框架包在内的 @deepseek-ai/* 不作查询——那是运行时自己的问题,不是插件的。) |
元数据
| 主页 | https://github.com/52sujiu/dsh-context-mode#readme |
|---|---|
| 仓库最近提交 | 2026-09-14 |
| 仓库创建 | 2026-09-11 |
DSH