dsh-plugin-container 0.3.0 → 0.3.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.md +69 -44
- package/README.zh-CN.md +106 -0
- package/package.json +13 -5
package/README.md
CHANGED
|
@@ -1,81 +1,106 @@
|
|
|
1
|
-
# DSH
|
|
1
|
+
# DSH Container
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A DSH sidebar panel for managing containers on macOS: Docker (colima / Docker Desktop / OrbStack / remote contexts) and Apple `container`.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- 容器、镜像、卷、网络、Compose、命令
|
|
11
|
-
- 容器启动/停止/重启/删除,镜像 pull/inspect/delete
|
|
12
|
-
- 查看日志、inspect、实时 follow
|
|
13
|
-
- **Attach**:Docker `docker attach`;Apple `container exec`
|
|
14
|
-
- **Exec**:进入容器内部 shell(`docker exec -it <id> /bin/sh`)
|
|
15
|
-
- 镜像架构列(arm64/amd64)
|
|
16
|
-
- 只读 AI 工具:`container_status`、`container_list`、`container_inspect`、`container_logs`
|
|
17
|
-
- AI 诊断会新建独立会话,不污染当前对话
|
|
9
|
+
## Features
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
- Two providers, Docker and Apple container, with runtime status and context switching
|
|
12
|
+
- Containers, images, volumes, networks, Compose, and commands
|
|
13
|
+
- Start / stop / restart / delete containers; pull / inspect / delete images
|
|
14
|
+
- Logs, inspect, and live follow
|
|
15
|
+
- **Attach**: `docker attach` for Docker; `container exec` for Apple
|
|
16
|
+
- **Exec**: open a shell inside a container (`docker exec -it <id> /bin/sh`)
|
|
17
|
+
- Image architecture column (arm64/amd64)
|
|
18
|
+
- Read-only AI tools: `container_status`, `container_list`, `container_inspect`, `container_logs`
|
|
19
|
+
- AI diagnosis opens a separate session and leaves the current conversation untouched
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
20
22
|
|
|
21
23
|
- macOS
|
|
22
24
|
- DSH 0.2.x
|
|
23
|
-
- Docker CLI
|
|
24
|
-
-
|
|
25
|
+
- Docker CLI, or [Apple container](https://github.com/apple/container)
|
|
26
|
+
- Configure any network proxy for your own environment
|
|
27
|
+
|
|
28
|
+
## Install
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
GitHub: https://github.com/Zaynervewreck/dsh-plugin-container
|
|
27
31
|
|
|
28
32
|
```bash
|
|
29
33
|
dsh plugin --profile desktop add dsh-plugin-container
|
|
30
34
|
```
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
Restart DSH. The installer writes `dsh.profile.bundles` for you, so **you do not need to edit `cordis.patch.yml` by hand**.
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
Local development build:
|
|
35
39
|
|
|
36
40
|
```bash
|
|
37
41
|
node scripts/install-profile.mjs --home "$HOME/.dsh" --profile desktop
|
|
38
42
|
```
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
Do not enable source-path mode and npm-package mode at the same time.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
1. Open **Containers** in the left sidebar
|
|
49
|
+
2. Switch between Docker and Apple container at the top
|
|
50
|
+
3. Container row actions:
|
|
51
|
+
- Start / stop / restart / delete
|
|
52
|
+
- Logs / Follow / Inspect
|
|
53
|
+
- Attach: take over the container's main process
|
|
54
|
+
- Exec: open a new shell inside the container
|
|
55
|
+
- Ask AI / Diagnose: starts a separate DSH session that calls the read-only container tools
|
|
56
|
+
4. The Images tab shows architecture and can start a container directly from an image
|
|
41
57
|
|
|
42
|
-
##
|
|
58
|
+
## Security
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- Attach:接管容器主进程
|
|
50
|
-
- Exec:在容器内开一个新 shell
|
|
51
|
-
- 问 AI / 诊断:新建独立 DSH 会话,调用只读容器工具
|
|
52
|
-
4. 镜像 tab 可查看架构,或直接用镜像启动容器
|
|
60
|
+
- All Docker/Apple commands run with the current user's permissions
|
|
61
|
+
- No shell string concatenation; commands are split into argv and spawned directly
|
|
62
|
+
- Dangerous actions such as delete, stop, and prune require confirmation
|
|
63
|
+
- AI tools are read-only; there are no start/stop/rm/prune tools
|
|
64
|
+
- Logs and inspect output are marked as untrusted data and are never executed as instructions
|
|
53
65
|
|
|
54
|
-
##
|
|
66
|
+
## Release
|
|
55
67
|
|
|
56
|
-
|
|
57
|
-
- 无 shell 拼接;命令拆成 argv 直接 spawn
|
|
58
|
-
- 删除、stop、prune 等危险操作需要确认
|
|
59
|
-
- AI 工具只读,不提供 start/stop/rm/prune tool
|
|
60
|
-
- 日志和 inspect 被标记为不可信数据,不能作为指令执行
|
|
68
|
+
Releases are published by GitHub Actions. The npm token is stored in the repository secrets:
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
1. GitHub repository → Settings → Secrets and variables → Actions
|
|
71
|
+
2. Create `NPM_TOKEN` with an npm Granular Access Token (Bypass 2FA, Read and write)
|
|
72
|
+
3. Bump the version and tag:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm version patch
|
|
76
|
+
git push --follow-tags
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The `Release` workflow checks that the tag matches the `package.json` version, then runs:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm publish --access public --provenance
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Development
|
|
63
86
|
|
|
64
87
|
```bash
|
|
65
88
|
npm install
|
|
66
89
|
npm run build # src/client -> lib/client.js
|
|
67
90
|
npm test # 46 tests
|
|
68
|
-
npm pack #
|
|
91
|
+
npm pack # pre-release check
|
|
69
92
|
```
|
|
70
93
|
|
|
71
|
-
|
|
94
|
+
> `@deepseek-ai/dsh-tools` is provided by the host app. **Do not** add it to `dependencies` or `peerDependencies`. Otherwise installing the plugin puts an older copy in the profile's `node_modules`, which shadows the host's own version, leaves the `tools` service missing, and DSH fails to start. Keep it in `devDependencies` only.
|
|
95
|
+
|
|
96
|
+
Layout:
|
|
72
97
|
|
|
73
98
|
```text
|
|
74
|
-
index.js Host
|
|
75
|
-
cordis.patch.yml
|
|
76
|
-
src/host/service.js
|
|
99
|
+
index.js Host entry
|
|
100
|
+
cordis.patch.yml Bundle install patch
|
|
101
|
+
src/host/service.js Provider routing + Docker
|
|
77
102
|
src/host/apple.js Apple container
|
|
78
103
|
src/host/attach.js Attach/Exec PTY
|
|
79
|
-
src/host/tools.js
|
|
80
|
-
src/client/
|
|
104
|
+
src/host/tools.js Read-only agent tools
|
|
105
|
+
src/client/ Pages, tabs, i18n, styles
|
|
81
106
|
```
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# DSH 容器
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
DSH 左栏容器面板:管理 macOS 上的 Docker(colima / Docker Desktop / OrbStack / remote context)和 Apple `container`。
|
|
8
|
+
|
|
9
|
+
## 功能
|
|
10
|
+
|
|
11
|
+
- Docker / Apple container 双 provider,运行时状态、上下文切换
|
|
12
|
+
- 容器、镜像、卷、网络、Compose、命令
|
|
13
|
+
- 容器启动/停止/重启/删除,镜像 pull/inspect/delete
|
|
14
|
+
- 查看日志、inspect、实时 follow
|
|
15
|
+
- **Attach**:Docker `docker attach`;Apple `container exec`
|
|
16
|
+
- **Exec**:进入容器内部 shell(`docker exec -it <id> /bin/sh`)
|
|
17
|
+
- 镜像架构列(arm64/amd64)
|
|
18
|
+
- 只读 AI 工具:`container_status`、`container_list`、`container_inspect`、`container_logs`
|
|
19
|
+
- AI 诊断会新建独立会话,不污染当前对话
|
|
20
|
+
|
|
21
|
+
## 要求
|
|
22
|
+
|
|
23
|
+
- macOS
|
|
24
|
+
- DSH 0.2.x
|
|
25
|
+
- Docker CLI;或安装 [Apple container](https://github.com/apple/container)
|
|
26
|
+
- 网络代理按本机环境配置
|
|
27
|
+
|
|
28
|
+
## 安装
|
|
29
|
+
|
|
30
|
+
GitHub: https://github.com/Zaynervewreck/dsh-plugin-container
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
dsh plugin --profile desktop add dsh-plugin-container
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
重启 DSH。安装器会自动写入 `dsh.profile.bundles`,**不需要手改 `cordis.patch.yml`**。
|
|
37
|
+
|
|
38
|
+
本地开发版:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
node scripts/install-profile.mjs --home "$HOME/.dsh" --profile desktop
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
源码路径模式与 npm 包模式不要同时启用。
|
|
45
|
+
|
|
46
|
+
## 使用
|
|
47
|
+
|
|
48
|
+
1. 左栏打开 **容器**
|
|
49
|
+
2. 顶部切换 Docker / Apple container
|
|
50
|
+
3. 容器行操作:
|
|
51
|
+
- 启动 / 停止 / 重启 / 删除
|
|
52
|
+
- 日志 / Follow / Inspect
|
|
53
|
+
- Attach:接管容器主进程
|
|
54
|
+
- Exec:在容器内开一个新 shell
|
|
55
|
+
- 问 AI / 诊断:新建独立 DSH 会话,调用只读容器工具
|
|
56
|
+
4. 镜像 tab 可查看架构,或直接用镜像启动容器
|
|
57
|
+
|
|
58
|
+
## 安全
|
|
59
|
+
|
|
60
|
+
- 所有 Docker/Apple 命令以当前用户权限执行
|
|
61
|
+
- 无 shell 拼接;命令拆成 argv 直接 spawn
|
|
62
|
+
- 删除、stop、prune 等危险操作需要确认
|
|
63
|
+
- AI 工具只读,不提供 start/stop/rm/prune tool
|
|
64
|
+
- 日志和 inspect 被标记为不可信数据,不能作为指令执行
|
|
65
|
+
|
|
66
|
+
## 发布
|
|
67
|
+
|
|
68
|
+
发布由 GitHub Actions 完成,npm token 放在仓库 Secrets:
|
|
69
|
+
|
|
70
|
+
1. GitHub 仓库 → Settings → Secrets and variables → Actions
|
|
71
|
+
2. 新建 `NPM_TOKEN`,值为 npm Granular Access Token(需要 Bypass 2FA、Read and write)
|
|
72
|
+
3. 更新版本并打 tag:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm version patch
|
|
76
|
+
git push --follow-tags
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`Release` workflow 会校验 tag 与 `package.json` 版本一致,然后执行:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm publish --access public --provenance
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 开发
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install
|
|
89
|
+
npm run build # src/client -> lib/client.js
|
|
90
|
+
npm test # 46 tests
|
|
91
|
+
npm pack # 发布前检查
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
> `@deepseek-ai/dsh-tools` 由宿主应用提供,**不要**加进 `dependencies` / `peerDependencies`。否则安装插件时会在 profile 的 `node_modules` 里装一份旧版,盖住宿主自带的版本,导致 `tools` 服务缺失、DSH 启动失败。它只放在 `devDependencies`。
|
|
95
|
+
|
|
96
|
+
主要结构:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
index.js Host 入口
|
|
100
|
+
cordis.patch.yml bundle 安装 patch
|
|
101
|
+
src/host/service.js provider 路由 + Docker
|
|
102
|
+
src/host/apple.js Apple container
|
|
103
|
+
src/host/attach.js Attach/Exec PTY
|
|
104
|
+
src/host/tools.js 只读 Agent Tools
|
|
105
|
+
src/client/ 页面、tabs、i18n、styles
|
|
106
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-container",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "DSH sidebar container panel for macOS Docker runtimes and Apple container",
|
|
6
6
|
"type": "module",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"src/**/*.jsx",
|
|
18
18
|
"cordis.patch.yml",
|
|
19
19
|
"README.md",
|
|
20
|
+
"README.zh-CN.md",
|
|
20
21
|
"docs/*.png"
|
|
21
22
|
],
|
|
22
23
|
"dsh": {
|
|
@@ -40,9 +41,7 @@
|
|
|
40
41
|
"prepack": "npm run build && npm test"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"esbuild": "0.25.0"
|
|
44
|
-
},
|
|
45
|
-
"dependencies": {
|
|
44
|
+
"esbuild": "0.25.0",
|
|
46
45
|
"@deepseek-ai/dsh-tools": "^0.2.1-rc.5"
|
|
47
46
|
},
|
|
48
47
|
"license": "MIT",
|
|
@@ -60,5 +59,14 @@
|
|
|
60
59
|
},
|
|
61
60
|
"publishConfig": {
|
|
62
61
|
"access": "public"
|
|
63
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "git+https://github.com/Zaynervewreck/dsh-plugin-container.git"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/Zaynervewreck/dsh-plugin-container#readme",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/Zaynervewreck/dsh-plugin-container/issues"
|
|
70
|
+
},
|
|
71
|
+
"author": "Zaynervewreck"
|
|
64
72
|
}
|