@rooode/dsh-suite 0.1.6 → 0.1.8
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/bin/cli.js +81 -5
- package/package.json +5 -5
package/bin/cli.js
CHANGED
|
@@ -19,16 +19,66 @@ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
|
19
19
|
|
|
20
20
|
const rawArgs = process.argv.slice(2);
|
|
21
21
|
|
|
22
|
+
function getPluginVersion(pluginName) {
|
|
23
|
+
const pluginShortName = pluginName.split('/')[1] || pluginName;
|
|
24
|
+
const candidates = [
|
|
25
|
+
() => {
|
|
26
|
+
const pkgUrl = import.meta.resolve(`${pluginName}/package.json`);
|
|
27
|
+
return JSON.parse(fs.readFileSync(fileURLToPath(pkgUrl), 'utf-8')).version;
|
|
28
|
+
},
|
|
29
|
+
() => {
|
|
30
|
+
const p = path.join(rootDir, 'node_modules', '@rooode', pluginShortName, 'package.json');
|
|
31
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8')).version;
|
|
32
|
+
},
|
|
33
|
+
() => {
|
|
34
|
+
const p = path.resolve(rootDir, '..', pluginShortName, 'package.json');
|
|
35
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8')).version;
|
|
36
|
+
},
|
|
37
|
+
() => {
|
|
38
|
+
const p = path.resolve(rootDir, '..', '@rooode', pluginShortName, 'package.json');
|
|
39
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8')).version;
|
|
40
|
+
},
|
|
41
|
+
() => {
|
|
42
|
+
const userHome = process.env.USERPROFILE || process.env.HOME || '';
|
|
43
|
+
const p = path.join(userHome, '.dsh', 'profiles', 'web', 'node_modules', '@rooode', pluginShortName, 'package.json');
|
|
44
|
+
return JSON.parse(fs.readFileSync(p, 'utf-8')).version;
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
for (const cand of candidates) {
|
|
49
|
+
try {
|
|
50
|
+
const v = cand();
|
|
51
|
+
if (v) return `v${v}`;
|
|
52
|
+
} catch (e) {}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const declared = pkg.dependencies?.[pluginName];
|
|
56
|
+
if (declared) return declared.replace(/^[\^~]/, 'v');
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function formatPluginLine(icon, name, desc, colorCode) {
|
|
61
|
+
const ver = getPluginVersion(name);
|
|
62
|
+
const tag = `[${name}] (${ver})`;
|
|
63
|
+
const paddedTag = tag.padEnd(41, ' ');
|
|
64
|
+
return ` \x1b[${colorCode}${icon} ${paddedTag}\x1b[0m ${desc}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
22
67
|
function printBanner() {
|
|
68
|
+
const lineAuto = formatPluginLine('⚡', '@rooode/dsh-plugin-automation', '24/7 Node 服务端常驻自动化与调度中心', '33m');
|
|
69
|
+
const lineGit = formatPluginLine('🗂️', '@rooode/dsh-plugin-git', 'WebStorm 风格 Git 提交与双栏 Diff 对比', '35m');
|
|
70
|
+
const linePrev = formatPluginLine('📝', '@rooode/dsh-plugin-preview', '多标签代码/文档预览与工作空间文件树', '34m');
|
|
71
|
+
const lineQk = formatPluginLine('📌', '@rooode/dsh-plugin-quickbar', '输入框上方工作空间快捷指令栏', '32m');
|
|
72
|
+
|
|
23
73
|
console.log(`
|
|
24
74
|
\x1b[36m===============================================================================\x1b[0m
|
|
25
75
|
\x1b[1m\x1b[32m🚀 DeepSeek Harness All-in-One Suite\x1b[0m \x1b[90m(v${pkg.version})\x1b[0m
|
|
26
76
|
\x1b[90mPackage: @rooode/dsh-suite | Powered by Cordis & DSH\x1b[0m
|
|
27
77
|
\x1b[36m===============================================================================\x1b[0m
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
78
|
+
${lineAuto}
|
|
79
|
+
${lineGit}
|
|
80
|
+
${linePrev}
|
|
81
|
+
${lineQk}
|
|
32
82
|
\x1b[36m-------------------------------------------------------------------------------\x1b[0m
|
|
33
83
|
`);
|
|
34
84
|
}
|
|
@@ -73,8 +123,34 @@ function findDshEntry() {
|
|
|
73
123
|
return { type: 'npx' };
|
|
74
124
|
}
|
|
75
125
|
|
|
126
|
+
function normalizeArgs(args) {
|
|
127
|
+
const result = [];
|
|
128
|
+
for (let i = 0; i < args.length; i++) {
|
|
129
|
+
const arg = args[i];
|
|
130
|
+
// Filter out --open because DSH opens browser by default and Commander throws on unknown --open flag
|
|
131
|
+
if (arg === '--open') {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
// Intercept --host 0.0.0.0 / -H 0.0.0.0 and safely fall back to 127.0.0.1
|
|
135
|
+
if ((arg === '--host' || arg === '-H') && args[i + 1] === '0.0.0.0') {
|
|
136
|
+
console.warn('\x1b[33m⚠️ 注意: DSH 安全策略限制,已自动将 0.0.0.0 切换为 127.0.0.1 (本地回环)\x1b[0m');
|
|
137
|
+
result.push(arg);
|
|
138
|
+
result.push('127.0.0.1');
|
|
139
|
+
i++;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (typeof arg === 'string' && arg.startsWith('--host=0.0.0.0')) {
|
|
143
|
+
console.warn('\x1b[33m⚠️ 注意: DSH 安全策略限制,已自动将 0.0.0.0 切换为 127.0.0.1 (本地回环)\x1b[0m');
|
|
144
|
+
result.push('--host=127.0.0.1');
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
result.push(arg);
|
|
148
|
+
}
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
|
|
76
152
|
function execDsh(args) {
|
|
77
|
-
const cleanArgs = args[0] === '@deepseek-ai/dsh' ? args.slice(1) : args;
|
|
153
|
+
const cleanArgs = normalizeArgs(args[0] === '@deepseek-ai/dsh' ? args.slice(1) : args);
|
|
78
154
|
const dsh = findDshEntry();
|
|
79
155
|
|
|
80
156
|
if (dsh.type === 'node') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rooode/dsh-suite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "DeepSeek Harness 一键全功能增强套件 (自动化调度 + WebStorm Git 提交对比 + 代码文档多标签预览 + 对话快捷栏)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@deepseek-ai/dsh": "^0.1.1-rc.2",
|
|
45
|
-
"@rooode/dsh-plugin-automation": "^0.2.
|
|
46
|
-
"@rooode/dsh-plugin-git": "^0.1.
|
|
47
|
-
"@rooode/dsh-plugin-preview": "^0.1.
|
|
48
|
-
"@rooode/dsh-plugin-quickbar": "^0.1.
|
|
45
|
+
"@rooode/dsh-plugin-automation": "^0.2.4",
|
|
46
|
+
"@rooode/dsh-plugin-git": "^0.1.3",
|
|
47
|
+
"@rooode/dsh-plugin-preview": "^0.1.11",
|
|
48
|
+
"@rooode/dsh-plugin-quickbar": "^0.1.5"
|
|
49
49
|
},
|
|
50
50
|
"dsh": {
|
|
51
51
|
"bundle": {
|