dsh-plugin-container 0.3.0 → 0.4.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/README.md CHANGED
@@ -1,81 +1,108 @@
1
- # DSH 容器
1
+ # DSH Container
2
2
 
3
- DSH 左栏容器面板:管理 macOS 上的 Docker(colima / Docker Desktop / OrbStack / remote context)和 Apple `container`。
3
+ English | [简体中文](README.zh-CN.md)
4
4
 
5
- ![概览](docs/docker-overview.png)
5
+ ![Overview](docs/docker-overview.png)
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
- - Docker / Apple container 双 provider,运行时状态、上下文切换
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 / push / build / 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;或安装 [Apple container](https://github.com/apple/container)
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
- 重启 DSH。安装器会自动写入 `dsh.profile.bundles`,**不需要手改 `cordis.patch.yml`**。
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
- 源码路径模式与 npm 包模式不要同时启用。
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
+ - Build: build an image from an absolute context path and optional Dockerfile
56
+ - Push: push an image to its registry
57
+ - Ask AI / Diagnose: starts a separate DSH session that calls the read-only container tools
58
+ 4. The Images tab shows architecture and can start a container directly from an image
41
59
 
42
- ## 使用
60
+ ## Security
43
61
 
44
- 1. 左栏打开 **容器**
45
- 2. 顶部切换 Docker / Apple container
46
- 3. 容器行操作:
47
- - 启动 / 停止 / 重启 / 删除
48
- - 日志 / Follow / Inspect
49
- - Attach:接管容器主进程
50
- - Exec:在容器内开一个新 shell
51
- - 问 AI / 诊断:新建独立 DSH 会话,调用只读容器工具
52
- 4. 镜像 tab 可查看架构,或直接用镜像启动容器
62
+ - All Docker/Apple commands run with the current user's permissions
63
+ - No shell string concatenation; commands are split into argv and spawned directly
64
+ - Dangerous actions such as delete, stop, and prune require confirmation
65
+ - AI tools are read-only; there are no start/stop/rm/prune tools
66
+ - Logs and inspect output are marked as untrusted data and are never executed as instructions
53
67
 
54
- ## 安全
68
+ ## Release
55
69
 
56
- - 所有 Docker/Apple 命令以当前用户权限执行
57
- - 无 shell 拼接;命令拆成 argv 直接 spawn
58
- - 删除、stop、prune 等危险操作需要确认
59
- - AI 工具只读,不提供 start/stop/rm/prune tool
60
- - 日志和 inspect 被标记为不可信数据,不能作为指令执行
70
+ Releases are published by GitHub Actions. The npm token is stored in the repository secrets:
61
71
 
62
- ## 开发
72
+ 1. GitHub repository → Settings → Secrets and variables → Actions
73
+ 2. Create `NPM_TOKEN` with an npm Granular Access Token (Bypass 2FA, Read and write)
74
+ 3. Bump the version and tag:
75
+
76
+ ```bash
77
+ npm version patch
78
+ git push --follow-tags
79
+ ```
80
+
81
+ The `Release` workflow checks that the tag matches the `package.json` version, then runs:
82
+
83
+ ```bash
84
+ npm publish --access public --provenance
85
+ ```
86
+
87
+ ## Development
63
88
 
64
89
  ```bash
65
90
  npm install
66
91
  npm run build # src/client -> lib/client.js
67
- npm test # 46 tests
68
- npm pack # 发布前检查
92
+ npm test # 47 tests
93
+ npm pack # pre-release check
69
94
  ```
70
95
 
71
- 主要结构:
96
+ > `@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.
97
+
98
+ Layout:
72
99
 
73
100
  ```text
74
- index.js Host 入口
75
- cordis.patch.yml bundle 安装 patch
76
- src/host/service.js provider 路由 + Docker
101
+ index.js Host entry
102
+ cordis.patch.yml Bundle install patch
103
+ src/host/service.js Provider routing + Docker
77
104
  src/host/apple.js Apple container
78
105
  src/host/attach.js Attach/Exec PTY
79
- src/host/tools.js 只读 Agent Tools
80
- src/client/ 页面、tabs、i18n、styles
106
+ src/host/tools.js Read-only agent tools
107
+ src/client/ Pages, tabs, i18n, styles
81
108
  ```
@@ -0,0 +1,108 @@
1
+ # DSH 容器
2
+
3
+ [English](README.md) | 简体中文
4
+
5
+ ![概览](docs/docker-overview.png)
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/push/build/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
+ - Build:用绝对路径构建上下文和可选 Dockerfile 构建镜像
56
+ - Push:把镜像推送到 registry
57
+ - 问 AI / 诊断:新建独立 DSH 会话,调用只读容器工具
58
+ 4. 镜像 tab 可查看架构,或直接用镜像启动容器
59
+
60
+ ## 安全
61
+
62
+ - 所有 Docker/Apple 命令以当前用户权限执行
63
+ - 无 shell 拼接;命令拆成 argv 直接 spawn
64
+ - 删除、stop、prune 等危险操作需要确认
65
+ - AI 工具只读,不提供 start/stop/rm/prune tool
66
+ - 日志和 inspect 被标记为不可信数据,不能作为指令执行
67
+
68
+ ## 发布
69
+
70
+ 发布由 GitHub Actions 完成,npm token 放在仓库 Secrets:
71
+
72
+ 1. GitHub 仓库 → Settings → Secrets and variables → Actions
73
+ 2. 新建 `NPM_TOKEN`,值为 npm Granular Access Token(需要 Bypass 2FA、Read and write)
74
+ 3. 更新版本并打 tag:
75
+
76
+ ```bash
77
+ npm version patch
78
+ git push --follow-tags
79
+ ```
80
+
81
+ `Release` workflow 会校验 tag 与 `package.json` 版本一致,然后执行:
82
+
83
+ ```bash
84
+ npm publish --access public --provenance
85
+ ```
86
+
87
+ ## 开发
88
+
89
+ ```bash
90
+ npm install
91
+ npm run build # src/client -> lib/client.js
92
+ npm test # 47 tests
93
+ npm pack # 发布前检查
94
+ ```
95
+
96
+ > `@deepseek-ai/dsh-tools` 由宿主应用提供,**不要**加进 `dependencies` / `peerDependencies`。否则安装插件时会在 profile 的 `node_modules` 里装一份旧版,盖住宿主自带的版本,导致 `tools` 服务缺失、DSH 启动失败。它只放在 `devDependencies`。
97
+
98
+ 主要结构:
99
+
100
+ ```text
101
+ index.js Host 入口
102
+ cordis.patch.yml bundle 安装 patch
103
+ src/host/service.js provider 路由 + Docker
104
+ src/host/apple.js Apple container
105
+ src/host/attach.js Attach/Exec PTY
106
+ src/host/tools.js 只读 Agent Tools
107
+ src/client/ 页面、tabs、i18n、styles
108
+ ```