@exagone313/dsh-podman 1.2.0 → 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 (98) 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 +6 -4
  81. package/docs/architecture.zh.md +3 -1
  82. package/docs/configuration.md +28 -25
  83. package/docs/configuration.zh.md +15 -11
  84. package/docs/development-prompt.md +9 -7
  85. package/docs/development-prompt.zh.md +9 -7
  86. package/docs/development.md +25 -18
  87. package/docs/development.zh.md +22 -18
  88. package/docs/install-dsh-and-dsh-podman.md +15 -12
  89. package/docs/install-dsh-and-dsh-podman.zh.md +15 -9
  90. package/docs/uninstall.md +2 -0
  91. package/docs/uninstall.zh.md +2 -0
  92. package/docs/update.md +2 -0
  93. package/docs/update.zh.md +2 -0
  94. package/docs/usage.md +191 -39
  95. package/docs/usage.zh.md +150 -29
  96. package/package.json +8 -4
  97. package/dist/client/container-card-default-env.d.ts +0 -10
  98. package/dist/client/container-card-default-env.js +0 -69
package/docs/usage.md CHANGED
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # Usage
8
8
 
9
+ English | [中文](usage.zh.md)
10
+
9
11
  This page documents the model-facing tools, the Podman page, and the image
10
12
  model. See [Architecture](architecture.md) for how the pieces fit together.
11
13
 
@@ -145,11 +147,10 @@ guest-agent wiring.
145
147
 
146
148
  New containers are also seeded with the plugin's **default environment** (the
147
149
  `containerEnv` setting), so a git identity can be configured once instead of per
