其他
完整应用
deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
DSH 动态 Cordis 插件:通过 harness 的 shell 服务在 Windows 本地终端 执行 shell 命令,并为模型注册一个名为 shell 的动态工具。
shell,模型可以直接调用它在当前 Windows 机器上执行任意命令(文件、进程、git、npm 等)。command(必填)、workdir、timeoutMs。[stderr] 段 + 退出标记([exit code: N] / [killed by signal: ...] / [timed out after Nms])。shell 服务(ctx.get('shell') → resolve → run),Windows 下经 PowerShell 执行,无需引入任何外部依赖。dsh-shell-exec/
├── src/
│ └── host.js # Host 半区源码(cordis_define 的 code.host 直接粘贴此文件内容)
├── scripts/
│ └── check.js # 语法自检(npm run check)
├── package.json
├── plugin.json # 插件元数据(文档用途)
├── README.md
├── LICENSE # MIT
└── .gitignore
cordis_define:plugin.kind = new,idPrefix 填 she;code.host 粘贴 src/host.js 的完整内容;pluginId / packageId 执行 cordis_run(mode = run)激活插件。shell 工具执行本地命令。模型调用 shell 工具时,参数形如:
{
"command": "dir",
"workdir": "C:\\Users\\godeyes\\Documents\\dsh"
}
返回结构:
{
"ok": true,
"exitCode": 0,
"signal": null,
"timedOut": false,
"timeoutMs": 30000,
"stdout": "...",
"stderr": "",
"text": "..."
}
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
command |
string | 是 | 要执行的 shell 命令行,例如 dir、git status |
workdir |
string | 否 | 命令的工作目录,缺省使用 harness 配置的工作区 |
timeoutMs |
number | 否 | 超时毫秒数;执行器会做上限截断,缺省使用实现配置的默认值 |
harness.defineTool({...}) 定义动态工具(参数使用 Cordis 参数 DSL,输出 schema 为 { type: 'json' })。harness.registerTool(ctx, tool) 注册到当前 Fiber,插件停止/更新时自动注销。shell.resolve(request) → shell.run(spec),其中 request.signal 透传工具执行的取消信号。ShellRunResult 包含 exitCode / signal / timedOut / timeoutMs / stdout / stderr,插件将其渲染为模型可见文本。插件注册的 shell 工具与 harness 自带的 pwsh 工具共用同一个沙箱执行上下文(受限进程环境,如 CODEX_SANDBOX_NETWORK_DISABLED=1 等托管变量所示)。该上下文对进程有额外限制,实测影响如下:
| 工具 | 沙箱内行为 |
|---|---|
curl.exe(默认 schannel 后端)、PowerShell Invoke-WebRequest / Invoke-RestMethod、npm 等走 SSPI/Schannel 的 HTTPS 客户端 |
❌ 报 schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030E),对所有域名一致 |
走 OpenSSL 后端的工具(如 git 配置了 http.sslBackend openssl) |
✅ 正常,可完成 TLS 握手与推送 |
证书存储枚举(Cert:\CurrentUser\My 等) |
✅ 正常 |
要点:
SecurityProviders 被截断无关——那是另一个独立问题,影响的是 LSA 模式包(Kerberos / NTLM / CredSSP / PKU2U,即域认证、SMB、RDP 等),不影响用户态 Schannel。git -c http.sslBackend=openssl push,或对 curl 使用 --ssl-no-revoke 之外的替代方案(如 wget / OpenSSL 后端)。npm run check # 语法自检(把 src/host.js 作为函数体编译,不执行)
远程仓库:https://github.com/osmondlee/dsh-shell.git
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。