dsh-host-apiproxy
github.com/deepseek-ai/deepseek-harness
v0.0.1-rc.1
模型与账号
写入文件发起网络请求
所有客户端共享的 API 网关,由三部分组成:TypeScript API 契约(`src/api/`,零 Node 依赖,可从浏览器导入)、fetch 载体对(`src/fetch/`:宿主侧的 `toFetchHandler`,客户端侧的 `AbstractApiClient` 及平台子类),以及宿主侧实现(`src/api-proxy.ts`:`createApiProxy` 加上默认导出的 `ApiProxyService` 网
作者原文(英文)
API gateway: the ApiProxy contract (api/), the fetch carrier pair (fetch/), and the host-side gateway plugin providing ctx.apiProxy
中文简介由 DeepSeek 模型翻译,仅供参考。
检测报告
有一定能力。命中了若干能力模式,大多是插件正常工作时会用到的。
2需留意3一般19未命中
高关注需留意一般
能力清单
- 写入文件
writes-files需留意16 处命中lib/types/api-proxy.js:1226await mkdir(cwd, { recursive: true });lib/types/api-proxy.js:1855async rename(request) {lib/types/api-proxy.js:1865const accepted = titles.rename(found.agent.session, title);lib/types/api-proxy.js:2330async rename(request) {- 看写入位置。写自己的配置目录是正常的,写系统目录不是。
- 发起网络请求
network需留意6 处命中lib/types/fetch/client.js:197* SSE protocol path: streaming fetch (not EventSource), '\n\n' framing, ServerRequest envelope +lib/types/fetch/client.js:356return this.handler.fetch(input, init);lib/types/fetch/client.js:362this.handler.fetch(input, init)lib/types/fetch/handler.js:169* @returns an object holding `fetch(Request)`; paths outside /api/ return 404.- 看请求发往哪些域名。发往作者自己的后端是常见做法。
- 接触凭据或密钥
credentials一般256 处命中lib/types/api-proxy.js:23// The settings/credentials seams: brand guards run at this wire boundary; thelib/types/api-proxy.js:27import { credentialRef } from '@deepseek-ai/dsh-credentials';lib/types/api-proxy.js:1458/** Missing-service report shared by the credentials domain. */lib/types/api-proxy.js:1459function credentialsAbsent() {- 看它读取哪些凭据、发往哪里。用于登录自己的服务是正常的。
- 动态加载模块
dynamic-import一般70 处命中…es/api/agent-presets.schema.d.ts:32sessionId: z.ZodType<import("@deepseek-ai/dsh-session").SessionId, unknown, z.core.$ZodTypeInternals<import("@deepseek-a……/types/api/approvals.schema.d.ts:12sessionId: z.ZodType<import("@deepseek-ai/dsh-session").SessionId, unknown, z.core.$ZodTypeInternals<import("@deepseek-a…lib/types/api/commands.schema.d.ts:17sessionId: z.ZodType<import("@deepseek-ai/dsh-session").SessionId, unknown, z.core.$ZodTypeInternals<import("@deepseek-a…lib/types/api/commands.schema.d.ts:31sessionId: z.ZodType<import("@deepseek-ai/dsh-session").SessionId, unknown, z.core.$ZodTypeInternals<import("@deepseek-a…- 动态导入本身无害,但会让依赖关系难以静态审阅。
- 读取环境变量
reads-env一般6 处命中lib/index.js:414const env = internals.env ?? process.env;lib/index.js:438const env = internals.env ?? process.env;lib/index.js:474const env = internals.env ?? process.env;lib/types/native-path-opener.js:72const env = internals.env ?? process.env;- 环境变量里常混有密钥。看它是否把整个 env 都读走。
逐条扫描明细
| 能力 | 标识 | 关注度 | 命中次数 |
|---|---|---|---|
| 写入文件 | writes-files | 需留意 | 16 |
| 发起网络请求 | network | 需留意 | 6 |
| 接触凭据或密钥 | credentials | 一般 | 256 |
| 动态加载模块 | dynamic-import | 一般 | 70 |
| 读取环境变量 | reads-env | 一般 | 6 |
这份报告的口径
扫描读的是包里的源码,全程不执行第三方代码。 本次读了 84 个文件,扫描于 2026-10-14。 命中次数只说明源码里出现过这类调用,不说明行为好坏——一个插件读写文件 500 次和 1 次 都会被记为「读取文件」。这是能力清单,不是信任评分,也不是安全结论: 没扫出来的能力可能只是写法没被规则覆盖。