A local DeepSeek Harness plugin (package `dsh-friction-drive`, repository `Zbcc0826/better-dsh`, not published to npm). It records tool failures, same-argument retries, and results with truncation markers in the current session. Once crossed, the next direct call does not run and waits for the user to choose via `friction_choose`, and the user can also pause the session. Replacement tools and compiled procedures are installed only after user approval, while original tool definitions stay unchanged. `dsh-friction-drive` registers only these 10 tools: `friction_status`, `friction_choose`, `friction_pause`, `propose_quality_loop`, `record_quality_critique`, `record_quality_plan`, `propose_tool_goal`, `apply_tool_change`, `restore_tool_definition`, and `propose_compiled_procedure`. The same bundle also installs `dsh-friction-demo`, which registers 3 sample tools (`ledger_lookup`, `fx_convert`, `window_overlap`); they are sample tools only, not a ledger product. This repository is Zbcc0826/better-dsh, not pgmi-builds/better-dsh.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Zbcc0826/better-dsh
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This is a local DeepSeek Harness (DSH) plugin whose package name is dsh-friction-drive and GitHub repository is Zbcc0826/better-dsh. It is not pgmi-builds/better-dsh: it does not provide an IPython REPL and does not replace DSH's coding capabilities.
The plugin is not published to npm; clone it and install locally. The desktop app and the CLI share one configuration. Behavior comes from the agent's own experience using tools and evolves with real feedback from DeepSeek models running in DSH. Replacement tools, compiled procedures, and the critique-then-implement loop for complex tasks all ask for user approval before running, which can spend extra tokens.
Requirements
- DeepSeek Harness
0.2.2-rc.3or newer, and below0.3.0 - A working
dshCLI or desktop app - The desktop app already includes the pnpm used to install plugins
Install and Uninstall
Pick one of the three methods below. Do not stack two installs together.
1. Desktop Plugins Page
Open Plugins, click the arrow next to Add plugin, and choose Install a third-party plugin. From GitHub, enter:
github:Zbcc0826/better-dsh
For a local clone, you can enter this repository's absolute path. Choose Enable now when installation finishes. The card appears under Installed in Experimental, titled Better DSH, with a switch on the right.
2. CLI
dsh plugin --profile <profile> add github:Zbcc0826/better-dsh
Here <profile> is a CLI profile name, not desktop. dsh plugin --profile desktop is rejected; manage the desktop profile through the Plugins page or node install.mjs below.
3. Install Script at Repo Root
node install.mjs
The script installs the bundle into every existing profile under $DSH_HOME (default ~/.dsh), turns the switch on, and removes old inserts from $DSH_HOME/cordis.patch.yml. A local-path install also vendors @deepseek-ai/dsh-tools into .dsh-deps and links node_modules (because a directory outside the repo will not fall back to the copy inside the app). Do not commit .dsh-deps or node_modules.
Notes and Uninstall
- Restart any running desktop app after installing.
- Do not write an absolute path into
$DSH_HOME/cordis.patch.yml. That insert does not show up on the Plugins page and cannot be turned off with the switch. - Do not run another
dsh plugin addalongside it; stacking two installs registers tools twice. - To remove it, turn the switch off on the plugin card (unloading
dsh-friction-drive), then uninstall.
How It Works
Friction Tracking and Gating
- The current session records tool failures, same-argument retries, and calls whose result value carries a truncation marker.
- Argument validation failures do not add to the score. Call count, truncation, and slow calls are only counted when the result value contains the corresponding marker.
- Once the threshold is crossed, the next direct call does not run and returns
GATEDalong withfriction_status.card. - The card offers three choices: build a replacement tool, continue once, or pause this session. Continuing once allows one execution only, then re-evaluates. Do not click Allow on the user's behalf.
friction_pausepauses the gate for the current session only after the user clicks Allow, and automatically resumes when the session ends.- Hint lines add only one sentence after the result. Approval cards do not quote the model's summary. Do not ask the user to reply "已授权" (authorized).
Replacement Tools and Approval Rules
- Original tool definitions stay unchanged. The current session switches to a new tool only after friction crosses the threshold and the user approves the replacement.
- Trying to create a replacement tool directly before crossing the threshold returns
BELOW_THRESHOLD. - Call
propose_tool_goalonly when the user explicitly asks for a new tool: it confirms first, and records nothing if declined. After confirmation,apply_tool_changetriggers a second approval before installation, while the original tool stays callable. Already-gated tools do not need this extra confirmation. - Approval affects only the current session by default. If
"persist": trueis set in the proposal and approved, the tool persists across later sessions and can be called without repeating the two approvals (the original tool stays callable in new sessions). - If a replacement tool reports
inactive contexton its first call, the original tool immediately becomes usable again. - When there is no approval UI, approval immediately returns unapproved—nothing is installed and nothing hangs (so a CLI session without an approval UI does not modify tools).
- Installed new tools can be revised later (changing their own schema, execution, and description).
friction_statusnotesrecord the original tool's problem, the new usage and schema, and mark each asvoluntaryorfriction. restore_tool_definitioncan undo changes; when no earlier version exists, the new tool is uninstalled and the original tool becomes callable again.
Proposal Fields and Constraints
name: semantic names such asplugin_checkare kept; do not expect renaming tofd_bash_<time>.problemandusage: max 200 characters each.schema: supports both the shorthand object format ({ "dir": { "type": "string", "required": true, "description": "..." } }) and JSON Schema withpropertiesandrequired. Do not writerequired: falseon optional fields.- Argument handling: omitted optional fields become an empty string; only missing required fields report missing arguments; unknown argument names not in the schema are rejected as unknown arguments instead of treated as omitted.
run: can be a script ({ "kind": "script", "command": "node --check ${dir}" }or a command string) or a delegate ({ "kind": "delegate", "tool": "<original-tool>", "overrides": {} }). Max script length is 4000 characters.- Templates and environment variables:
${dir}and{{dir}}are replaced with shell single-quoted values, so do not add quotes around them in the template;$dirand the JSON file pointed to byFD_ARGScontain the raw unquoted values. - Patch and metric rules:
metriccan only beprojected_calls; patch keys must matchpatchKeys; patches that do not reduce projected calls are rejected; puttingconfirmedin the patch has no effect.
Compiled Procedures (ec_ Tools)
- When the same sequence of external tools succeeds repeatedly,
friction_status.compilablekeeps only the longest non-overlapping fragments. - Check candidate
asset_idvalues before callingpropose_compiled_procedure. Nothing runs the original tool or script before approval. - After approval, an
ec_tool is installed in the current session. Future direct calls whose first-step tool name and constants match are routed toec_. Slots are checked only against the two validated bindings. Nothing is installed when there is no approval UI.
Critique-then-Implement for Complex Tasks
- Complex tasks can separately ask for approval to run a critique-then-implement loop; simple lookups do not enter it automatically.
- After approval, defects are recorded first, followed by secondary effects for each planned change. Implementation starts only after
friction_status.quality.readyis true. - This loop does not replace the tool or procedure approvals above.
Included Packages and Tools
dsh-friction-drive: registers only these 10 tools:friction_status,friction_choose,friction_pause,propose_quality_loop,record_quality_critique,record_quality_plan,propose_tool_goal,apply_tool_change,restore_tool_definition,propose_compiled_procedure.dsh-friction-demo: installed by the same bundle, registering 3 sample tools:ledger_lookup,fx_convert,window_overlap. These are sample tools only, not a ledger product; they change through their own registered fields and keep their original names.
Session State and Keys
- Session state is stored under
$DSH_HOME/friction-drive/sessions/<session-id>/. - Do not commit API keys. The sample
./run-dsh.shreadsDEEPSEEK_API_KEYor the gitignored.deepseek-keyfile.
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38385
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37218
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28812
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 9804
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6039
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4659
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.