Saikel-Orado-Liu/dsh-coding-agent-preset--packages-dsh-tool-pwsh-persistent ↗★ 1
dsh-tool-pwsh-persistent
Model-facing persistent pwsh (PowerShell 7) tool for Windows, mirroring @deepseek-ai/dsh-tool-bash-persistent
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-tool-pwsh-persistent
A Windows adaptation of @deepseek-ai/dsh-tool-bash-persistent: a model-facing
persistent pwsh (PowerShell 7) tool over the owner-scoped ctx.terminals
registry. One pwsh shell per agent; the current directory, variables,
functions, aliases and activated environments persist across calls.
It pairs with the PTY backend dsh-terminal-pwsh (registered
under the shell backend type by default).
Config
| Key | Default | Meaning |
|---|---|---|
backendType | shell | Registered PTY backend used for each Agent shell. |
timeoutMs | 300000 | Wall-clock limit for one command; timeout closes the shell. |
maxOutputChars | 16000 | Maximum retained command-output characters. |
description | Persistent-shell description | Model-facing environment contract. |
Command wrapping contract
Each command runs as Invoke-Expression of a backtick-escaped double-quoted
string (multi-line safe, $ preserved), under $ErrorActionPreference = 'Stop' with the previous preference restored afterwards:
- a native command's
$LASTEXITCODEbecomes the reported code; - otherwise success is
0, a caught error is1; - explicit
-ErrorActionoverrides and internaltry/catchbehave normally; - the end marker is emitted on one line:
:.
Result contract
Commands share one shell per Agent, so cwd, exported variables, functions and
background jobs persist across calls. Results exclude the controlled prompt.
A nonzero wrapped command appends [exit code: N]; a shell that exits before
reporting that status instead appends [shell exited: code N] (or the signal
variants), then resets and tells the model that the next call starts fresh.
Long output keeps the earliest retained prefix plus a clipping notice. Timeout
returns bounded partial output, closes the uncertain shell, and reports the
reset.