148
- project — see [Default environment](configuration.md#default-environment). The
149
- Podman page's **Git identity** popup fills the four
150
- `GIT_AUTHOR_*`/`GIT_COMMITTER_*` variables from one name and one email, and
151
- **Apply default environment variables** adds them to the running containers that
152
- 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.
153
154
 
154
155
  `container_bash` and `container_exec` run with the same command-visible
155
156
  environment as the built-in `bash`: the harness's managed `DSH_*` facts
@@ -399,46 +400,197 @@ feature keeps working.
399
400
  ## Container management UI
400
401
 
401
402
  The plugin ships a browser half that registers its card on the **dsh-podman**
402
- page (sidebar **Plugins** panel → **Installed**). The page lists the
403
- orchestrator-created guest containers and the built images. A workspace with no
404
- container gets a **Create container** button that opens a configuration modal —
405
- image, environment, mounts (project, tmpfs, volume, and secret), PATH additions,
406
- and secret environment variables — and workspaces that already have containers
407
- offer an **Add container** button for additional, named containers through the
408
- same modal, which is titled after the button that opened it. In that modal each
409
- mount's mode is a dropdown (read-only/read-write), so the workspace project
410
- mount can be created read-only in one step; tmpfs and secret mounts are fixed
411
- (read-write and read-only respectively) and show a disabled dropdown. Container
412
- rows show their environment and secret-environment variables and their mounts,
413
- let you edit environment variables and add/remove mounts (each removal is
414
- confirmed), and attach/detach named secrets to a container's environment
415
- variables; each row also offers **Remove**, **Recreate** (same image), and
416
- **Recreate with image**. A row's **Ports** section lists the pod ports exposed
417
- on the host and publishes another: give the pod port and, optionally, the host
418
- port to prefer (the gateway chooses a free one otherwise, and the notice names
419
- the endpoint it bound), and unpublish with a confirmation; publishing is
420
- disabled with a hint while the gateway is not running or the container is
421
- stopped. Every workspace row also offers **Remove pod**, which removes the
422
- workspace's pod, all of its containers, and the orchestrator's record for it
423
- (volumes, secrets, and project data are kept); removing a workspace's last
424
- container removes its pod as well, so an empty pod is never left behind. The
425
- page re-reads the live state whenever the Plugins panel opens it, and its footer
426
- has a **Reload this view** button. The images section can rebuild a single image
427
- or **rebuild all** in dependency order; **Build image** opens a popup with an
428
- image-id/base-image form and a chip input for the package list (type a name and
429
- press space/comma, or paste a list, to add removable chips). Volumes and secrets
430
- 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
+
431
559
  **Create volume** / **Create secret** open popup forms (the secret form takes an
432
- optional length; a secret's value can be overwritten, never read). Card actions
433
- 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.
434
565
 
435
566
  A **Package caches** section reports the size of every configured build cache
436
567
  (`DSH_PODMAN_HOST_PACMAN_CACHE`, `DSH_PODMAN_HOST_APT_CACHE`,
437
568
  `DSH_PODMAN_HOST_APK_CACHE`) and offers two cleanup actions: **Keep latest
438
569
  versions** removes every cached package file except the newest of each package
439
- (and the signature it carried), and **Remove all** empties the caches. Both are
440
- safe — a cached package is only ever re-downloaded — and neither runs while an
441
- 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.
442
594
 
443
595
  ## Podman terminal
444
596
 
package/docs/usage.zh.md CHANGED
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # 使用
8
8
 
9
+ [English](usage.md) | 中文
10
+
9
11
  本页面记录了面向模型的工具、Podman
10
12
  页面以及镜像模型。参见[架构](architecture.zh.md)了解各部分如何组合在一起。
11
13
 
@@ -120,8 +122,7 @@ bash 进程)的 `env` 映射;`container_exec` 和 `daemon_start` 已经接
120
122
  新容器还会注入插件的**默认环境变量**(`containerEnv` 设置),因此 Git
121
123
  身份只需配置一次,而不必按项目重复设置——见[默认环境变量](configuration.zh.md#默认环境变量)。Podman
122
124
  页面中的 **Git 身份**弹窗用一份姓名与邮箱填入四个
123
- `GIT_AUTHOR_*`/`GIT_COMMITTER_*`
124
- 变量,**应用默认环境变量**会把它们补给尚未具备的现有运行中容器。
125
+ `GIT_AUTHOR_*`/`GIT_COMMITTER_*` 变量。
125
126
 
126
127
  `container_bash` 和 `container_exec` 使用与内置 `bash`
127
128
  相同的命令可见环境运行:harness 托管的 `DSH_*`
@@ -336,33 +337,153 @@ orchestrator 持有租约的部分,gateway 不会自行保留任何主机端
336
337
 
337
338
  ## 容器管理 UI
338
339
 
339
- 插件附带一个浏览器端,把卡片注册到 **dsh-podman** 页面(侧边栏 **插件** 面板 →
340
- **已安装**)。该页面列出编排器创建的 guest
341
- 容器和已构建的镜像。没有容器的工作区会得到一个 **Create container**
342
- 按钮,打开一个配置模态框——镜像、环境、挂载(project、tmpfs、volume 和
343
- secret)、PATH 附加项以及机密环境变量——而已有容器的工作区通过同一个模态框提供
344
- **Add container**
345
- 按钮,用于添加额外的命名容器,模态框标题与打开它的按钮一致。在该模态框中,每个挂载的模式是一个下拉框(read-only/read-write),因此可以在创建时就把工作区项目挂载设为只读;tmpfs
346
- 和 secret 挂载的模式是固定的(分别为 read-write 和
347
- read-only),显示为不可编辑的下拉框。容器行显示其环境和机密环境变量及其挂载,允许编辑环境变量和添加/移除挂载(每次移除都会确认),以及将命名机密附加/分离到容器的环境变量;每行还提供
348
- **Remove**、**Recreate**(相同镜像)和 **Recreate with image**。每行的
349
- **端口**区段会列出已暴露到主机的 pod 端口,并可再发布一个:填写 pod
350
- 端口,以及可选的首选主机端口(未填写时由 gateway
351
- 选择一个空闲端口,通知中会给出实际绑定的地址),取消发布需要确认;当 gateway
352
- 未运行或容器未运行时,发布会显示提示并保持禁用。每个工作区行还提供 **移除
353
- Pod**,它会移除该工作区的
354
- Pod、其所有容器以及编排器对应的记录(卷、机密和项目数据会保留);移除工作区的最后一个容器也会一并移除其
355
- Pod,因此不会留下空的 Pod。每次通过 **插件**
356
- 面板打开该页面时都会重新读取实时状态,其底部还有一个 **Reload this view**
357
- 按钮。镜像部分可以重建单个镜像或按依赖顺序**重建全部**;**Build image**
358
- 打开一个弹窗,包含 image-id/base-image 表单和用于软件包列表的 chip
359
- 输入框(输入名称并按空格/逗号,或粘贴列表,以添加可移除的
360
- chips)。卷和机密以独立的可展开行列出,每行都有自己的操作,**Create volume** /
361
- **Create secret**
362
- 打开弹窗表单(机密表单接受可选的长度;机密的值可以被覆盖,但绝不读取)。Podman
363
- 页面操作是直接的控制调用,不受审批门控。
364
-
365
- **软件包缓存**区段会报告每个已配置构建缓存(`DSH_PODMAN_HOST_PACMAN_CACHE`、`DSH_PODMAN_HOST_APT_CACHE`、`DSH_PODMAN_HOST_APK_CACHE`)的大小,并提供两个清理操作:**保留最新版本**会移除每个软件包除最新版本之外的所有缓存文件(连同其签名),**全部移除**会清空缓存。两者都是安全的——缓存的软件包只会被重新下载——且都不会在镜像构建进行时运行。
340
+ 插件附带一个浏览器端,把卡片注册到 **dsh-podman** 页面(打开侧边栏的 **插件**
341
+ 面板并选择
342
+ **已安装**)。该页面是一组标签页——**工作区**、**镜像**、**存储**、**默认设置**
343
+ 和 **状态**——顶部是状态条,统计持有容器的工作区数与运行中的容器数,随后是
344
+ orchestrator 与 gateway 的就绪/未就绪标签。每次通过 **插件**
345
+ 面板打开该页面时都会重新读取实时状态,标签页下方还有一个 **刷新此视图**
346
+ 按钮,因此从任何标签页都能刷新。Podman 页面操作是直接的控制调用,不受审批门控。
347
+
348
+ ### 工作区
349
+
350
+ **工作区**标签页列出编排器创建的 guest
351
+ 容器。每个工作区卡片用一句话说明其容器有多少在运行、多少已停止(已停止部分以灰色呈现)。
352
+
353
+ 卡片以工作区的可读名称作为标题,并在其旁提供一个低调的 **复制工作区 ID**
354
+ 按钮用于复制其 UUID,并把每个容器呈现为一个堆叠区块。
355
+
356
+ 没有容器的工作区会得到一个 **创建容器** 按钮;已有容器的工作区则得到
357
+ **添加容器** 按钮,用于添加额外的命名容器。每个工作区行还提供
358
+ **移除容器**,它会移除该工作区的 dsh-podman 容器及其
359
+ Pod,以及编排器对应的记录(卷、机密和项目数据会保留,dsh
360
+ 工作区本身不受影响);移除工作区的最后一个容器也会一并移除其
361
+ Pod,因此不会留下空的 Pod。
362
+
363
+ #### 容器
364
+
365
+ 区块的身份行包含容器名称、状态标签与创建时间(相对时间,精确时刻作为提示)。
366
+
367
+ 其 **编辑**、**重建** 与 **移除**
368
+ 操作位于该行右端——有空间时右对齐,空间不足时移到名称下方:**重建**
369
+ 会在确认(确认框会指明容器)后按原样重建容器。
370
+
371
+ 字段按各对话框共用的规范顺序排列,每个都是自带复制控件的只读字段:环境变量与机密环境变量为键/值字段对,PATH
372
+ 附加项为目录字段列表,挂载与端口为逐条字段,所有值都完整显示并可换行。
373
+
374
+ #### 容器对话框
375
+
376
+ **添加容器** 与 **创建容器** 打开与 **编辑**
377
+ 相同的对话框——宽度相同、高度同样限制在视口内、分组顺序相同、底部布局也相同——其标题与打开它的操作一致,并以
378
+ **名称** 分组开头:在 **添加容器** 中可编辑,在工作区默认容器的 **创建容器** 与
379
+ **编辑** 中为只读。**编辑**
380
+ 会打开一个对话框集中呈现这些内容——只读名称、镜像、环境变量、挂载、PATH
381
+ 变量附加项、机密环境变量与已发布端口。
382
+
383
+ **名称** 之后的分组依次为 **镜像**、**环境变量**、**挂载**、**PATH
384
+ 变量附加项**、**机密环境变量** 和
385
+ **已发布端口**。编辑器中的每一行都是容器区块所用的同一种带标签字段行,只是把区块中的只读字段及其复制控件换成可编辑控件。
386
+
387
+ 对话框会将自身限制在视口内,标题与底部栏固定,正文滚动;**放弃**
388
+ 放弃草稿,对话框底部唯一的主操作在确认(确认框会指明容器)后应用草稿——当更改会重建容器时,它是破坏性色调的
389
+ **重建容器**;当运行中的容器可以直接接受更改时,它是中性色调的 **更新容器**。
390
+
391
+ 其旁有一个标记说明将应用的更改。
392
+
393
+ 当变量名为空,或在环境变量与机密环境变量中重复使用时,应用会被拒绝:底部栏以红色说明冲突,冲突的键带有红色边框,冲突所指的行会留在原处,直到用该行自己的
394
+ **移除** 删除,而未命名的行不会被应用。
395
+
396
+ #### 挂载
397
+
398
+ 挂载行以简短的标签标明类型——**项目**、**tmpfs**、**卷** 或
399
+ **机密**。在对话框中可以添加和移除挂载,从运行中的容器移除会要求确认。
400
+
401
+ 添加时需要选择其类型;对于项目挂载,还要选择项目本身,目标路径由此推导:项目路径在
402
+ projects
403
+ 根目录下的镜像路径,并显示在只读字段中,因为项目挂载本身不接受目标路径。
404
+
405
+ 创建或添加容器时,项目与卷挂载的模式是一个下拉框(只读/读写),因此可以在创建时就把工作区项目挂载设为只读;机密与
406
+ tmpfs 挂载不带模式控件。
407
+
408
+ 默认容器的主项目挂载的 **移除**
409
+ 按钮保持灰色且禁用,并以提示说明原因,因为它无法移除。
410
+
411
+ #### 环境变量
412
+
413
+ 环境变量在键/值行中编辑,每个键/值行都有自己的可见标签,以及一个以变量名命名的
414
+ **移除**。
415
+
416
+ **添加容器** 与 **创建容器** 的 **环境变量**
417
+ 分组会以工作区的默认环境变量开头,使新容器将继承的值可见;不改动的值保留默认值,改动过的值成为该容器自身的环境变量。
418
+
419
+ 机密环境变量通过新增一行并从命名机密中选择来附加——变量名可像环境变量的键一样就地编辑——就地改换其机密,或用该行自己的
420
+ **移除** 按钮移除。工作区没有机密时,机密选择器会替换为
421
+ **创建机密**,在对话框之上打开机密表单。
422
+
423
+ 变量名必填,且在环境变量与机密环境变量中必须唯一。
424
+
425
+ #### PATH 附加项与端口
426
+
427
+ PATH 变量附加项通过 **编辑 PATH 附加项** 按钮编辑,其对话框为每个条目列出
428
+ **路径** 字段,并通过 **添加条目** 在最前面新增一个;UI 中称之为 **PATH
429
+ 变量附加项**,而下方工具章节称之为 PATH 附加项。
430
+
431
+ 对话框的 **已发布端口** 分组列出已暴露到主机的端口,**发布端口**
432
+ 按钮会打开一个弹窗:填写容器端口、协议(目前只实现
433
+ tcp),以及可选的首选主机端口;在弹窗中确认后暂存该添加——未填写主机端口时由
434
+ gateway 选择一个空闲端口,通知中会给出实际绑定的地址。
435
+
436
+ gateway 尚未绑定的端口会保留所请求的主机端口并在其后加上 **(待发布)**。当
437
+ gateway
438
+ 未运行或容器未运行时,发布会显示提示并保持禁用;已暴露到主机的端口可通过其自身的
439
+ **取消发布** 操作取消,确认(确认框会指明该端口)后生效。
440
+
441
+ ### 镜像
442
+
443
+ **镜像**标签页以 **基础镜像** 卡片和 **自定义镜像**
444
+ 卡片列出已构建的镜像。它可以重建单个镜像或按依赖顺序 **重建全部镜像**。
445
+
446
+ 每个镜像行是一个区块,首行是镜像名称、状态及其 **重建**/**设为默认**
447
+ 操作(有空间时右对齐,空间不足时移到名称下方),随后是带标签的构建时间(仅在镜像已构建时显示;相对时间,精确时刻作为提示)、父镜像与软件包(chips
448
+ 单独成行)。
449
+
450
+ 自定义镜像的破坏性 **移除** 位于同一操作组中,而不是区块下方的独立一行。
451
+
452
+ **构建自定义镜像**(位于 **自定义镜像**
453
+ 卡片上)打开一个弹窗,包含镜像名称表单、预选为默认镜像的父镜像选择器,以及用于软件包列表的
454
+ chip 输入框(输入名称并按空格/逗号,或粘贴列表,以添加可移除的 chips;chips
455
+ 显示在输入框下方)。
456
+
457
+ ### 存储
458
+
459
+ 卷和机密以独立的可展开行列出,每行都有自己的操作。
460
+
461
+ **创建卷** / **创建机密** 打开弹窗表单(机密表单接受可选的长度)。
462
+
463
+ 机密行依次带有**编辑**和**移除**:**编辑**打开同一表单,其**新值**字段可以设置或覆盖,但绝不读取;**移除**则移除该机密。
464
+
465
+ **软件包缓存**区段会报告每个已配置构建缓存(`DSH_PODMAN_HOST_PACMAN_CACHE`、`DSH_PODMAN_HOST_APT_CACHE`、`DSH_PODMAN_HOST_APK_CACHE`)的大小,并提供两个清理操作:**保留最新版本**
466
+ 会移除每个软件包除最新版本之外的所有缓存文件(连同其签名),**全部移除**
467
+ 会清空缓存。
468
+
469
+ 两者都是安全的——缓存的软件包只会被重新下载——且都不会在镜像构建进行时运行。
470
+
471
+ ### 默认设置
472
+
473
+ **默认设置**标签页会在带标签的选择器中显示实际生效的默认镜像(已配置的镜像,或首个基础镜像,并标注为“基础镜像”)及
474
+ **默认环境变量**。
475
+
476
+ **Git 身份** 按钮打开一个弹窗,填写姓名与邮箱,把四个
477
+ `GIT_AUTHOR_*`/`GIT_COMMITTER_*` 变量填入草稿。
478
+
479
+ **为容器补上缺失的变量**
480
+ 操作会打开一个对话框,把默认环境变量应用到所有容器或某个工作区的容器,并列出将添加的变量。
481
+
482
+ ### 状态
483
+
484
+ **状态**标签页以组件表格列出 dsh、本插件与两个守护进程的运行时状态、版本与提交。
485
+
486
+ 版本差异会标注在它所限定的状态旁。
366
487
 
367
488
  ## Podman 终端
368
489
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagone313/dsh-podman",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Podman-backed execution for DeepSeek Harness (dsh).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -50,11 +50,13 @@
50
50
  "scripts": {
51
51
  "build": "node scripts/generate-version.mjs && tsc -p tsconfig.json && tsc -p tsconfig.client.json && node scripts/copy-proto.mjs && node scripts/build-client-bundle.mjs",
52
52
  "typecheck": "node scripts/generate-version.mjs && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
53
+ "lint": "oxlint --deny-warnings",
54
+ "lint:fix": "oxlint --fix",
53
55
  "test": "node --test dist/*.test.js",
54
56
  "bump-version": "node scripts/bump-version.mjs"
55
57
  },
56
58
  "dependencies": {
57
- "@grpc/grpc-js": "^1.14.5",
59
+ "@grpc/grpc-js": "^1.14.6",
58
60
  "@grpc/proto-loader": "^0.8.1",
59
61
  "@xterm/addon-fit": "^0.11.0",
60
62
  "@xterm/addon-serialize": "^0.14.0",
@@ -79,15 +81,17 @@
79
81
  "@deepseek-ai/dsh-client-ui-tool": "0.2.0-rc.2",
80
82
  "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
81
83
  "@deepseek-ai/schemastery": "3.18.4",
82
- "@types/node": "^22.0.0",
84
+ "@types/node": "^26.6.5",
83
85
  "@types/react": "^18.3.31",
86
+ "dprint": "0.62.0",
84
87
  "esbuild": "^0.28.2",
88
+ "oxlint": "1.87.0",
85
89
  "typescript": "^7.0.2"
86
90
  },
87
91
  "engines": {
88
92
  "node": ">=22"
89
93
  },
90
- "packageManager": "pnpm@12.4.1",
94
+ "packageManager": "pnpm@12.11.2",
91
95
  "publishConfig": {
92
96
  "access": "public",
93
97
  "provenance": true
@@ -1,10 +0,0 @@
1
- import type { Translate } from "./locales.js";
2
- import { type ReactNode } from "react";
3
- export declare function DefaultEnvironmentSection(props: {
4
- t: Translate;
5
- env: Record<string, string>;
6
- busy: boolean;
7
- writable: boolean;
8
- onSave: (env: Record<string, string>) => void;
9
- onSync: (workspace: string) => void;
10
- }): ReactNode;
@@ -1,69 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
- //
4
- // SPDX-License-Identifier: MIT
5
- // The default container environment: the map seeded into every new container,
6
- // edited with the same EnvEditor a container row uses. The setting is
7
- // persisted, so the draft is committed with Save, and the git shortcut fills
8
- // the four identity variables in that same draft.
9
- import { EnvEditor } from "./container-card-editors.js";
10
- import { ConfirmButton, Field } from "./container-card-shared.js";
11
- import { hint, sectionTitle, wsBody } from "./container-card-styles.js";
12
- import { commitIdentityAction, readGitIdentity, setGitIdentity, } from "../container-env.js";
13
- import { Button, Input, Modal } from "@deepseek-ai/dsh-client-ui-primitives";
14
- import { useEffect, useId, useState } from "react";
15
- export function DefaultEnvironmentSection(props) {
16
- const { t, env, busy, writable, onSave, onSync } = props;
17
- const [draft, setDraft] = useState(env);
18
- const [gitOpen, setGitOpen] = useState(false);
19
- const [gitName, setGitName] = useState("");
20
- const [gitEmail, setGitEmail] = useState("");
21
- const nameId = useId();
22
- const emailId = useId();
23
- // An external settings change resyncs the draft; an unrelated refresh does
24
- // not, so an edit in progress is never clobbered. Same rule as a container
25
- // row's environment editor.
26
- const serverEnv = JSON.stringify(env);
27
- useEffect(() => {
28
- setDraft(env);
29
- }, [serverEnv]);
30
- const dirty = JSON.stringify(draft) !== serverEnv;
31
- const disabled = busy || !writable;
32
- // The identity popup applies into the draft; when the draft's only drift from
33
- // the saved environment is inside the identity keys, it commits straight, so
34
- // a name/email edit is not left unsaved behind an easy-to-miss Save click.
35
- // When the popup restores the saved identity exactly, its pending change is
36
- // discarded and the editor falls back to the persisted defaults, instead of
37
- // keeping the stale identity (a no-op save would not resync the draft, since
38
- // the server value did not change).
39
- const commitIdentity = (next) => {
40
- const action = commitIdentityAction(env, draft, next);
41
- if (action === "save") {
42
- onSave(next);
43
- }
44
- else if (action === "discard") {
45
- setDraft(env);
46
- }
47
- else {
48
- setDraft(next);
49
- }
50
- };
51
- const openGit = () => {
52
- const identity = readGitIdentity(draft);
53
- setGitName(identity.name);
54
- setGitEmail(identity.email);
55
- setGitOpen(true);
56
- };
57
- return (_jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [_jsx("div", { style: sectionTitle, children: t("defaultEnvironment") }), _jsx("div", { style: wsBody, children: _jsx(EnvEditor, { t: t, env: draft, busy: disabled, onChange: setDraft }) }), _jsxs("div", { style: {
58
- display: "flex",
59
- flexWrap: "wrap",
60
- alignItems: "center",
61
- gap: "8px",
62
- }, children: [_jsx(Button, { variant: "outline", size: "sm", disabled: disabled, onClick: openGit, children: t("gitIdentity") }), _jsx(Button, { variant: "primary", size: "sm", disabled: disabled || !dirty, onClick: () => onSave(draft), children: t("save") }), _jsx(Button, { variant: "ghost", size: "sm", disabled: busy || !dirty, onClick: () => setDraft(env), children: t("discard") })] }), _jsx("div", { children: _jsx(ConfirmButton, { t: t, label: t("applyDefaults"), title: t("confirmTitle"), description: t("confirmApplyDefaults"), disabled: disabled || dirty || Object.keys(env).length === 0, onConfirm: () => onSync("") }) }), _jsx("p", { style: { ...hint, margin: 0 }, children: t("defaultEnvironmentHint") }), _jsx(Modal, { open: gitOpen, onClose: () => setGitOpen(false), title: t("gitIdentity"), closeLabel: t("cancel"), footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", disabled: busy || readGitIdentity(draft).name === "", onClick: () => {
63
- commitIdentity(setGitIdentity(draft, "", ""));
64
- setGitOpen(false);
65
- }, children: t("clear") }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => setGitOpen(false), children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: busy || gitName === "" || gitEmail === "", onClick: () => {
66
- commitIdentity(setGitIdentity(draft, gitName, gitEmail));
67
- setGitOpen(false);
68
- }, children: t("apply") })] }), children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [_jsx(Field, { label: t("gitName"), htmlFor: nameId, children: _jsx(Input, { id: nameId, value: gitName, disabled: busy, onChange: (event) => setGitName(event.target.value) }) }), _jsx(Field, { label: t("gitEmail"), htmlFor: emailId, children: _jsx(Input, { id: emailId, value: gitEmail, disabled: busy, onChange: (event) => setGitEmail(event.target.value) }) }), _jsx("p", { style: { ...hint, margin: 0 }, children: t("gitIdentityHint") })] }) })] }));
69
- }