@exagone313/dsh-podman 1.2.1 → 1.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.
Files changed (94) hide show
  1. package/dist/card-route.d.ts +8 -0
  2. package/dist/card-route.js +19 -8
  3. package/dist/client/ContainerCard.js +147 -110
  4. package/dist/client/card-protocol.d.ts +4 -0
  5. package/dist/client/card-protocol.js +34 -0
  6. package/dist/client/container-card-caches.d.ts +1 -1
  7. package/dist/client/container-card-caches.js +19 -17
  8. package/dist/client/container-card-config.d.ts +47 -0
  9. package/dist/client/container-card-config.js +160 -0
  10. package/dist/client/container-card-controller.d.ts +35 -3
  11. package/dist/client/container-card-controller.js +263 -41
  12. package/dist/client/container-card-create-modal.d.ts +5 -1
  13. package/dist/client/container-card-create-modal.js +111 -94
  14. package/dist/client/container-card-defaults.d.ts +16 -0
  15. package/dist/client/container-card-defaults.js +147 -0
  16. package/dist/client/container-card-dialog-styles.d.ts +7 -0
  17. package/dist/client/container-card-dialog-styles.js +70 -0
  18. package/dist/client/container-card-dialog.d.ts +12 -0
  19. package/dist/client/container-card-dialog.js +47 -0
  20. package/dist/client/container-card-directory-styles.d.ts +1 -1
  21. package/dist/client/container-card-directory-styles.js +5 -5
  22. package/dist/client/container-card-directory.js +8 -7
  23. package/dist/client/container-card-edit-modal.d.ts +39 -0
  24. package/dist/client/container-card-edit-modal.js +29 -0
  25. package/dist/client/container-card-editors.d.ts +5 -2
  26. package/dist/client/container-card-editors.js +109 -134
  27. package/dist/client/container-card-field-styles.d.ts +7 -0
  28. package/dist/client/container-card-field-styles.js +63 -0
  29. package/dist/client/container-card-form.d.ts +47 -0
  30. package/dist/client/container-card-form.js +61 -0
  31. package/dist/client/container-card-group.d.ts +9 -0
  32. package/dist/client/container-card-group.js +22 -0
  33. package/dist/client/container-card-images.d.ts +6 -2
  34. package/dist/client/container-card-images.js +63 -23
  35. package/dist/client/container-card-paths.js +43 -52
  36. package/dist/client/container-card-ports.d.ts +3 -4
  37. package/dist/client/container-card-ports.js +74 -38
  38. package/dist/client/container-card-resources.d.ts +38 -0
  39. package/dist/client/container-card-resources.js +73 -0
  40. package/dist/client/container-card-row.d.ts +11 -19
  41. package/dist/client/container-card-row.js +122 -122
  42. package/dist/client/container-card-secrets.d.ts +31 -3
  43. package/dist/client/container-card-secrets.js +174 -56
  44. package/dist/client/container-card-shared.d.ts +173 -6
  45. package/dist/client/container-card-shared.js +616 -57
  46. package/dist/client/container-card-status.d.ts +18 -0
  47. package/dist/client/container-card-status.js +166 -0
  48. package/dist/client/container-card-styles.d.ts +49 -7
  49. package/dist/client/container-card-styles.js +396 -40
  50. package/dist/client/container-card-table-styles.d.ts +15 -0
  51. package/dist/client/container-card-table-styles.js +237 -0
  52. package/dist/client/container-card-tabs-styles.d.ts +5 -0
  53. package/dist/client/container-card-tabs-styles.js +46 -0
  54. package/dist/client/container-card-toast.d.ts +5 -0
  55. package/dist/client/container-card-toast.js +10 -0
  56. package/dist/client/container-card-volumes.d.ts +1 -0
  57. package/dist/client/container-card-volumes.js +14 -19
  58. package/dist/client/container-card-workspace.d.ts +8 -12
  59. package/dist/client/container-card-workspace.js +76 -14
  60. package/dist/client/index.js +6488 -3474
  61. package/dist/client/locales.d.ts +10 -1
  62. package/dist/client/locales.js +268 -114
  63. package/dist/client/relative-time.d.ts +10 -0
  64. package/dist/client/relative-time.js +74 -0
  65. package/dist/client/slot-contract.d.ts +8 -0
  66. package/dist/client/tool-views.js +1 -1
  67. package/dist/container-env.js +1 -1
  68. package/dist/env-rows.d.ts +9 -11
  69. package/dist/env-rows.js +72 -40
  70. package/dist/generated/version.d.ts +2 -2
  71. package/dist/generated/version.js +2 -2
  72. package/dist/guest-terminal.js +1 -1
  73. package/dist/mount-enums.d.ts +11 -0
  74. package/dist/mount-enums.js +60 -0
  75. package/dist/subprocess.js +1 -1
  76. package/dist/terminal-sessions.js +2 -2
  77. package/dist/terminal-shells.js +1 -1
  78. package/dist/tool-handlers.js +1 -1
  79. package/dist/workspace-binding.js +2 -2
  80. package/docs/architecture.md +4 -4
  81. package/docs/architecture.zh.md +1 -1
  82. package/docs/configuration.md +26 -25
  83. package/docs/configuration.zh.md +13 -11
  84. package/docs/development-prompt.md +7 -7
  85. package/docs/development-prompt.zh.md +7 -7
  86. package/docs/development.md +20 -16
  87. package/docs/development.zh.md +17 -16
  88. package/docs/install-dsh-and-dsh-podman.md +13 -12
  89. package/docs/install-dsh-and-dsh-podman.zh.md +13 -9
  90. package/docs/usage.md +189 -39
  91. package/docs/usage.zh.md +148 -29
  92. package/package.json +5 -1
  93. package/dist/client/container-card-default-env.d.ts +0 -10
  94. package/dist/client/container-card-default-env.js +0 -69
