@xiaoso/dsh-tool-plus 0.1.0-beta.6 → 0.1.1
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 +9 -5
- package/README.md +9 -5
- package/lib/client.js +372 -120
- package/lib/index.mjs +300 -16
- package/lib/{scrapers-BlWQMGjU.mjs → scrapers-DI8yWlu_.mjs} +1 -1
- package/lib/trash-cli.mjs +281 -0
- package/lib/{utils-D1QPFbRk.mjs → utils-D1p8-H8L.mjs} +1 -1
- package/package.json +148 -147
- package/presets/package.json +1 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
//#region src/tools/bash/trash-cli.ts
|
|
3
|
+
const SHORT_OPTIONS = {
|
|
4
|
+
r: "recursive",
|
|
5
|
+
R: "recursive",
|
|
6
|
+
f: "force",
|
|
7
|
+
i: "interactive",
|
|
8
|
+
I: "interactive",
|
|
9
|
+
v: "verbose",
|
|
10
|
+
d: "dir"
|
|
11
|
+
};
|
|
12
|
+
const LONG_OPTIONS = {
|
|
13
|
+
"--recursive": {
|
|
14
|
+
field: "recursive",
|
|
15
|
+
value: true
|
|
16
|
+
},
|
|
17
|
+
"--force": {
|
|
18
|
+
field: "force",
|
|
19
|
+
value: true
|
|
20
|
+
},
|
|
21
|
+
"--interactive": {
|
|
22
|
+
field: "interactive",
|
|
23
|
+
value: true
|
|
24
|
+
},
|
|
25
|
+
"--verbose": {
|
|
26
|
+
field: "verbose",
|
|
27
|
+
value: true
|
|
28
|
+
},
|
|
29
|
+
"--dir": {
|
|
30
|
+
field: "dir",
|
|
31
|
+
value: true
|
|
32
|
+
},
|
|
33
|
+
"--preserve-root": {
|
|
34
|
+
field: "preserveRoot",
|
|
35
|
+
value: true
|
|
36
|
+
},
|
|
37
|
+
"--no-preserve-root": {
|
|
38
|
+
field: "preserveRoot",
|
|
39
|
+
value: false
|
|
40
|
+
},
|
|
41
|
+
"--one-file-system": {
|
|
42
|
+
field: "oneFileSystem",
|
|
43
|
+
value: true
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/** --interactive=WHEN 的合法取值(GNU rm 语义)。 */
|
|
47
|
+
const INTERACTIVE_WHEN = /* @__PURE__ */ new Set([
|
|
48
|
+
"once",
|
|
49
|
+
"always",
|
|
50
|
+
"never"
|
|
51
|
+
]);
|
|
52
|
+
/**
|
|
53
|
+
* 解析 rm 风格参数(coreutils rm 语义):
|
|
54
|
+
* - 短选项支持组合(`-rf`),`-r`/`-R`/`--recursive` 等价,`-i`/`-I` 等价;
|
|
55
|
+
* - `--` 结束符后全部视为路径(允许 `-` 开头的文件名);
|
|
56
|
+
* - `--interactive[=once|always|never]` 接受(回收站模式忽略交互);
|
|
57
|
+
* - 未知短选项 → invalid-option,未知长选项 → unrecognized-option;
|
|
58
|
+
* - 无路径 → missing-operand。
|
|
59
|
+
*/
|
|
60
|
+
function parseRmArgs(argv) {
|
|
61
|
+
const parsed = {
|
|
62
|
+
recursive: false,
|
|
63
|
+
force: false,
|
|
64
|
+
interactive: false,
|
|
65
|
+
verbose: false,
|
|
66
|
+
dir: false,
|
|
67
|
+
preserveRoot: true,
|
|
68
|
+
oneFileSystem: false,
|
|
69
|
+
paths: []
|
|
70
|
+
};
|
|
71
|
+
let afterDoubleDash = false;
|
|
72
|
+
for (const arg of argv) {
|
|
73
|
+
if (afterDoubleDash) {
|
|
74
|
+
parsed.paths.push(arg);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (arg === "--") {
|
|
78
|
+
afterDoubleDash = true;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (arg.startsWith("--")) {
|
|
82
|
+
const eq = arg.indexOf("=");
|
|
83
|
+
const name = eq >= 0 ? arg.slice(0, eq) : arg;
|
|
84
|
+
const value = eq >= 0 ? arg.slice(eq + 1) : void 0;
|
|
85
|
+
if (name === "---presume-input-tty") continue;
|
|
86
|
+
const flag = LONG_OPTIONS[name];
|
|
87
|
+
if (flag === void 0) {
|
|
88
|
+
parsed.error = {
|
|
89
|
+
kind: "unrecognized-option",
|
|
90
|
+
option: name
|
|
91
|
+
};
|
|
92
|
+
return parsed;
|
|
93
|
+
}
|
|
94
|
+
if (value !== void 0) {
|
|
95
|
+
if (name === "--interactive") {
|
|
96
|
+
if (!INTERACTIVE_WHEN.has(value)) {
|
|
97
|
+
parsed.error = {
|
|
98
|
+
kind: "invalid-argument",
|
|
99
|
+
option: name,
|
|
100
|
+
value
|
|
101
|
+
};
|
|
102
|
+
return parsed;
|
|
103
|
+
}
|
|
104
|
+
parsed.interactive = true;
|
|
105
|
+
} else if (name === "--preserve-root") {
|
|
106
|
+
if (value === "all") parsed.preserveRoot = true;
|
|
107
|
+
else {
|
|
108
|
+
parsed.error = {
|
|
109
|
+
kind: "invalid-argument",
|
|
110
|
+
option: name,
|
|
111
|
+
value
|
|
112
|
+
};
|
|
113
|
+
return parsed;
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
parsed.error = {
|
|
117
|
+
kind: "option-argument",
|
|
118
|
+
option: name
|
|
119
|
+
};
|
|
120
|
+
return parsed;
|
|
121
|
+
}
|
|
122
|
+
} else parsed[flag.field] = flag.value;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (arg.startsWith("-") && arg.length > 1) {
|
|
126
|
+
for (const ch of arg.slice(1)) {
|
|
127
|
+
const flag = SHORT_OPTIONS[ch];
|
|
128
|
+
if (flag === void 0) {
|
|
129
|
+
parsed.error = {
|
|
130
|
+
kind: "invalid-option",
|
|
131
|
+
option: ch
|
|
132
|
+
};
|
|
133
|
+
return parsed;
|
|
134
|
+
}
|
|
135
|
+
parsed[flag] = true;
|
|
136
|
+
}
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
parsed.paths.push(arg);
|
|
140
|
+
}
|
|
141
|
+
if (parsed.paths.length === 0 && parsed.error === void 0) parsed.error = { kind: "missing-operand" };
|
|
142
|
+
return parsed;
|
|
143
|
+
}
|
|
144
|
+
/** 规范化 verbose 输出的目录尾部斜杠(`a///` → `a/`,对齐 rm)。 */
|
|
145
|
+
function normalizeTrailingSlash(p) {
|
|
146
|
+
return p.replace(/[\\/]+$/, "/");
|
|
147
|
+
}
|
|
148
|
+
function errorMessage(err) {
|
|
149
|
+
return err instanceof Error ? err.message : String(err);
|
|
150
|
+
}
|
|
151
|
+
/** 路径规范化后以 `.` 或 `..` 结尾(r-4 移植:拒绝删除)。 */
|
|
152
|
+
function isDotOrDotDot(p) {
|
|
153
|
+
const last = p.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
|
|
154
|
+
return last === "." || last === "..";
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 路径是 `/` 或其同义词(`//`、`///`、符号链接/junction 指向根目录)。
|
|
158
|
+
* 根判定用 dev/ino 比较(GNU preserve-root 的精确语义):字符串比较在
|
|
159
|
+
* Windows 上会漏判(junction 指向 C:\ 时 realpath 是 "C:\\" 而非 "/"),
|
|
160
|
+
* 而 dev/ino 在 Windows 与 POSIX 上都正确。空串不是根。
|
|
161
|
+
*
|
|
162
|
+
* Windows 语义说明:Node 的 `/` 解析为当前盘根(随 cwd 变化),而 Git
|
|
163
|
+
* bash 的 `/` 是 MSYS 根——两者都只保护"字面 `/` 及其 dev/ino 等价物",
|
|
164
|
+
* 与 GNU rm 在 Git bash 的行为一致(GNU 同样不保护指向盘根的链接)。
|
|
165
|
+
*/
|
|
166
|
+
async function isRootPath(p, deps) {
|
|
167
|
+
if (p.length > 0 && p.replace(/[\\/]+$/, "") === "") return true;
|
|
168
|
+
const st = await deps.stat(p);
|
|
169
|
+
if (st === null) return false;
|
|
170
|
+
const root = await deps.stat("/");
|
|
171
|
+
return root !== null && st.dev === root.dev && st.ino === root.ino;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 执行一次 rm 语义的回收站删除。
|
|
175
|
+
*
|
|
176
|
+
* 行为对齐 coreutils rm:
|
|
177
|
+
* - 无 -r/-d 时目录报 `Is a directory` 并保留(rm4);
|
|
178
|
+
* - 不存在路径:-f 静默忽略(f-1),否则报 `No such file or directory`;
|
|
179
|
+
* - `.`/`..` 结尾路径拒绝(r-4);`/` 及同义词拒绝(r-root,preserve-root 默认开);
|
|
180
|
+
* - 符号链接按链接本身处理(lstat,dangling-symlink 移植);
|
|
181
|
+
* - trash 失败:-f 静默但退出 1,否则报 `cannot remove`;
|
|
182
|
+
* - -v 输出 `removed 'x'` / `removed directory 'x'`(r-1/d-1/v-slash);
|
|
183
|
+
* - 退出码:全部成功 0,任一失败 1。
|
|
184
|
+
*/
|
|
185
|
+
async function runTrashCli(argv, deps) {
|
|
186
|
+
const parsed = parseRmArgs(argv);
|
|
187
|
+
if (parsed.error !== void 0) {
|
|
188
|
+
if (parsed.error.kind === "missing-operand") deps.stderr("rm: missing operand");
|
|
189
|
+
else if (parsed.error.kind === "invalid-option") deps.stderr(`rm: invalid option -- '${parsed.error.option}'`);
|
|
190
|
+
else if (parsed.error.kind === "unrecognized-option") deps.stderr(`rm: unrecognized option '${parsed.error.option}'`);
|
|
191
|
+
else if (parsed.error.kind === "invalid-argument") deps.stderr(`rm: invalid argument '${parsed.error.value}' for '${parsed.error.option}'`);
|
|
192
|
+
else deps.stderr(`rm: option '${parsed.error.option}' doesn't allow an argument`);
|
|
193
|
+
deps.exit(1);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const { recursive, force, verbose, dir, preserveRoot, paths } = parsed;
|
|
197
|
+
const items = [];
|
|
198
|
+
let failed = false;
|
|
199
|
+
for (const p of paths) {
|
|
200
|
+
if (isDotOrDotDot(p)) {
|
|
201
|
+
deps.stderr(`rm: refusing to remove '.' or '..' directory: skipping '${p}'`);
|
|
202
|
+
failed = true;
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (preserveRoot && await isRootPath(p, deps)) {
|
|
206
|
+
deps.stderr("rm: it is dangerous to operate recursively on '/'");
|
|
207
|
+
deps.stderr("rm: use --no-preserve-root to override this failsafe");
|
|
208
|
+
failed = true;
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
const st = await deps.lstat(p);
|
|
212
|
+
if (st === null) {
|
|
213
|
+
if (!force) {
|
|
214
|
+
deps.stderr(`rm: cannot remove '${p}': No such file or directory`);
|
|
215
|
+
failed = true;
|
|
216
|
+
}
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
if (st.isDirectory && !recursive && !dir) {
|
|
220
|
+
deps.stderr(`rm: cannot remove '${p}': Is a directory`);
|
|
221
|
+
failed = true;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
items.push({
|
|
225
|
+
path: p,
|
|
226
|
+
isDir: st.isDirectory
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (items.length > 0) try {
|
|
230
|
+
await deps.trash(items.map((item) => item.path));
|
|
231
|
+
} catch (err) {
|
|
232
|
+
deps.stderr(`rm: cannot remove '${items[0].path}': ${errorMessage(err)}`);
|
|
233
|
+
failed = true;
|
|
234
|
+
}
|
|
235
|
+
if (verbose && !failed) for (const { path: p, isDir } of items) deps.stdout(isDir ? `removed directory '${normalizeTrailingSlash(p)}'` : `removed '${p}'`);
|
|
236
|
+
deps.exit(failed ? 1 : 0);
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/tools/bash/trash-cli-main.ts
|
|
240
|
+
/**
|
|
241
|
+
* rmSafe CLI 入口(构建产物 lib/trash-cli.mjs,被注入的 bash `rm()` 函数调用)。
|
|
242
|
+
*
|
|
243
|
+
* trash 包在此动态加载:单测只 import trash-cli.ts(纯逻辑),
|
|
244
|
+
* 不会触发 trash 依赖解析。
|
|
245
|
+
* @module @xiaoso/dsh-tool-plus/bash/trash-cli-main
|
|
246
|
+
*/
|
|
247
|
+
async function main() {
|
|
248
|
+
const { default: trash } = await import("trash");
|
|
249
|
+
await runTrashCli(process.argv.slice(2), {
|
|
250
|
+
trash,
|
|
251
|
+
lstat: async (p) => {
|
|
252
|
+
try {
|
|
253
|
+
return { isDirectory: (await fs.promises.lstat(p)).isDirectory() };
|
|
254
|
+
} catch {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
stat: async (p) => {
|
|
259
|
+
try {
|
|
260
|
+
const st = await fs.promises.stat(p);
|
|
261
|
+
return {
|
|
262
|
+
dev: st.dev,
|
|
263
|
+
ino: st.ino
|
|
264
|
+
};
|
|
265
|
+
} catch {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
stdout: (s) => process.stdout.write(`${s}\n`),
|
|
270
|
+
stderr: (s) => process.stderr.write(`${s}\n`),
|
|
271
|
+
exit: (c) => {
|
|
272
|
+
process.exitCode = c;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
main().catch((err) => {
|
|
277
|
+
process.stderr.write(`${err instanceof Error ? err.message : String(err)}\n`);
|
|
278
|
+
process.exitCode = 1;
|
|
279
|
+
});
|
|
280
|
+
//#endregion
|
|
281
|
+
export {};
|
|
@@ -7202,7 +7202,7 @@ const settings = {
|
|
|
7202
7202
|
};
|
|
7203
7203
|
//#endregion
|
|
7204
7204
|
//#region package.json
|
|
7205
|
-
var version = "0.1.
|
|
7205
|
+
var version = "0.1.1";
|
|
7206
7206
|
/** `.tmp` files older than this are treated as orphaned writes and swept. */
|
|
7207
7207
|
const TMP_ORPHAN_MAX_AGE_MS = 3e5;
|
|
7208
7208
|
function markitConversionCacheKey(bytes, extension) {
|
package/package.json
CHANGED
|
@@ -1,147 +1,148 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xiaoso/dsh-tool-plus",
|
|
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.
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"deepseek-harness",
|
|
8
|
-
"dsh",
|
|
9
|
-
"dsh-plugin",
|
|
10
|
-
"cli",
|
|
11
|
-
"coding-agent",
|
|
12
|
-
"agent-tools",
|
|
13
|
-
"bash",
|
|
14
|
-
"persistent-shell",
|
|
15
|
-
"file-tools",
|
|
16
|
-
"code-search",
|
|
17
|
-
"code-editing",
|
|
18
|
-
"ast-grep",
|
|
19
|
-
"tool-enhancement",
|
|
20
|
-
"oh-my-pi"
|
|
21
|
-
],
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/xiaoso456/dsh-tool-plus.git"
|
|
25
|
-
},
|
|
26
|
-
"homepage": "https://github.com/xiaoso456/dsh-tool-plus#readme",
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/xiaoso456/dsh-tool-plus/issues"
|
|
29
|
-
},
|
|
30
|
-
"type": "module",
|
|
31
|
-
"publishConfig": {
|
|
32
|
-
"access": "public",
|
|
33
|
-
"tag": "beta"
|
|
34
|
-
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": "^22.19.0 || >=24.0.0"
|
|
37
|
-
},
|
|
38
|
-
"main": "lib/index.mjs",
|
|
39
|
-
"types": "lib/types/index.d.ts",
|
|
40
|
-
"exports": {
|
|
41
|
-
".": {
|
|
42
|
-
"types": "./lib/types/index.d.ts",
|
|
43
|
-
"default": "./lib/index.mjs"
|
|
44
|
-
},
|
|
45
|
-
"./client": {
|
|
46
|
-
"types": "./lib/types/client/index.d.ts",
|
|
47
|
-
"default": "./lib/client.js"
|
|
48
|
-
},
|
|
49
|
-
"./package.json": "./package.json"
|
|
50
|
-
},
|
|
51
|
-
"files": [
|
|
52
|
-
"lib",
|
|
53
|
-
"presets",
|
|
54
|
-
"scripts/patch-pi-natives.mjs",
|
|
55
|
-
"src/bash-runtime/shell-snapshot-fn-env.sh",
|
|
56
|
-
"cordis.patch.yml",
|
|
57
|
-
"README.md",
|
|
58
|
-
"LICENSE",
|
|
59
|
-
"THIRD_PARTY_NOTICES.md"
|
|
60
|
-
],
|
|
61
|
-
"dsh": {
|
|
62
|
-
"bundle": {
|
|
63
|
-
"patch": "./cordis.patch.yml"
|
|
64
|
-
},
|
|
65
|
-
"client": {
|
|
66
|
-
"inject": [
|
|
67
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
68
|
-
"@deepseek-ai/dsh-client-locale",
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-settings"
|
|
70
|
-
],
|
|
71
|
-
"platform": "web"
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"scripts": {
|
|
75
|
-
"build": "tsc -p tsconfig.json && tsdown -c tsdown.config.ts && node scripts/copy-assets.mjs",
|
|
76
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
77
|
-
"test": "vitest run --config vitest.config.ts",
|
|
78
|
-
"presets:install": "node presets/install-presets.mjs",
|
|
79
|
-
"presets:install:force": "node presets/install-presets.mjs --force",
|
|
80
|
-
"postinstall": "node scripts/patch-pi-natives.mjs"
|
|
81
|
-
},
|
|
82
|
-
"peerDependencies": {
|
|
83
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
84
|
-
"@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
|
|
85
|
-
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.2",
|
|
86
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
87
|
-
"@deepseek-ai/dsh-fs": "^0.1.1-rc.2",
|
|
88
|
-
"@deepseek-ai/dsh-jobs": "^0.1.1-rc.2",
|
|
89
|
-
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
90
|
-
"@deepseek-ai/dsh-sandbox": "^0.1.1-rc.2",
|
|
91
|
-
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
92
|
-
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
|
|
93
|
-
"@deepseek-ai/dsh-shell": "^0.1.1-rc.2",
|
|
94
|
-
"@deepseek-ai/dsh-shell-env": "^0.1.1-rc.2",
|
|
95
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
96
|
-
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2"
|
|
97
|
-
},
|
|
98
|
-
"optionalPeerDependencies": {
|
|
99
|
-
"sharp": ">=0.33"
|
|
100
|
-
},
|
|
101
|
-
"dependencies": {
|
|
102
|
-
"@deepseek-ai/schemastery": "^3.18.1",
|
|
103
|
-
"@oh-my-pi/omptype": "17.3.5",
|
|
104
|
-
"@oh-my-pi/pi-agent-core": "17.3.5",
|
|
105
|
-
"@oh-my-pi/pi-ai": "17.3.5",
|
|
106
|
-
"@oh-my-pi/pi-catalog": "17.3.5",
|
|
107
|
-
"@oh-my-pi/pi-natives": "17.3.5",
|
|
108
|
-
"@oh-my-pi/pi-tui": "17.3.5",
|
|
109
|
-
"@oh-my-pi/pi-utils": "17.3.5",
|
|
110
|
-
"json5": "^2.2.3",
|
|
111
|
-
"puppeteer-core": "^25.3.0",
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"@deepseek-ai/
|
|
117
|
-
"@deepseek-ai/dsh-
|
|
118
|
-
"@deepseek-ai/dsh-client-
|
|
119
|
-
"@deepseek-ai/dsh-client-
|
|
120
|
-
"@deepseek-ai/dsh-client-
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-
|
|
122
|
-
"@deepseek-ai/dsh-client-ui-settings
|
|
123
|
-
"@deepseek-ai/dsh-client-ui-
|
|
124
|
-
"@deepseek-ai/dsh-
|
|
125
|
-
"@deepseek-ai/dsh-
|
|
126
|
-
"@deepseek-ai/dsh-jobs
|
|
127
|
-
"@deepseek-ai/dsh-
|
|
128
|
-
"@deepseek-ai/dsh-
|
|
129
|
-
"@deepseek-ai/dsh-
|
|
130
|
-
"@deepseek-ai/dsh-
|
|
131
|
-
"@deepseek-ai/dsh-shell
|
|
132
|
-
"@deepseek-ai/dsh-
|
|
133
|
-
"@deepseek-ai/dsh-
|
|
134
|
-
"@deepseek-ai/dsh-tool-
|
|
135
|
-
"@deepseek-ai/dsh-
|
|
136
|
-
"@
|
|
137
|
-
"@types/
|
|
138
|
-
"@types/react
|
|
139
|
-
"react": "^19.0.0",
|
|
140
|
-
"react
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xiaoso/dsh-tool-plus",
|
|
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.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"deepseek-harness",
|
|
8
|
+
"dsh",
|
|
9
|
+
"dsh-plugin",
|
|
10
|
+
"cli",
|
|
11
|
+
"coding-agent",
|
|
12
|
+
"agent-tools",
|
|
13
|
+
"bash",
|
|
14
|
+
"persistent-shell",
|
|
15
|
+
"file-tools",
|
|
16
|
+
"code-search",
|
|
17
|
+
"code-editing",
|
|
18
|
+
"ast-grep",
|
|
19
|
+
"tool-enhancement",
|
|
20
|
+
"oh-my-pi"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/xiaoso456/dsh-tool-plus.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/xiaoso456/dsh-tool-plus#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/xiaoso456/dsh-tool-plus/issues"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"tag": "beta"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
37
|
+
},
|
|
38
|
+
"main": "lib/index.mjs",
|
|
39
|
+
"types": "lib/types/index.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./lib/types/index.d.ts",
|
|
43
|
+
"default": "./lib/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"./client": {
|
|
46
|
+
"types": "./lib/types/client/index.d.ts",
|
|
47
|
+
"default": "./lib/client.js"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"lib",
|
|
53
|
+
"presets",
|
|
54
|
+
"scripts/patch-pi-natives.mjs",
|
|
55
|
+
"src/bash-runtime/shell-snapshot-fn-env.sh",
|
|
56
|
+
"cordis.patch.yml",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE",
|
|
59
|
+
"THIRD_PARTY_NOTICES.md"
|
|
60
|
+
],
|
|
61
|
+
"dsh": {
|
|
62
|
+
"bundle": {
|
|
63
|
+
"patch": "./cordis.patch.yml"
|
|
64
|
+
},
|
|
65
|
+
"client": {
|
|
66
|
+
"inject": [
|
|
67
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
68
|
+
"@deepseek-ai/dsh-client-locale",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
70
|
+
],
|
|
71
|
+
"platform": "web"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build": "tsc -p tsconfig.json && tsdown -c tsdown.config.ts && node scripts/copy-assets.mjs",
|
|
76
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
77
|
+
"test": "vitest run --config vitest.config.ts",
|
|
78
|
+
"presets:install": "node presets/install-presets.mjs",
|
|
79
|
+
"presets:install:force": "node presets/install-presets.mjs --force",
|
|
80
|
+
"postinstall": "node scripts/patch-pi-natives.mjs"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
84
|
+
"@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-fs": "^0.1.1-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-jobs": "^0.1.1-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
90
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.1-rc.2",
|
|
91
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
92
|
+
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
|
|
93
|
+
"@deepseek-ai/dsh-shell": "^0.1.1-rc.2",
|
|
94
|
+
"@deepseek-ai/dsh-shell-env": "^0.1.1-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
96
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2"
|
|
97
|
+
},
|
|
98
|
+
"optionalPeerDependencies": {
|
|
99
|
+
"sharp": ">=0.33"
|
|
100
|
+
},
|
|
101
|
+
"dependencies": {
|
|
102
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
103
|
+
"@oh-my-pi/omptype": "17.3.5",
|
|
104
|
+
"@oh-my-pi/pi-agent-core": "17.3.5",
|
|
105
|
+
"@oh-my-pi/pi-ai": "17.3.5",
|
|
106
|
+
"@oh-my-pi/pi-catalog": "17.3.5",
|
|
107
|
+
"@oh-my-pi/pi-natives": "17.3.5",
|
|
108
|
+
"@oh-my-pi/pi-tui": "17.3.5",
|
|
109
|
+
"@oh-my-pi/pi-utils": "17.3.5",
|
|
110
|
+
"json5": "^2.2.3",
|
|
111
|
+
"puppeteer-core": "^25.3.0",
|
|
112
|
+
"trash": "^10.1.1",
|
|
113
|
+
"yaml": "^2.9.0"
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
117
|
+
"@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.1-rc.2",
|
|
119
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2",
|
|
120
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.1-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
|
|
122
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.1-rc.2",
|
|
123
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
|
|
124
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.1-rc.2",
|
|
125
|
+
"@deepseek-ai/dsh-fs-local": "0.1.1-rc.2",
|
|
126
|
+
"@deepseek-ai/dsh-jobs": "^0.1.1-rc.2",
|
|
127
|
+
"@deepseek-ai/dsh-jobs-local": "^0.1.1-rc.2",
|
|
128
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
129
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
130
|
+
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2",
|
|
131
|
+
"@deepseek-ai/dsh-shell": "^0.1.1-rc.2",
|
|
132
|
+
"@deepseek-ai/dsh-shell-env": "^0.1.1-rc.2",
|
|
133
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
134
|
+
"@deepseek-ai/dsh-tool-jobs": "^0.1.1-rc.2",
|
|
135
|
+
"@deepseek-ai/dsh-tool-str-replace-editor": "0.1.1-rc.2",
|
|
136
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
137
|
+
"@types/node": "^22.19.0",
|
|
138
|
+
"@types/react": "^19.0.0",
|
|
139
|
+
"@types/react-dom": "^19.0.0",
|
|
140
|
+
"react": "^19.0.0",
|
|
141
|
+
"react-dom": "^19.0.0",
|
|
142
|
+
"sharp": "^0.35.4",
|
|
143
|
+
"tsdown": "^0.22.2",
|
|
144
|
+
"tsx": "^4.22.4",
|
|
145
|
+
"typescript": "^6.0.3",
|
|
146
|
+
"vitest": "^4.1.8"
|
|
147
|
+
}
|
|
148
|
+
}
|
package/presets/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaoso/dsh-tool-plus-presets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Agent-preset installer for dsh-tool-plus: installs the standard / PTC enhanced preset templates into a DeepSeek Harness home.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|