rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:citydirector/dsh-pwsh-plugin
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English · 简体中文
PowerShell sessions, optional tool guards and planned file removal for DeepSeek Harness.
llrun to enforce the session's write boundary. The binary ships with the package.Requires PowerShell 7 and a compatible DSH 0.2.x host with settings and tool-guard support. The Windows Bash feature also needs WSL.
Verified against DSH 0.2.2-rc.3 (desktop). The bundle registers no HTTP, WebSocket or static route, so the host's admission and peer-authentication contract does not apply. The client half uses only the settings.section and plugins.row.config slots and declares @deepseek-ai/dsh-client-ui-settings and @deepseek-ai/dsh-client-ui-primitives in dsh.client.inject.
In DSH, open Plugins → Add plugin, enter dsh-pwsh-plugin, and enable it. The bundle registers its tools and settings page automatically.
For the desktop CLI:
$dsh = '<desktop install>\resources\runtime\cli\bin\dsh.cmd'
$env:DSH_HOME = '<DSH data directory>'
& $dsh plugin --profile desktop add 'dsh-pwsh-plugin'
Use dsh-pwsh-plugin@<version> to select a release. The reserved desktop profile requires the desktop application's CLI. If you previously added a manual pwsh-run entry, remove it before installing the bundle to avoid duplicate registration.
Call pwsh_run with the script body as-is; do not wrap it in pwsh -c or add shell escaping.
{"script":"$buildName = 'demo'; Write-Output $buildName"}
For a one-off command:
{"script":"Get-Process | Select-Object -First 5","mode":"isolated"}
| Parameter | Default | Description |
|---|---|---|
script |
Required | PowerShell script text. |
mode |
persistent |
Retain state, or use isolated for a fresh process disposed after the call. |
workdir |
Current directory | Set the directory before execution; an invalid path refuses the script. Persistent calls retain it. |
timeoutMs |
120000 |
Execution timeout in milliseconds, excluding queue waiting. |
Calls to one persistent session run serially; different DSH sessions are independent. Isolated calls share the process limit, pay startup cost and refuse when capacity is full rather than evicting a persistent session.
Output uses PowerShell tables and lists. Use ConvertTo-Json for structured data; use 2>&1 or *>&1 when stream ordering matters.
Open pwsh settings in the settings sidebar, or the plugin row's configuration button. Both switches default to off, apply to every preset and session in the current profile, and take effect after Save.
| Setting | Configuration key | Behavior |
|---|---|---|
| Require pwsh_run | enforcePwshRun |
Refuse ordinary built-in pwsh calls and direct the model to pwsh_run. Read-only sessions, explicit background jobs and valid requests for a higher permission mode remain available; elevation still needs host approval. |
| Review targets before deletion | enforceFileRemoval |
Block common direct deletion commands in pwsh, pwsh_run and bash, and direct the model to review a removal plan. |
The guards check tool entries and common script syntax; they do not inspect every child program or prevent every filesystem deletion.
Use file_remove to prepare a fixed inventory:
{"action":"plan","paths":["D:/project/node_modules"]}
Review the returned targets, then confirm in a separate call:
{"action":"execute","planId":"<plan ID>"}
Small inventories list every entry. Large ones return exact roots, counts, byte totals, a digest and a preview. Read the complete inventory with:
{"action":"list","planId":"<plan ID>","offset":0,"limit":128}
Follow nextOffset until it is null. 512 is only the small-inventory display threshold. Scans default to 250000 file, directory and link entries; hitting a scan budget produces no executable plan.
Long operations return an operationId. Use action: "status" or action: "cancel" with that ID on the same tool; waitMs accepts 0–10000. A completed status contains the original response in result.
gio trash. Recycling never falls back to permanent deletion. Restricted sessions may need explicit, host-approved escalation for the exact plan..git paths are refused.For test or build output, file_temp with action: "create" returns a new directory and tempId. Later, action: "clean" with that ID (a filesystem path is not accepted) permanently deletes only that registered directory. Existing directories cannot be registered. Large-tree budgets, progress, cancellation and link checks apply here too.
See the file-removal guide for approval examples, limits and failure handling.
Set process parameters and scan budgets on the existing pwsh-run bundle entry. The two live guard switches are described under Settings.
| Key | Default | Description |
|---|---|---|
pwshPath |
pwsh |
PowerShell 7 executable, resolved through PATH. |
timeoutMs |
120000 |
Default script timeout, in milliseconds. |
idleMs |
1800000 |
Idle-session lifetime, in milliseconds. |
maxSessions |
4 |
Process limit, including isolated calls. Busy sessions are not evicted. |
maxOutputBytes |
8388608 |
Per-call UTF-8 output budget; errors have a separate 65536-byte budget. Truncation is reported. |
allowUnconfined |
false |
Allow startup when the sandbox policy service is absent. |
fileScanMaxEntries |
250000 |
Complete-tree entry budget; maximum 2000000. |
fileScanMaxBytes |
67108864 |
Serialized inventory budget shared by scanning and retained plans; maximum 536870912 bytes. |
fileScanTimeoutMs |
120000 |
Scan timeout; maximum 1800000 ms. |
fileOperationTimeoutMs |
300000 |
File-operation timeout; maximum 1800000 ms, independent of tool waiting. |
The inventory budget limits serialized data, not total process memory. Missing sandbox policy is refused unless allowUnconfined is explicitly enabled.
workspace-write uses DSH's sandbox. danger-full-access follows the host's unrestricted mode. read-only refuses pwsh_run and file-tool operations; use built-in pwsh for read-only commands.exit N does not expose its numeric code; inspect $LASTEXITCODE for native commands. Output streams are grouped by type unless merged in the script.DSH's Plugins page manages version checks and installation. Use an npm registry installation for this update path; the plugin has no separate updater.
The local pnpm minimumReleaseAge policy can defer a new release. Registry metadata and download nodes can also become available at different times; retry later if a newly published tarball returns 404, and check the version actually installed.
Finish active tasks before updating: plugin replacement clears persistent state. Follow the host's reload or restart prompt; after installing through an external CLI, restart DSH to load the new code.
pnpm install --ignore-scripts --config.auto-install-peers=false
pnpm test
pnpm run test:all
The full regression suite currently has 15 scripts / 308 assertions. It needs Windows, Node.js 24, PowerShell 7, WSL and a loadable DSH runtime. Use DSH_MODULES or DSH_MODULES_ASAR when automatic runtime discovery is unavailable; release validation must finish without skips. Run bash wsl/acceptance.sh from a plain WSL shell, outside the plugin's fence.
For a release, commit changes, then run:
npm version patch -m 'chore(release): %s'
node scripts/release-check.mjs
git push --atomic origin main <tag>
The release workflow publishes through npm trusted publishing with provenance.
DSH-build · Remote access · DeepInfra proxy · Loop rescue · UI Locate · Session manager
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。