@xiaoso/dsh-tool-plus 0.1.14-beta.0 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md
CHANGED
|
@@ -22,7 +22,7 @@ Essential tools enhancement for DeepSeek Harness: persistent bash, structured re
|
|
|
22
22
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
|
-
- **bash**: persistent shell; `cd` and `export` keep state across calls; verbose logs (git/npm/cargo…) are condensed automatically; overlong output keeps only head and tail, with the full content written to disk for later retrieval; long-running commands are moved to the background automatically; optionally intercepts `cat`, `grep`, `find`, and `sed -i` to steer you toward the dedicated tools
|
|
25
|
+
- **bash**: persistent shell; `cd` and `export` keep state across calls; verbose logs (git/npm/cargo…) are condensed automatically; overlong output keeps only head and tail, with the full content written to disk for later retrieval; long-running commands are moved to the background automatically; optionally intercepts `cat`, `grep`, `find`, and `sed -i` to steer you toward the dedicated tools (off by default)
|
|
26
26
|
- **Safe delete**: `rm` moves files to the system trash by default instead of deleting permanently, so accidental deletes are recoverable; use `command rm` for a real delete
|
|
27
27
|
- **read**: precise line-range reading (supports `:N-M`, `:raw`, and multiple ranges); large code files return a structural summary by default, with details expanded on demand; zip/tar archives, SQLite, notebooks, and PDFs read directly; PNG / JPEG / WebP / GIF images read directly, oversized ones scaled down automatically; can fetch web content (including images embedded in the page); SPA sites (content rendered dynamically by JS, e.g. excalidraw.com) are automatically fetched via local browser rendering
|
|
28
28
|
- **write**: atomic writes that return a diff of the changes; supports patch-style writing, and can write directly into zip/tar archive members and SQLite data
|
|
@@ -93,6 +93,40 @@ Writes go through the harness's own `ctx.configEditor`, so they inherit the prof
|
|
|
93
93
|
|
|
94
94
|
Works out of the box, no configuration needed. Common tweaks: background threshold (`autoBackgroundMs`), timeouts (`defaultTimeoutMs` / `maxTimeoutMs`), the output truncation window, the default edit mode (`editMode`, default `replace`), and the structured summary toggle (`readSummarizeEnabled`).
|
|
95
95
|
|
|
96
|
+
## Performance
|
|
97
|
+
|
|
98
|
+
On Linux, comparing the official standard mode with this plugin's Standard enhanced preset (SWE-bench Multilingual, 20 tasks × 3 rounds):
|
|
99
|
+
|
|
100
|
+
| Metric | Official tool surface | This plugin (command interception on) | This plugin (command interception off, default) |
|
|
101
|
+
|---|---|---|---|
|
|
102
|
+
| Resolve rate | 83.3% | **83.3%** | 81.7% (1 task lower, within normal variance) |
|
|
103
|
+
| Steps / task | 24.4 | 29.7 (+21.7%) | 25.3 (+3.8%) |
|
|
104
|
+
| Total tokens / task | **729,434** | 954,100 (+30.8%) | 779,799 (+6.9%) |
|
|
105
|
+
| System prompt / step (incl. tool definitions) | **4,642** | 6,305 (+35.8%) | 6,305 (+35.8%) |
|
|
106
|
+
| System prompt total / task (per step × steps) | **113,265** | 187,259 (+65.3%) | 159,622 (+40.9%) |
|
|
107
|
+
| Net tokens / task (excl. system prompt) | **616,169** | 766,841 (+24.5%) | 620,177 (+0.7%) |
|
|
108
|
+
| Average context length at task end (tokens) | **42,817** | 48,645 (+13.6%) | 44,781 (+4.6%) |
|
|
109
|
+
| `read` calls | 225 | 459 | **198** |
|
|
110
|
+
| `bash` time per call | 3,140 ms | **2,391 ms** | 2,045 ms |
|
|
111
|
+
| `bash` tokens returned per call | 790 tok | **343 tok** | 638 tok |
|
|
112
|
+
| Average time / task (excludes token-rate and network-speed fluctuation) | **123 s** | 135 s | 151 s |
|
|
113
|
+
|
|
114
|
+
Notes:
|
|
115
|
+
|
|
116
|
+
1. The average time is an end-to-end measurement that does not account for token-rate or network-speed fluctuation; use the absolute values for horizontal comparison only.
|
|
117
|
+
2. The figures above describe this benchmark only (its tasks use little context, so they do not represent large tasks).
|
|
118
|
+
|
|
119
|
+
Conclusions:
|
|
120
|
+
|
|
121
|
+
1. The resolve rate matches the official tools (the interception-off group is 1 task lower, within normal variance).
|
|
122
|
+
2. `bash` itself is leaner, and the tokens it saves roughly offset the extra system prompt from thicker tool definitions (the plugin adds capabilities, so its definitions are thicker than the official preset's).
|
|
123
|
+
3. `bash` is faster, but the gain is cancelled out by side effects from `bash` itself and the other enhanced tools.
|
|
124
|
+
4. On Linux the combined performance is on par with the official standard-mode tools, with a richer feature set.
|
|
125
|
+
|
|
126
|
+
So on Linux this plugin cannot promise lower token usage or better performance; Windows is not suitable for running the standard benchmark, so the only claim there is a **personal impression** that it is more pleasant to use than PowerShell.
|
|
127
|
+
|
|
128
|
+
Full data and the per-task matrix: [docs/benchmark/sbml-compare-ops.md](docs/benchmark/sbml-compare-ops.md) (Chinese).
|
|
129
|
+
|
|
96
130
|
## Requirements
|
|
97
131
|
|
|
98
132
|
- **dsh CLI**: installed globally, `npm i -g @deepseek-ai/dsh`
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ DeepSeek Harness 基础工具增强:持久 bash、结构化 read、多模式 e
|
|
|
22
22
|
|
|
23
23
|
## 功能特性
|
|
24
24
|
|
|
25
|
-
- **bash**:持久 shell,`cd`、`export` 跨调用保持状态;冗长日志(git/npm/cargo…)自动压缩;超长输出只保留头尾,完整内容落盘可回读;长命令自动转后台;可选拦截 `cat`、`grep`、`find`、`sed -i
|
|
25
|
+
- **bash**:持久 shell,`cd`、`export` 跨调用保持状态;冗长日志(git/npm/cargo…)自动压缩;超长输出只保留头尾,完整内容落盘可回读;长命令自动转后台;可选拦截 `cat`、`grep`、`find`、`sed -i`,引导改用专用工具(默认关闭)
|
|
26
26
|
- **安全删除**:`rm` 默认把文件移入系统回收站而非永久删除,误删可恢复;需要真删时用 `command rm`
|
|
27
27
|
- **read**:按行区间精准读取(支持 `:N-M`、`:raw`、多区间);大代码文件默认返回结构摘要,细节按需展开;zip/tar 归档、SQLite、notebook、PDF 直接读;PNG / JPEG / WebP / GIF 图片直读,超大图自动缩放;可抓取网页内容(含网页内图片);SPA 站点(内容由 JS 动态渲染,如 excalidraw.com)自动改用本机浏览器渲染后抓取
|
|
28
28
|
- **write**:原子写入,返回修改 diff;支持补丁式写入,可直接写 zip/tar 归档成员与 SQLite 数据
|
|
@@ -87,12 +87,45 @@ dsh plugin --profile web add link:<本仓库路径>
|
|
|
87
87
|
|
|
88
88
|
写入通过宿主自己的 `ctx.configEditor` 完成,因此自带 profile 锁、并发保护、原子写与失败回滚。
|
|
89
89
|
|
|
90
|
-
> 从 0.1.9 或更早升级过来的话:`~/.dsh/.agent-presets/` 目录**已经没有任何代码读它**(0.1.7 起预设改为补丁层声明),可以安全删除;设置页检测到它会给出提示。
|
|
91
|
-
|
|
92
90
|
## 配置
|
|
93
91
|
|
|
94
92
|
开箱即用,无需配置。需要微调时常用项有:后台阈值(`autoBackgroundMs`)、超时(`defaultTimeoutMs` / `maxTimeoutMs`)、输出截断窗口、编辑默认模式(`editMode`,默认 `replace`)、结构化摘要开关(`readSummarizeEnabled`)。抓取相关:可切换网页转 Markdown 的后端(`fetchReader`,含浏览器 JS 渲染——SPA 页面),设置面板里可一键「探测浏览器」查看本机可用的 Chrome/Edge。
|
|
95
93
|
|
|
94
|
+
## 性能
|
|
95
|
+
|
|
96
|
+
标准模式/标准模式增强下,在 Linux 上跑 SWE-bench Multilingual(20 题 × 3 轮):
|
|
97
|
+
|
|
98
|
+
| 指标 | 官方工具面 | 本插件(命令拦截开) | 本插件(命令拦截关,默认) |
|
|
99
|
+
|---|---|---|---|
|
|
100
|
+
| 解题率 | 83.3% | **83.3%** | 81.7%(低 1 题,正常波动) |
|
|
101
|
+
| 步数 / 题 | 24.4 | 29.7(+21.7%) | 25.3(+3.8%) |
|
|
102
|
+
| 总 token / 题 | **729,434** | 954,100(+30.8%) | 779,799(+6.9%) |
|
|
103
|
+
| 系统提示词 / 步(含工具定义) | **4,642** | 6,305(+35.8%) | 6,305(+35.8%) |
|
|
104
|
+
| 系统提示词累计 / 题(单步 × 步数) | **113,265** | 187,259(+65.3%) | 159,622(+40.9%) |
|
|
105
|
+
| 净 token / 题(除系统提示词) | **616,169** | 766,841(+24.5%) | 620,177(+0.7%) |
|
|
106
|
+
| 任务结束后平均上下文长度(token) | **42,817** | 48,645(+13.6%) | 44,781(+4.6%) |
|
|
107
|
+
| `read` 调用次数 | 225 | 459 | **198** |
|
|
108
|
+
| `bash` 每次调用耗时 | 3,140 ms | **2,391 ms** | 2,045 ms |
|
|
109
|
+
| `bash` 每次调用返回 token | 790 tok | **343 tok** | 638 tok |
|
|
110
|
+
| 平均耗时 / 题(未计入 token 速率波动、网络速度带来的误差) | **123 s** | 135 s | 151 s |
|
|
111
|
+
|
|
112
|
+
注:
|
|
113
|
+
|
|
114
|
+
1. 平均耗时是端到端实测,未计入 `token` 速率波动、网络速度带来的误差,绝对值只作横向参考。
|
|
115
|
+
2. 本节性能只代表在该基准测试下的表现(该基准任务占用上下文较低,因此无法代表大任务情况)
|
|
116
|
+
3. 由大模型计算统计核对,数据可能有疏漏,但不影响整体结论
|
|
117
|
+
|
|
118
|
+
结论:
|
|
119
|
+
|
|
120
|
+
1. 解题率与官方持平(命令拦截关的那组低 1 题,属正常波动)
|
|
121
|
+
2. `bash` 本身更省,省下的 token 基本能抵消工具定义变厚带来的系统提示词增量(功能更强,工具定义比官方预设更厚)
|
|
122
|
+
3. `bash` 更快,但带来的增益会被 `bash` 自身以及其他增强工具带来的副作用抹平
|
|
123
|
+
4. 在 `linux` 上,综合性能和官方默认标准模式工具相当,但功能更丰富
|
|
124
|
+
|
|
125
|
+
因此本插件工具在 `linux` 上,无法承诺更省 `token` 或具有更强的性能;`windows` 不适合跑标准测试,只能从**个人体感**说比 `powershell` 更好用。
|
|
126
|
+
|
|
127
|
+
完整的四组数据与逐题矩阵见 [docs/benchmark/sbml-compare-ops.md](docs/benchmark/sbml-compare-ops.md)。
|
|
128
|
+
|
|
96
129
|
## 环境要求
|
|
97
130
|
|
|
98
131
|
- **dsh CLI**:需全局安装,`npm i -g @deepseek-ai/dsh`
|
package/lib/client.js
CHANGED
package/lib/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ __installBunShim();
|
|
|
3
3
|
import { n as fs_promises_shim_exports, t as exists } from "./fs-promises-shim-B2YFWkcd.mjs";
|
|
4
4
|
import { i as setRuntimeLogger, n as systemChromiumCandidatesForTest, r as runtimeLogger } from "./launch-BIWNyrBB.mjs";
|
|
5
5
|
import { $ as isEnoent, A as formatCount, C as warn, D as installBunShim, F as $flag, N as $env, O as formatAge, P as $envpos, Q as hasFsCode, U as getAutoQaDbPath, V as VERSION, X as getRemoteDir, Y as getPuppeteerDir, at as findOnPath, b as debug, c as combineSignals, d as $which, et as isEnotdir, it as untilAborted, k as formatBytes$1, l as exec, m as readImageMetadata, nt as peekFile, q as getInstallId, tt as isProbablyBinary, u as render, x as error } from "./src-AELUUb5U.mjs";
|
|
6
|
-
import { C as truncateToWidth$1, S as replaceTabs, _ as formatCodeFrameLine, a as fetchBinary, b as LRUCache, c as getParallelExtractContent, d as convertFileWithMarkit, f as Settings, g as capParseErrors, h as OMP_DEFAULTS, i as convertWithMarkit, l as ensureTool, m as settings, o as extractWithParallel, p as isSettingsInitialized, s as findParallelApiKey, u as CONVERTIBLE_EXTENSIONS, v as formatParseErrors, x as padding, y as shortenPath } from "./utils-
|
|
6
|
+
import { C as truncateToWidth$1, S as replaceTabs, _ as formatCodeFrameLine, a as fetchBinary, b as LRUCache, c as getParallelExtractContent, d as convertFileWithMarkit, f as Settings, g as capParseErrors, h as OMP_DEFAULTS, i as convertWithMarkit, l as ensureTool, m as settings, o as extractWithParallel, p as isSettingsInitialized, s as findParallelApiKey, u as CONVERTIBLE_EXTENSIONS, v as formatParseErrors, x as padding, y as shortenPath } from "./utils-CW2Qi8Gk.mjs";
|
|
7
7
|
import { t as sanitizeText } from "./sanitize-text-BCf5KmCf.mjs";
|
|
8
8
|
import { n as isRecord$5 } from "./type-guards-CttAANEx.mjs";
|
|
9
9
|
import { n as ToolError, r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
|
|
@@ -4202,7 +4202,7 @@ const TOOL_PLUS_FIELDS = [
|
|
|
4202
4202
|
{
|
|
4203
4203
|
name: "interceptorEnabled",
|
|
4204
4204
|
kind: "boolean",
|
|
4205
|
-
default:
|
|
4205
|
+
default: false,
|
|
4206
4206
|
labelKey: "interceptorEnabled",
|
|
4207
4207
|
hintKey: "interceptorEnabledHint",
|
|
4208
4208
|
group: "behavior",
|
|
@@ -4958,7 +4958,7 @@ const Config = z.object({
|
|
|
4958
4958
|
outputSinkTailBytes: z.number().default(fieldDefault("outputSinkTailBytes", 51200)).volatile(),
|
|
4959
4959
|
outputSinkHeadBytes: z.number().default(fieldDefault("outputSinkHeadBytes", 20480)).volatile(),
|
|
4960
4960
|
minimizerEnabled: z.boolean().default(fieldDefault("minimizerEnabled", true)).volatile(),
|
|
4961
|
-
interceptorEnabled: z.boolean().default(fieldDefault("interceptorEnabled",
|
|
4961
|
+
interceptorEnabled: z.boolean().default(fieldDefault("interceptorEnabled", false)).volatile(),
|
|
4962
4962
|
nonInteractiveEnv: z.boolean().default(fieldDefault("nonInteractiveEnv", true)).volatile(),
|
|
4963
4963
|
snapshotEnabled: z.boolean().default(fieldDefault("snapshotEnabled", true)).volatile(),
|
|
4964
4964
|
rmSafe: z.boolean().default(fieldDefault("rmSafe", true)).volatile(),
|
|
@@ -5069,7 +5069,7 @@ function resolveConfig(input) {
|
|
|
5069
5069
|
outputSinkTailBytes: config.outputSinkTailBytes ?? fieldDefault("outputSinkTailBytes", 51200),
|
|
5070
5070
|
outputSinkHeadBytes: config.outputSinkHeadBytes ?? fieldDefault("outputSinkHeadBytes", 20480),
|
|
5071
5071
|
minimizer: resolveMinimizer(),
|
|
5072
|
-
interceptorEnabled: config.interceptorEnabled ?? fieldDefault("interceptorEnabled",
|
|
5072
|
+
interceptorEnabled: config.interceptorEnabled ?? fieldDefault("interceptorEnabled", false),
|
|
5073
5073
|
nonInteractiveEnv: config.nonInteractiveEnv ?? fieldDefault("nonInteractiveEnv", true),
|
|
5074
5074
|
snapshotEnabled: config.snapshotEnabled ?? fieldDefault("snapshotEnabled", true),
|
|
5075
5075
|
rmSafe: config.rmSafe ?? fieldDefault("rmSafe", true),
|
|
@@ -11479,7 +11479,7 @@ let specialHandlersPromise;
|
|
|
11479
11479
|
* requires a special handler, so we keep them out of the cold-startup graph.
|
|
11480
11480
|
*/
|
|
11481
11481
|
function loadSpecialHandlers() {
|
|
11482
|
-
specialHandlersPromise ??= import("./scrapers-
|
|
11482
|
+
specialHandlersPromise ??= import("./scrapers-Dm5OqvyJ.mjs").then((m) => m.specialHandlers);
|
|
11483
11483
|
return specialHandlersPromise;
|
|
11484
11484
|
}
|
|
11485
11485
|
/**
|
|
@@ -3,7 +3,7 @@ __installBunShim();
|
|
|
3
3
|
import { n as fs_promises_shim_exports } from "./fs-promises-shim-B2YFWkcd.mjs";
|
|
4
4
|
import { $ as isEnoent, B as USER_AGENT, C as warn, G as getDocsRsCacheDir, N as $env, c as combineSignals, j as formatNumber, k as formatBytes, l as exec, s as Snowflake, y as parseFrontmatter } from "./src-AELUUb5U.mjs";
|
|
5
5
|
import { W as tryParseJson } from "./utils-cZX3f_Ls.mjs";
|
|
6
|
-
import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-
|
|
6
|
+
import { a as fetchBinary, c as getParallelExtractContent, i as convertWithMarkit, l as ensureTool, m as settings, n as asRecord, o as extractWithParallel, r as asString, s as findParallelApiKey, t as asNumber } from "./utils-CW2Qi8Gk.mjs";
|
|
7
7
|
import { n as isRecord } from "./type-guards-CttAANEx.mjs";
|
|
8
8
|
import { r as throwIfAborted, t as ToolAbortError } from "./tool-errors-DoyxivAR.mjs";
|
|
9
9
|
import { c as getLocalizedText, d as looksLikeHtml, i as decodeHtmlEntities, l as htmlToBasicMarkdown, o as formatIsoDate, r as buildResult, s as formatMediaDuration, u as loadPage } from "./types-BLrLohwK.mjs";
|
|
@@ -6267,7 +6267,7 @@ const settings = {
|
|
|
6267
6267
|
};
|
|
6268
6268
|
//#endregion
|
|
6269
6269
|
//#region package.json
|
|
6270
|
-
var version = "0.1.
|
|
6270
|
+
var version = "0.1.15";
|
|
6271
6271
|
/** `.tmp` files older than this are treated as orphaned writes and swept. */
|
|
6272
6272
|
const TMP_ORPHAN_MAX_AGE_MS = 3e5;
|
|
6273
6273
|
function markitConversionCacheKey(bytes, extension) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaoso/dsh-tool-plus",
|
|
3
3
|
"description": "Oh My Pi bash runtime ported as a deepseek-harness tool plugin: persistent shell session, output minimizer, managed background jobs, command interception",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.15",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"deepseek-harness",
|