@@ -31,10 +31,10 @@ what is missing or different, keeping whatever is already configured. Use the
31
31
  container tools; never run `make` or edit files on the host.
32
32
 
33
33
  1. Image: build a custom image named `dsh-podman-tooling` from the `archlinux`
34
- base with packages `go`, `nodejs-lts-jod`, `npm`, `deno`, `reuse` and
35
- `python-chardet`, unless an image of that name already exists in this
36
- workspace. It is a local image, not a published one; leave an existing one
37
- alone.
34
+ base with packages `go`, `nodejs`, `npm`, `reuse` and
35
+ `python-chardet`. It is a local image, not a published one; leave an existing
36
+ one alone when it already carries exactly these packages, and rebuild it from
37
+ this list when it does not.
38
38
  2. Volume: create the workspace volume `dsh-podman-toolchain` unless it already
39
39
  exists.
40
40
  3. Container: inspect the default container's image, mounts, PATH additions and
@@ -50,13 +50,13 @@ container tools; never run `make` or edit files on the host.
50
50
  `GOMODCACHE=/opt/toolchain/gomodcache`, `GOPATH=/opt/toolchain/gopath`,
51
51
  `npm_config_cache=/opt/toolchain/npm-cache`,
52
52
  `npm_config_prefix=/opt/toolchain/npm-global`,
53
- `PNPM_HOME=/opt/toolchain/pnpm-home`,
54
- `DENO_DIR=/opt/toolchain/deno-dir` and
53
+ `PNPM_HOME=/opt/toolchain/pnpm-home` and
55
54
  `GOENV=/opt/toolchain/home/.config/go/env`, merged with the variables
56
55
  already on the container.
57
56
  4. pnpm: the volume, not the image, carries pnpm. If `pnpm --version` does not
58
57
  report the version `package.json` pins in `packageManager`, install it with
59
- `npm install -g pnpm@<that version>` and check again.
58
+ `npm install -g pnpm@<that version>` and check again. dprint, the formatter,
59
+ is a project devDependency and arrives with `pnpm install`.
60
60
  5. Git identity: do not write a `~/.gitconfig`. If no Git identity is
61
61
  configured, tell me to set it once on the Podman page (sidebar **Plugins**
62
62
  panel → **Installed** → **dsh-podman**): **Default
@@ -22,8 +22,8 @@ This page is for **contributors** building the plugin from this repository.
22
22
 
23
23
  ## Building
24
24
 
25
- Prerequisites: Go 1.27, Node ≥ 22, pnpm 12, Deno ≥ 2.9 (formatting), and (for
26
- the browser half) the `@deepseek-ai/dsh-client-*` packages published on npm.
25
+ Prerequisites: Go 1.27, Node ≥ 22, pnpm 12, and (for the browser half) the
26
+ `@deepseek-ai/dsh-client-*` packages published on npm.
27
27
 
