xiayuhkust/dsh-shell-kit--packages-script-exec0

dsh-plugin-script-exec

DeepSeek Harness的run_script工具:将多行脚本写入临时文件并执行,避免Windows内联引号转义问题。

AI 分析

核心用途是解决Windows系统下多行脚本执行时的转义和乱码问题。适合经常需要在DSH中运行pwsh、python或node脚本的Windows用户。

套件
dsh-plugin-script-exec
版本
0.1.0
授權
MIT
最近更新
2026年8月15日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

dsh-plugin-script-exec

给 DeepSeek Harness 增加 run_script 工具:脚本先写入临时文件再执行(pwsh / python / node),执行后删除。

Windows 上内联传递多行脚本(pwsh -Commandpython -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

参数说明
languagepwsh / python / node
code脚本源码;写入临时文件,pwsh 自动加 BOM
description可选,一句话说明脚本用途

返回 exitCodestdoutstderr

License

MIT