@stardustlc/dsh-docker 0.2.0 → 0.3.0
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/LICENSE +21 -0
- package/README.en.md +14 -1
- package/README.md +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/tools.js +35 -1
- package/package.json +59 -60
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 stardustlc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
CHANGED
|
@@ -10,6 +10,10 @@ DSH (DeepSeek Harness) container-management plugin: runs the docker CLI through
|
|
|
10
10
|
|
|
11
11
|
[](https://awesome-dsh-plugin.com)
|
|
12
12
|
|
|
13
|
+
## Compatibility
|
|
14
|
+
|
|
15
|
+
Verified against `@deepseek-ai/dsh@0.1.1-rc.2` on 2026-08-26. Built for the cordis patch-bundle plugin model (`cordis.patch.yml` + `dsh.bundle.patch`). No runtime imports of `@deepseek-ai/*` internals.
|
|
16
|
+
|
|
13
17
|
## Installation
|
|
14
18
|
|
|
15
19
|
```bash
|
|
@@ -18,6 +22,15 @@ dsh plugin --profile web add @stardustlc/dsh-docker
|
|
|
18
22
|
|
|
19
23
|
Requires Docker installed locally (`docker version` should work); use `dockerPath` when it is not on PATH.
|
|
20
24
|
|
|
25
|
+
## Uninstall
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
dsh plugin --profile web remove @stardustlc/dsh-docker
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then restart the web service. To clean up fully, also remove the plugin entry from your profile `cordis.patch.yml` if you overrode it.
|
|
32
|
+
|
|
33
|
+
|
|
21
34
|
## Configuration
|
|
22
35
|
|
|
23
36
|
```yaml
|
|
@@ -70,4 +83,4 @@ pnpm test # build + 24 tests
|
|
|
70
83
|
|
|
71
84
|
## License
|
|
72
85
|
|
|
73
|
-
MIT
|
|
86
|
+
MIT
|
package/README.md
CHANGED
|
@@ -10,6 +10,10 @@ DSH(DeepSeek Harness)容器管理插件:走官方 subprocess 服务跑 doc
|
|
|
10
10
|
|
|
11
11
|
[](https://awesome-dsh-plugin.com)
|
|
12
12
|
|
|
13
|
+
## 兼容性
|
|
14
|
+
|
|
15
|
+
在 `@deepseek-ai/dsh@0.1.1-rc.2` 上验证(2026-08-26)。遵循 cordis 组合包补丁模型(`cordis.patch.yml` + `dsh.bundle.patch`),运行时不 import 任何 `@deepseek-ai/*` 内部模块。
|
|
16
|
+
|
|
13
17
|
## 安装
|
|
14
18
|
|
|
15
19
|
```bash
|
|
@@ -18,6 +22,15 @@ dsh plugin --profile web add @stardustlc/dsh-docker
|
|
|
18
22
|
|
|
19
23
|
需要本机装有 Docker(`docker version` 能出结果即可);不在 PATH 上时用 `dockerPath` 指定。
|
|
20
24
|
|
|
25
|
+
## 卸载
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
dsh plugin --profile web remove @stardustlc/dsh-docker
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
卸载后重启 Web 服务。如需彻底清理,可再手动删除自己 profile `cordis.patch.yml` 中覆盖的插件行。
|
|
32
|
+
|
|
33
|
+
|
|
21
34
|
## 配置
|
|
22
35
|
|
|
23
36
|
```yaml
|
|
@@ -70,4 +83,4 @@ pnpm test # 构建 + 24 个测试
|
|
|
70
83
|
|
|
71
84
|
## License
|
|
72
85
|
|
|
73
|
-
MIT
|
|
86
|
+
MIT
|
package/lib/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { type DockerConfig } from './config.js';
|
|
|
11
11
|
import { type SubprocessSpawnLike } from './exec.js';
|
|
12
12
|
import { type DockerToolDefinition } from './tools.js';
|
|
13
13
|
/** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
|
|
14
|
+
export declare const name = "docker";
|
|
14
15
|
export declare const inject: string[];
|
|
15
16
|
/** 审批服务最小面。 */
|
|
16
17
|
export interface DockerApproval {
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { resolveConfig } from './config.js';
|
|
|
11
11
|
import { createSubprocessRunner } from './exec.js';
|
|
12
12
|
import { buildDockerTools } from './tools.js';
|
|
13
13
|
/** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
|
|
14
|
+
export const name = 'docker';
|
|
14
15
|
export const inject = ['subprocess', 'tools'];
|
|
15
16
|
/**
|
|
16
17
|
* 插件入口:解析配置、封装执行器、注册六工具;docker_exec 注入审批门。
|
package/lib/tools.js
CHANGED
|
@@ -239,5 +239,39 @@ export function buildDockerTools(config, runner) {
|
|
|
239
239
|
},
|
|
240
240
|
timeoutMs: timeout,
|
|
241
241
|
};
|
|
242
|
-
|
|
242
|
+
const dockerHealth = {
|
|
243
|
+
name: 'docker_health',
|
|
244
|
+
description: 'dsh-docker 自检:验证 docker CLI 与守护进程是否可用(执行 docker version),并汇总安全配置(exec 审批门、超时)。遇到问题时先运行本工具定位。',
|
|
245
|
+
parameters: compileParameters({}),
|
|
246
|
+
output: {
|
|
247
|
+
schema: { type: 'object', additionalProperties: true },
|
|
248
|
+
render: (_args, value) => {
|
|
249
|
+
const rec = asRecord(value);
|
|
250
|
+
const checks = Array.isArray(rec.checks) ? rec.checks : [];
|
|
251
|
+
const lines = ['dsh-docker 自检' + (rec.ok === true ? ':正常。' : ':发现问题。')];
|
|
252
|
+
for (const item of checks) {
|
|
253
|
+
const c = asRecord(item);
|
|
254
|
+
lines.push('- ' + c.name + ':' + (c.ok === true ? '✅' : '❌ ' + String(c.detail ?? '')));
|
|
255
|
+
}
|
|
256
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
async execute() {
|
|
260
|
+
const checks = [];
|
|
261
|
+
let ok = true;
|
|
262
|
+
try {
|
|
263
|
+
const result = await runChecked(runner, [cfg.dockerPath, 'version', '--format', '{{.Server.Version}}'], 15000, 'docker version');
|
|
264
|
+
checks.push({ name: 'docker daemon', ok: true, detail: 'server ' + result.stdout.trim() });
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
ok = false;
|
|
268
|
+
checks.push({ name: 'docker daemon', ok: false, detail: error instanceof Error ? error.message : String(error) });
|
|
269
|
+
}
|
|
270
|
+
checks.push({ name: 'exec 审批门', ok: true, detail: cfg.execApproval === true ? '开启' : '关闭' });
|
|
271
|
+
checks.push({ name: '超时配置', ok: true, detail: 'timeoutMs=' + cfg.timeoutMs + ', graceMs=' + cfg.graceMs });
|
|
272
|
+
return { ok, plugin: 'dsh-docker', checks };
|
|
273
|
+
},
|
|
274
|
+
timeoutMs: 20000,
|
|
275
|
+
};
|
|
276
|
+
return [dockerPs, dockerLogs, dockerImages, dockerInspect, dockerExec, dockerManage, dockerHealth];
|
|
243
277
|
}
|
package/package.json
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@stardustlc/dsh-docker",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DSH 容器管理插件:docker_ps/logs/images/inspect/exec/manage 六工具,走官方 subprocess 服务跑 docker CLI、argv 无 shell 注入、exec 审批门、零运行时依赖。",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"lib",
|
|
18
|
-
"cordis.patch.yml",
|
|
19
|
-
"README.md",
|
|
20
|
-
"README.en.md"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsc -p tsconfig.json",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@stardustlc/dsh-docker",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "DSH 容器管理插件:docker_ps/logs/images/inspect/exec/manage 六工具,走官方 subprocess 服务跑 docker CLI、argv 无 shell 注入、exec 审批门、零运行时依赖。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"cordis.patch.yml",
|
|
19
|
+
"README.md",
|
|
20
|
+
"README.en.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"test": "pnpm run build && node --test \"test/*.test.mjs\"",
|
|
26
|
+
"prepublishOnly": "pnpm run build"
|
|
27
|
+
},
|
|
28
|
+
"dsh": {
|
|
29
|
+
"bundle": {
|
|
30
|
+
"patch": "./cordis.patch.yml"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"dsh",
|
|
35
|
+
"deepseek-harness",
|
|
36
|
+
"plugin",
|
|
37
|
+
"docker",
|
|
38
|
+
"container",
|
|
39
|
+
"devops"
|
|
40
|
+
],
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=22"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^24.0.0",
|
|
47
|
+
"typescript": "^5.6.0"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/STARDUSTLC666/dsh-docker.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/STARDUSTLC666/dsh-docker/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/STARDUSTLC666/dsh-docker#readme",
|
|
57
|
+
"author": "stardustlc",
|
|
58
|
+
"packageManager": "pnpm@11.7.0"
|
|
59
|
+
}
|