xiayuhkust/dsh-shell-kit--packages-script-exec ↗★ 0
dsh-plugin-script-exec
run_script tool for DeepSeek Harness: write multi-line scripts to a temp file and execute, avoiding Windows inline-quoting pitfalls.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-plugin-script-exec
给 DeepSeek Harness 增加 run_script 工具:脚本先写入临时文件再执行(pwsh / python / node),执行后删除。
Windows 上内联传递多行脚本(pwsh -Command、python -c)在含引号、中文时频繁因转义失败,agent 往往要试错多次。落盘执行绕开转义问题;pwsh 文件带 UTF-8 BOM(PowerShell 5.1 对无 BOM 的 UTF-8 按 ANSI 解码,中文会乱码)。
执行走 ctx.shell,与内置 pwsh 工具同一沙箱与超时策略,不新增权限面。
安装
dsh plugin --profile web add -w dsh-plugin-script-exec
在 cordis.patch.yml 挂载(用 - insert:):
- insert:
- id: script-exec
name: dsh-plugin-script-exec
config:
timeoutMs: 120000 # 单次脚本超时,默认 120000
maxOutputChars: 30000 # stdout/stderr 各自截断长度,默认 30000
重启 dsh web 生效。
工具 run_script
| 参数 | 说明 |
|---|---|
language | pwsh / python / node |
code | 脚本源码;写入临时文件,pwsh 自动加 BOM |
description | 可选,一句话说明脚本用途 |
返回 exitCode、stdout、stderr。
License
MIT