28
28
  ```sh
29
29
  pnpm install
@@ -39,9 +39,11 @@ The `Makefile` wraps the common workflows:
39
39
  make build-go # build the Go binaries into bin/<os>-<arch>/
40
40
  make build # build-go + pnpm-build
41
41
  make vet # gofmt -s check + go vet with the build tags
42
+ make lint # vet + oxlint over the TypeScript sources
43
+ make lint-ts # oxlint only
42
44
  make test-go # go test with the build tags
43
45
  make test # test-go + pnpm test (JS tests, which run against dist/)
44
- make fmt # gofmt -s + deno fmt (TypeScript and Markdown)
46
+ make fmt # gofmt -s + dprint (TypeScript and Markdown)
45
47
  make fmt-check # verify the formatting without rewriting anything
46
48
  make proto # regenerate the protobuf Go bindings with buf
47
49
  make proto-check # buf lint + buf breaking + check the committed bindings are current
@@ -171,7 +173,7 @@ containers yourself:
171
173
  image**;
172
174
  - with `container_recreate`, for a named container or the default one.
173
175
 
174
- To rebuild a whole workspace instead, use **Remove pod** on its row (or
176
+ To rebuild a whole workspace instead, use **Remove containers** on its row (or
175
177
  `RemoveWorkspace`): the pod and all its containers are removed, and the next
176
178
  attach creates the pod and its default container again. Restarting the two
177
179
  services never touches workspace containers, and neither action removes volumes,
@@ -189,24 +191,26 @@ A workspace container's root filesystem is read-only and disposable, so the
189
191
  toolchain a contributor builds with needs a workspace volume. No development
190
192
  image is distributed: build a custom one — the
191
193
  [setup prompt](development-prompt.md) builds `dsh-podman-tooling` from the
192
- `archlinux` base with `go`, `nodejs-lts-jod`, `npm`, `deno`, `reuse` and
194
+ `archlinux` base with `go`, `nodejs` (Node 26), `npm`, `reuse` and
193
195
  `python-chardet` — and create a workspace volume for the state an image cannot
194
196
  keep: the Go and npm caches, `gopath` with the `go install`ed tools, and pnpm,
195
- which `package.json` pins to a version the Arch repositories do not carry.
197
+ which `package.json` pins to a version the Arch repositories do not carry
198
+ (dprint ships with the project's `pnpm install`).
196
199
 
197
200
  The prompt mounts that volume as `dsh-podman-toolchain` at `/opt/toolchain`
198
201
  (read-write) and points the container's caches at it, so commands work without
199
202
  sourcing anything:
200
203
 
201
- | Container setting | Value |
202
- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
203
- | PATH additions | `/opt/toolchain/gopath/bin`, `/opt/toolchain/npm-global/bin`, `/opt/toolchain/pnpm-home` |
204
- | Environment | `GOCACHE=/opt/toolchain/gocache`, `GOMODCACHE=/opt/toolchain/gomodcache`, `GOPATH=/opt/toolchain/gopath`, `npm_config_cache=/opt/toolchain/npm-cache`, `npm_config_prefix=/opt/toolchain/npm-global`, `PNPM_HOME=/opt/toolchain/pnpm-home`, `DENO_DIR=/opt/toolchain/deno-dir`, `GOENV=/opt/toolchain/home/.config/go/env` |
204
+ | Container setting | Value |
205
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
206
+ | PATH additions | `/opt/toolchain/gopath/bin`, `/opt/toolchain/npm-global/bin`, `/opt/toolchain/pnpm-home` |
207
+ | Environment | `GOCACHE=/opt/toolchain/gocache`, `GOMODCACHE=/opt/toolchain/gomodcache`, `GOPATH=/opt/toolchain/gopath`, `npm_config_cache=/opt/toolchain/npm-cache`, `npm_config_prefix=/opt/toolchain/npm-global`, `PNPM_HOME=/opt/toolchain/pnpm-home`, `GOENV=/opt/toolchain/home/.config/go/env` |
205
208
 
206
209
  Set the commit identity once on the Podman page (sidebar **Plugins** panel →
207
210
  **Installed** → **dsh-podman**) under
208
- [Default environment](configuration.md#default-environment) → **Git identity**,
209
- so containers get `GIT_AUTHOR_*`/`GIT_COMMITTER_*` without a `~/.gitconfig`.
211
+ [Default environment variables](configuration.md#default-environment-variables)
212
+ → **Git identity**, so containers get `GIT_AUTHOR_*`/`GIT_COMMITTER_*` without a
213
+ `~/.gitconfig`.
210
214
 
211
215
  The prompt applies all of this from inside dsh and can be pasted again to repair
212
216
  a workspace. Podman stores managed volumes with `DSH_PODMAN_VOLUME_PREFIX`
@@ -251,16 +255,16 @@ image) exactly, upgrading or downgrading the profile's copy to match.
251
255
 
252
256
  CI runs on every **branch** push and pull request, split across
253
257
  `.github/workflows/ci-common.yml` (REUSE lint and zizmor), `ci-code.yml` (Go,
254
- JS, images, Trivy), `ci-docs.yml` (Deno fmt) and `ci-dsh-image.yml`. A **tag**
258
+ JS, images, Trivy), `ci-docs.yml` (dprint) and `ci-dsh-image.yml`. A **tag**
255
259
  push runs only `release.yml`, which repeats the build, vet and tests itself:
256
260
 
257
261
  - **actions-lint** — zizmor scans the workflows for insecure practices.
258
262
  - **reuse** — REUSE license compliance.
259
263
  - **go** — build, `gofmt -s` check, vet, tests, and govulncheck (Go
260
264
  vulnerabilities). Unfixed findings don't fail the job; fixable ones do.
261
- - **js** — TypeScript formatting check, install, typecheck, build, tests, and
262
- `pnpm audit`.
263
- - **docs** — Markdown formatting check (`deno fmt` via `make fmt-check-md`).
265
+ - **js** — install, TypeScript formatting check, lint, typecheck, build, tests,
266
+ and `pnpm audit`.
267
+ - **docs** — Markdown formatting check (`dprint` via `make fmt-check-md`).
264
268
  - **images** — builds the orchestrator and guest-agent images (runs only after
265
269
  the test jobs pass); **dsh image** builds `Containerfile.dsh`.
266
270
  - **trivy** — filesystem vulnerability scan (unfixed ignored) and container
@@ -21,8 +21,7 @@ SPDX-License-Identifier: MIT
21
21
 
22
22
  ## 构建
23
23
 
24
- 前置要求:Go 1.27、Node ≥ 22、pnpm 12、Deno ≥
25
- 2.9(用于格式化),以及(浏览器端所需的)发布在 npm 上的
24
+ 前置要求:Go 1.27、Node ≥ 22、pnpm 12,以及(浏览器端所需的)发布在 npm 上的
26
25
  `@deepseek-ai/dsh-client-*` 包。
27
26
 
28
27
  ```sh
