@exagone313/dsh-podman 1.2.1 → 1.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.
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 +6491 -3474
  61. package/dist/client/locales.d.ts +10 -1
  62. package/dist/client/locales.js +270 -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 +2 -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 +35 -31
  93. package/dist/client/container-card-default-env.d.ts +0 -10
  94. package/dist/client/container-card-default-env.js +0 -69
package/docs/usage.zh.md CHANGED
@@ -122,8 +122,7 @@ bash 进程)的 `env` 映射;`container_exec` 和 `daemon_start` 已经接
122
122
  新容器还会注入插件的**默认环境变量**(`containerEnv` 设置),因此 Git
123
123
  身份只需配置一次,而不必按项目重复设置——见[默认环境变量](configuration.zh.md#默认环境变量)。Podman
124
124
  页面中的 **Git 身份**弹窗用一份姓名与邮箱填入四个
125
- `GIT_AUTHOR_*`/`GIT_COMMITTER_*`
126
- 变量,**应用默认环境变量**会把它们补给尚未具备的现有运行中容器。
125
+ `GIT_AUTHOR_*`/`GIT_COMMITTER_*` 变量。
127
126
 
128
127
  `container_bash` 和 `container_exec` 使用与内置 `bash`
129
128
  相同的命令可见环境运行:harness 托管的 `DSH_*`
@@ -338,33 +337,153 @@ orchestrator 持有租约的部分,gateway 不会自行保留任何主机端
338
337
 
339
338
  ## 容器管理 UI
340
339
 
341
- 插件附带一个浏览器端,把卡片注册到 **dsh-podman** 页面(侧边栏 **插件** 面板 →
342
- **已安装**)。该页面列出编排器创建的 guest
343
- 容器和已构建的镜像。没有容器的工作区会得到一个 **Create container**
344
- 按钮,打开一个配置模态框——镜像、环境、挂载(project、tmpfs、volume 和
345
- secret)、PATH 附加项以及机密环境变量——而已有容器的工作区通过同一个模态框提供
346
- **Add container**
347
- 按钮,用于添加额外的命名容器,模态框标题与打开它的按钮一致。在该模态框中,每个挂载的模式是一个下拉框(read-only/read-write),因此可以在创建时就把工作区项目挂载设为只读;tmpfs
348
- 和 secret 挂载的模式是固定的(分别为 read-write 和
349
- read-only),显示为不可编辑的下拉框。容器行显示其环境和机密环境变量及其挂载,允许编辑环境变量和添加/移除挂载(每次移除都会确认),以及将命名机密附加/分离到容器的环境变量;每行还提供
350
- **Remove**、**Recreate**(相同镜像)和 **Recreate with image**。每行的
351
- **端口**区段会列出已暴露到主机的 pod 端口,并可再发布一个:填写 pod
352
- 端口,以及可选的首选主机端口(未填写时由 gateway
353
- 选择一个空闲端口,通知中会给出实际绑定的地址),取消发布需要确认;当 gateway
354
- 未运行或容器未运行时,发布会显示提示并保持禁用。每个工作区行还提供 **移除
355
- Pod**,它会移除该工作区的
356
- Pod、其所有容器以及编排器对应的记录(卷、机密和项目数据会保留);移除工作区的最后一个容器也会一并移除其
357
- Pod,因此不会留下空的 Pod。每次通过 **插件**
358
- 面板打开该页面时都会重新读取实时状态,其底部还有一个 **Reload this view**
359
- 按钮。镜像部分可以重建单个镜像或按依赖顺序**重建全部**;**Build image**
360
- 打开一个弹窗,包含 image-id/base-image 表单和用于软件包列表的 chip
361
- 输入框(输入名称并按空格/逗号,或粘贴列表,以添加可移除的
362
- chips)。卷和机密以独立的可展开行列出,每行都有自己的操作,**Create volume** /
363
- **Create secret**
364
- 打开弹窗表单(机密表单接受可选的长度;机密的值可以被覆盖,但绝不读取)。Podman
365
- 页面操作是直接的控制调用,不受审批门控。
366
-
367
- **软件包缓存**区段会报告每个已配置构建缓存(`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
+ 版本差异会标注在它所限定的状态旁。
368
487
 
369
488
  ## Podman 终端
370
489
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagone313/dsh-podman",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "Podman-backed execution for DeepSeek Harness (dsh).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -50,6 +50,8 @@
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
  },
@@ -62,26 +64,28 @@
62
64
  "@xterm/xterm": "^6.0.0"
63
65
  },
64
66
  "devDependencies": {
65
- "@deepseek-ai/cordis": "4.0.4",
66
- "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.2",
67
- "@deepseek-ai/dsh-api-workspace-controller": "0.2.0-rc.2",
68
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
69
- "@deepseek-ai/dsh-client-shortcuts": "0.2.0-rc.2",
70
- "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
71
- "@deepseek-ai/dsh-client-ui-approval": "0.2.0-rc.2",
72
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.2",
73
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2",
74
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
75
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
76
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
77
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.0-rc.2",
78
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
79
- "@deepseek-ai/dsh-client-ui-tool": "0.2.0-rc.2",
80
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
81
- "@deepseek-ai/schemastery": "3.18.4",
67
+ "@deepseek-ai/cordis": "4.0.5",
68
+ "@deepseek-ai/dsh-api-remotes": "0.2.1-rc.2",
69
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-rc.2",
70
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
71
+ "@deepseek-ai/dsh-client-shortcuts": "0.2.1-rc.2",
72
+ "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
73
+ "@deepseek-ai/dsh-client-ui-approval": "0.2.1-rc.2",
74
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.2",
75
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.2",
76
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
77
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
78
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.2",
79
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.2",
80
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
81
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.1-rc.2",
82
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
83
+ "@deepseek-ai/schemastery": "3.18.5",
82
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": {
@@ -93,19 +97,19 @@
93
97
  "provenance": true
94
98
  },
95
99
  "peerDependencies": {
96
- "@deepseek-ai/cordis": "4.0.4",
97
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
98
- "@deepseek-ai/dsh-client-shortcuts": "0.2.0-rc.2",
99
- "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
100
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2",
101
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
102
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
103
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
104
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.0-rc.2",
105
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
106
- "@deepseek-ai/dsh-client-ui-tool": "0.2.0-rc.2",
107
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
108
- "@deepseek-ai/schemastery": "3.18.4",
100
+ "@deepseek-ai/cordis": "4.0.5",
101
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
102
+ "@deepseek-ai/dsh-client-shortcuts": "0.2.1-rc.2",
103
+ "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
104
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.2",
105
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
106
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
107
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.2",
108
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.2",
109
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
110
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.1-rc.2",
111
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
112
+ "@deepseek-ai/schemastery": "3.18.5",
109
113
  "react": "^18.2.0"
110
114
  },
111
115
  "peerDependenciesMeta": {
@@ -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
- }