@@ -39,9 +38,11 @@ Go 构建标签会跳过 btrfs 和 devicemapper 存储驱动,它们需要宿
39
38
  make build-go # build the Go binaries into bin/<os>-<arch>/
40
39
  make build # build-go + pnpm-build
41
40
  make vet # gofmt -s check + go vet with the build tags
41
+ make lint # vet + oxlint over the TypeScript sources
42
+ make lint-ts # oxlint only
42
43
  make test-go # go test with the build tags
43
44
  make test # test-go + pnpm test (JS tests, which run against dist/)
44
- make fmt # gofmt -s + deno fmt (TypeScript and Markdown)
45
+ make fmt # gofmt -s + dprint (TypeScript and Markdown)
45
46
  make fmt-check # verify the formatting without rewriting anything
46
47
  make proto # regenerate the protobuf Go bindings with buf
47
48
  make proto-check # buf lint + buf breaking + check the committed bindings are current
@@ -162,7 +163,7 @@ guest agent 之后,请自行重建容器:
162
163
  image**;
163
164
  - 或使用 `container_recreate`,作用于命名容器或默认容器。
164
165
 
165
- 若要重建整个工作区,可在其行上使用 **Remove pod**(或 `RemoveWorkspace`):pod
166
+ 若要重建整个工作区,可在其行上使用 **移除容器**(或 `RemoveWorkspace`):pod
166
167
  及其所有容器都会被移除,下次接入时会重新创建 pod
167
168
  与默认容器。重启这两个服务绝不会触及工作区容器,上述两种操作也都不会删除卷、机密或项目数据。
168
169
 
@@ -174,20 +175,19 @@ guest agent 之后,请自行重建容器:
174
175
  ### 开发容器工具链
175
176
 
176
177
  工作区容器的根文件系统是只读且一次性的,因此贡献者构建所用的工具链需要工作区的一个卷。项目并不分发开发镜像:请自行构建一个自定义镜像——[设置提示词](development-prompt.zh.md)
177
- 会以 `archlinux` 为父镜像构建 `dsh-podman-tooling`,包含
178
- `go`、`nodejs-lts-jod`、`npm`、`deno`、`reuse` 和
179
- `python-chardet`——并为镜像无法保存的状态创建工作区卷:Go 与 npm 缓存、含
180
- `go install` 工具的 `gopath`, 以及 `package.json` 固定版本、Arch 仓库没有的
181
- pnpm。
178
+ 会以 `archlinux` 为父镜像构建 `dsh-podman-tooling`,包含 `go`、`nodejs`(Node
179
+ 26)、`npm`、`reuse` 和 `python-chardet`——并为镜像无法保存的状态创建工作区卷:Go
180
+ 与 npm 缓存、含 `go install` 工具的 `gopath`, 以及 `package.json`
181
+ 固定版本、Arch 仓库没有的 pnpm(dprint 随项目的 `pnpm install` 一并安装)。
182
182
 
183
183
  提示词会把该卷以 `dsh-podman-toolchain` 挂载到
184
184
  `/opt/toolchain`(读写),并让容器的缓存都指向它,因此无需 source
185
185
  任何脚本即可使用:
186
186
 
187
- | 容器设置 | 值 |
188
- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189
- | PATH 追加项 | `/opt/toolchain/gopath/bin`、`/opt/toolchain/npm-global/bin`、`/opt/toolchain/pnpm-home` |
190
- | 环境变量 | `GOCACHE=/opt/toolchain/gocache`、`GOMODCACHE=/opt/toolchain/gomodcache`、`GOPATH=/opt/toolchain/gopath`、`npm_config_cache=/opt/toolchain/npm-cache`、`npm_config_prefix=/opt/toolchain/npm-global`、`PNPM_HOME=/opt/toolchain/pnpm-home`、`DENO_DIR=/opt/toolchain/deno-dir`、`GOENV=/opt/toolchain/home/.config/go/env` |
187
+ | 容器设置 | 值 |
188
+ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189
+ | PATH 追加项 | `/opt/toolchain/gopath/bin`、`/opt/toolchain/npm-global/bin`、`/opt/toolchain/pnpm-home` |
190
+ | 环境变量 | `GOCACHE=/opt/toolchain/gocache`、`GOMODCACHE=/opt/toolchain/gomodcache`、`GOPATH=/opt/toolchain/gopath`、`npm_config_cache=/opt/toolchain/npm-cache`、`npm_config_prefix=/opt/toolchain/npm-global`、`PNPM_HOME=/opt/toolchain/pnpm-home`、`GOENV=/opt/toolchain/home/.config/go/env` |
191
191
 
192
192
  在 Podman 页面(侧边栏 **插件** 面板 → **已安装** →
193
193
  **dsh-podman**)的[默认环境变量](configuration.zh.md#默认环境变量) → **Git
@@ -234,7 +234,7 @@ Environment=DSH_PODMAN_PLUGIN_SOURCE=/mnt/dsh-podman.tgz
234
234
 
235
235
  CI 在每次**分支**推送和拉取请求时运行,分散在
236
236
  `.github/workflows/ci-common.yml`(REUSE lint 与
237
- zizmor)、`ci-code.yml`(Go、JS、镜像、Trivy)、`ci-docs.yml`(Deno fmt)和
237
+ zizmor)、`ci-code.yml`(Go、JS、镜像、Trivy)、`ci-docs.yml`(dprint)和
238
238
  `ci-dsh-image.yml` 中。推送**标签**时只运行 `release.yml`,它自身会重复构建、vet
239
239
  和测试:
240
240
 
@@ -242,8 +242,9 @@ zizmor)、`ci-code.yml`(Go、JS、镜像、Trivy)、`ci-docs.yml`(Deno f
242
242
  - **reuse** — REUSE 许可证合规检查。
243
243
  - **go** — 构建、`gofmt -s` 检查、vet、测试和 govulncheck(Go 漏洞)。未修复的
244
244
  发现不会导致任务失败;可修复的会导致失败。
245
- - **js** — TypeScript 格式检查、安装、类型检查、构建、测试和 `pnpm audit`。
246
- - **docs** — Markdown 格式检查(通过 `make fmt-check-md` 运行 `deno fmt`)。
245
+ - **js** — 安装、TypeScript 格式检查、lint、类型检查、构建、测试和
246
+ `pnpm audit`。
247
+ - **docs** — Markdown 格式检查(通过 `make fmt-check-md` 运行 `dprint`)。
247
248
  - **images** — 构建 orchestrator 和 guest-agent
248
249
  镜像(仅在测试任务通过后运行);**dsh image** 构建 `Containerfile.dsh`。
249
250
  - **trivy** — 文件系统漏洞扫描(未修复的被忽略)和容器 错误配置扫描(DS-0002
@@ -154,21 +154,22 @@ which requires online access.
154
154
 
155
155
  ## Verification
156
156
 
157
- - Open the sidebar's **Plugins** panel → **Installed** → **dsh-podman**: the
158
- page should list the base images and, for a workspace, offer to create its
159
- default container.
160
- - In a dsh session, run a shell command. It should execute inside a Podman
161
- container for the current workspace (the plugin auto-creates the workspace's
162
- default container on first use).
157
+ 1. Open the sidebar's **Plugins** panel.
158
+ 2. In the **Installed** section, click on **dsh-podman**.
159
+ 3. Open the **Status** tab.
160
+ 4. Check that **dsh-podman**, **dsh-podman-orchestrator** and
161
+ **dsh-podman-gateway** are **ready** and the versions match.
163
162
 
164
163
  ## Set Git identity (recommended)
165
164
 
166
- - Open settings from the sidebar's **Plugins** panel → **Installed** →
167
- **dsh-podman**
168
- - Scroll down to **Default environment**
169
- - Click on **Git identity**
170
- - Enter the name and email to use for Git and click on **Apply**
171
- - Click on **Apply default environment variables** and then **Confirm**
165
+ 1. Open the sidebar's **Plugins** panel.
166
+ 2. In the **Installed** section, click on **dsh-podman**.
167
+ 3. Open the **Defaults** tab.
168
+ 4. Next to **Default environment variables**, click on **Git identity**.
169
+ 5. Enter the name, the email and click on **Apply**.
170
+ 6. Click on **Save**.
171
+ 7. Click on **Add missing variables to containers**.
172
+ 8. Choose **All containers** and click on **Apply**.
172
173
 
173
174
  ## Updating dsh & dsh-podman
174
175
 
@@ -134,18 +134,22 @@ SPDX-License-Identifier: MIT
134
134
 
135
135
  ## 验证
136
136
 
137
- - 打开侧边栏的 **插件** 面板 → **已安装** →
138
- **dsh-podman**:页面应列出基础镜像,并针对工作区提供创建其默认容器的选项。
139
- - 在 dsh 会话中运行一条 shell 命令。它应在当前工作区的 Podman
140
- 容器内执行(插件会在首次使用时自动创建工作区的默认容器)。
137
+ 1. 打开侧边栏的 **插件** 面板。
138
+ 2. 在 **已安装** 部分中,点击 **dsh-podman**。
139
+ 3. 打开 **状态** 标签页。
140
+ 4. 检查 **dsh-podman**、**dsh-podman-orchestrator** 和 **dsh-podman-gateway**
141
+ 是否**就绪**且版本一致。
141
142
 
142
143
  ## 配置 Git 身份(推荐)
143
144
 
144
- - 打开侧边栏的 **插件** 面板 → **已安装** → **dsh-podman**
145
- - 向下滚动到 **默认环境**
146
- - 点击 **Git 身份**
147
- - 输入用于 Git 的名称和邮箱,然后点击 **应用**
148
- - 点击 **应用默认环境变量**,然后点击 **确认**
145
+ 1. 打开侧边栏的 **插件** 面板。
146
+ 2. 在 **已安装** 部分中,点击 **dsh-podman**。
147
+ 3. 打开 **默认设置** 标签页。
148
+ 4. 在 **默认环境变量** 旁边,点击 **Git 身份**。
149
+ 5. 输入姓名和邮箱,然后点击 **应用**。
150
+ 6. 点击 **保存**。
151
+ 7. 点击 **为容器补上缺失的变量**。
152
+ 8. 选择 **所有容器**,然后点击 **应用**。
149
153
 
150
154
  ## 更新 dsh 与 dsh-podman
151
155
 
package/docs/usage.md CHANGED
@@ -147,11 +147,10 @@ guest-agent wiring.
147
147
 
148
148
  New containers are also seeded with the plugin's **default environment** (the
149
149
  `containerEnv` setting), so a git identity can be configured once instead of per
150
- project — see [Default environment](configuration.md#default-environment). The
151
- Podman page's **Git identity** popup fills the four
152
- `GIT_AUTHOR_*`/`GIT_COMMITTER_*` variables from one name and one email, and
153
- **Apply default environment variables** adds them to the running containers that
154
- lack them.
150
+ project — see
151
+ [Default environment variables](configuration.md#default-environment-variables).
152
+ The Podman page's **Git identity** popup fills the four
153
+ `GIT_AUTHOR_*`/`GIT_COMMITTER_*` variables from one name and one email.
155
154
 
156
155
  `container_bash` and `container_exec` run with the same command-visible
157
156
  environment as the built-in `bash`: the harness's managed `DSH_*` facts
@@ -401,46 +400,197 @@ feature keeps working.
401
400
  ## Container management UI
402
401
 
403
402
  The plugin ships a browser half that registers its card on the **dsh-podman**
404
- page (sidebar **Plugins** panel → **Installed**). The page lists the
405
- orchestrator-created guest containers and the built images. A workspace with no
406
- container gets a **Create container** button that opens a configuration modal —
407
- image, environment, mounts (project, tmpfs, volume, and secret), PATH additions,
408
- and secret environment variables — and workspaces that already have containers
409
- offer an **Add container** button for additional, named containers through the
410
- same modal, which is titled after the button that opened it. In that modal each
411
- mount's mode is a dropdown (read-only/read-write), so the workspace project
412
- mount can be created read-only in one step; tmpfs and secret mounts are fixed
413
- (read-write and read-only respectively) and show a disabled dropdown. Container
414
- rows show their environment and secret-environment variables and their mounts,
415
- let you edit environment variables and add/remove mounts (each removal is
416
- confirmed), and attach/detach named secrets to a container's environment
417
- variables; each row also offers **Remove**, **Recreate** (same image), and
418
- **Recreate with image**. A row's **Ports** section lists the pod ports exposed
419
- on the host and publishes another: give the pod port and, optionally, the host
420
- port to prefer (the gateway chooses a free one otherwise, and the notice names
421
- the endpoint it bound), and unpublish with a confirmation; publishing is
422
- disabled with a hint while the gateway is not running or the container is
423
- stopped. Every workspace row also offers **Remove pod**, which removes the
424
- workspace's pod, all of its containers, and the orchestrator's record for it
425
- (volumes, secrets, and project data are kept); removing a workspace's last
426
- container removes its pod as well, so an empty pod is never left behind. The
427
- page re-reads the live state whenever the Plugins panel opens it, and its footer
428
- has a **Reload this view** button. The images section can rebuild a single image
429
- or **rebuild all** in dependency order; **Build image** opens a popup with an
430
- image-id/base-image form and a chip input for the package list (type a name and
431
- press space/comma, or paste a list, to add removable chips). Volumes and secrets
432
- are listed as individual expandable rows, each with its own actions, and
403
+ page (open the sidebar's **Plugins** panel and pick **Installed**). The page is
404
+ a tab set — **Workspaces**, **Images**, **Storage**, **Defaults** and **Status**
405
+ — under a status strip that counts the workspaces holding a container and the
406
+ running containers, followed by ready or not-ready chips for the orchestrator
407
+ and the gateway. The page re-reads the live state whenever the Plugins panel
408
+ opens it, and a **Reload this view** button sits below the tabs, so the reload
409
+ stays reachable from every tab. Card actions are direct control calls and are
410
+ not approval-gated.
411
+
412
+ ### Workspaces
413
+
414
+ The **Workspaces** tab lists the orchestrator-created guest containers. Each
415
+ workspace card states in one phrase how many of its containers run and how many
416
+ are stopped (the stopped half greyed).
417
+
418
+ It also shows the workspace's readable name as the card title with a discreet
419
+ **Copy workspace ID** button beside it for its UUID, and lists each container as
420
+ a stacked block.
421
+
422
+ A workspace with no container gets a **Create container** button; a workspace
423
+ that already has containers gets an **Add container** button for additional,
424
+ named containers. Every workspace row also offers **Remove containers**, which
425
+ removes that workspace's dsh-podman containers and its pod, and the
426
+ orchestrator's record for it (volumes, secrets, and project data are kept, and
427
+ the dsh workspace itself is untouched); removing a workspace's last container
428
+ removes its pod as well, so an empty pod is never left behind.
429
+
430
+ #### Containers
431
+
432
+ The block's identity line carries the container name, its state chip and its
433
+ created time (relative, with the exact instant as a tooltip).
434
+
435
+ Its **Edit**, **Recreate** and **Remove** actions sit at the right end of that
436
+ line, right-aligned while the block has room and below the name once it does
437
+ not: **Recreate** rebuilds the container as it is once the confirmation naming
438
+ it is accepted.
439
+
440
+ The fields follow in the canonical order the dialogs share, each a read-only
441
+ field with its own copy control: environment and secret environment variables as
442
+ Key/Value field pairs, PATH additions as a list of directory fields, and mounts
443
+ and ports as per-entry fields, with every value shown in full and wrapping over
444
+ as many lines as it needs.
445
+
446
+ #### The container dialog
447
+
448
+ **Add container** and **Create container** open the same dialog as **Edit** —
449
+ the same width, the same viewport-capped height, the same group order and the
450
+ same footer layout — which is titled after the action that opened it and opens
451
+ on a **Name** group: editable in **Add container**, and read-only in the default
452
+ container's **Create container** and in **Edit**. **Edit** opens it holding
453
+ everything — the read-only name, image, environment variables, mounts, PATH
454
+ variable additions, secret environment variables and published ports.
455
+
456
+ The groups that follow **Name** are **Image**, **Environment variables**,
457
+ **Mounts**, **PATH variable additions**, **Secret environment variables** and
458
+ **Published ports**. Every row of an editor is the same labelled field row the
459
+ container block renders, with an editable control where the block has a
460
+ read-only field and its copy control.
461
+
462
+ The dialog caps itself to the viewport, keeping its header and its footer in
463
+ place while the body scrolls; **Discard** drops the draft, and the dialog's one
464
+ primary action applies it once the confirmation naming the container is
465
+ accepted: **Recreate container**, in the destructive tone, when the change
466
+ rebuilds the container, and **Update container**, in the neutral one, when the
467
+ running container takes the change.
468
+
469
+ A marker beside it names the staged changes.
470
+
471
+ The apply is refused while a variable name is empty or used twice across the
472
+ environment variables and the secret environment variables: the footer names the
473
+ conflict in red and the offending key carries a red border, and the rows it
474
+ names stay in place until their own **Remove**, while an unnamed row is never
475
+ applied.
476
+
477
+ #### Mounts
478
+
479
+ The mount rows label the kind with a short chip — **Project**, **tmpfs**,
480
+ **Volume** or **Secret**. In the dialog mounts are added and removed, and
481
+ removing one from a live container is confirmed.
482
+
483
+ Adding one selects its kind, and for a project mount the project itself, from
484
+ which the destination path is derived: the project's path mirrored under the
485
+ projects root, previewed in a read-only field, since a project mount never takes
486
+ a destination of its own.
487
+
488
+ When a container is being created or added, each project or volume mount's mode
489
+ is a dropdown (read-only/read-write), so the workspace project mount can be
490
+ created read-only in one step, while secret and tmpfs mounts carry no mode
491
+ control at all.
492
+
493
+ The default container's main project mount keeps its **Remove** greyed out and
494
+ disabled, with that fact as its tooltip, since it cannot be removed.
495
+
496
+ #### Environment variables
497
+
498
+ Environment variables are edited in Key/Value rows, each carrying its own
499
+ visible labels and a **Remove** named after the variable.
500
+
501
+ **Add container** and **Create container** open their **Environment variables**
502
+ group on the workspace's default environment variables, so the values a new
503
+ container inherits are visible; a value left alone keeps the default and an
504
+ edited one becomes that container's own.
505
+
506
+ Secret environment variables are attached by adding a row and picking a named
507
+ secret, with the variable name editable in place like an environment variable's
508
+ key, switched to another secret in place, or removed from that row's own
509
+ **Remove**. A workspace without secrets offers **Create secret** in place of the
510
+ secret picker, opening the secret form on top of the dialog.
511
+
512
+ A variable name is required and must be unique across the environment variables
513
+ and the secret environment variables.
514
+
515
+ #### PATH additions and ports
516
+
517
+ PATH variable additions are edited from an **Edit PATH additions** button, whose
518
+ dialog lists one **Path** field per entry and prepends another with **Add
519
+ entry**; the UI calls them **PATH variable additions**, where the tool section
520
+ below calls them PATH additions.
521
+
522
+ The dialog's **Published ports** group lists the ports exposed on the host, and
523
+ a **Publish port** button opens a popup for the container port, the protocol
524
+ (only tcp is implemented today) and, optionally, the host port to prefer;
525
+ confirming the popup stages the addition — the gateway chooses a free host port
526
+ when none is given, and the notice names the endpoint it bound.
527
+
528
+ A port the gateway has not bound yet keeps the host port it was asked for with
529
+ **(pending)** appended. Publishing is disabled with a hint while the gateway is
530
+ not running or the container is stopped, and a port already exposed to the host
531
+ is unpublished again from its own **Unpublish** action once the confirmation
532
+ naming it is accepted.
533
+
534
+ ### Images
535
+
536
+ The **Images** tab lists the built images, on a **Base images** card and a
537
+ **Custom images** card. It can rebuild a single image or **Rebuild all images**
538
+ in dependency order.
539
+
540
+ Each image row is a block whose first line is the image name, its status and its
541
+ **Rebuild**/**Set default** actions (right-aligned while the block has room,
542
+ below the name once it does not), followed by labelled lines for its build time
543
+ (only when the image was built; relative, with the exact instant as a tooltip),
544
+ its parent image and its packages (chips on their own line).
545
+
546
+ A custom image carries a destructive **Remove** in that same action group rather
547
+ than on a line of its own.
548
+
549
+ **Build custom image**, on the **Custom images** card, opens a popup with an
550
+ image-name form and a parent-image select preselected to the default image, plus
551
+ a chip input for the package list (type a name and press space/comma, or paste a
552
+ list, to add removable chips, which appear below the input).
553
+
554
+ ### Storage
555
+
556
+ Volumes and secrets are listed as individual expandable rows, each with its own
557
+ actions.
558
+
433
559
  **Create volume** / **Create secret** open popup forms (the secret form takes an
434
- optional length; a secret's value can be overwritten, never read). Card actions
435
- are direct control calls and are not approval-gated.
560
+ optional length).
561
+
562
+ A secret row carries **Edit** and then **Remove**: **Edit** opens the same form,
563
+ whose **New value** field can be set or overwritten but never read back, and
564
+ **Remove** drops the secret.
436
565
 
437
566
  A **Package caches** section reports the size of every configured build cache
438
567
  (`DSH_PODMAN_HOST_PACMAN_CACHE`, `DSH_PODMAN_HOST_APT_CACHE`,
439
568
  `DSH_PODMAN_HOST_APK_CACHE`) and offers two cleanup actions: **Keep latest
440
569
  versions** removes every cached package file except the newest of each package
441
- (and the signature it carried), and **Remove all** empties the caches. Both are
442
- safe — a cached package is only ever re-downloaded — and neither runs while an
443
- image build is in progress.
570
+ (and the signature it carried), and **Remove all** empties the caches.
571
+
572
+ Both are safe — a cached package is only ever re-downloaded — and neither runs
573
+ while an image build is in progress.
574
+
575
+ ### Defaults
576
+
577
+ The **Defaults** tab shows the effective default image in a labelled select —
578
+ the configured one, or the first base image, marked as such — and its **Default
579
+ environment variables**.
580
+
581
+ A **Git identity** button opens a popup for a name and an email, filling the
582
+ four `GIT_AUTHOR_*`/`GIT_COMMITTER_*` variables in the draft.
583
+
584
+ An **Add missing variables to containers** action opens a dialog that applies
585
+ the default environment variables to every container or to one workspace's
586
+ containers, listing the variables it would add.
587
+
588
+ ### Status
589
+
590
+ The **Status** tab lists the harness, this plugin and the two daemons in a
591
+ component table with their runtime state, version and commit.
592
+
593
+ A version divergence is named beside the state it qualifies.
444
594
 
445
595
  ## Podman terminal
446
596