@exagone313/dsh-podman 1.8.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cordis.patch.yml CHANGED
@@ -15,6 +15,10 @@
15
15
  # disable built-in terminal.
16
16
  - id: ui-sidebar-terminal
17
17
  disabled: true
18
+ # the harness checkout this context names exists only in the dsh container; the
19
+ # agent's tools run in guest containers, where that host path does not exist.
20
+ - id: harness-dev-context
21
+ disabled: true
18
22
  - insert:
19
23
  - id: podman
20
24
  name: '@exagone313/dsh-podman'
@@ -11,6 +11,7 @@
11
11
  // sentence rather than blocking the call.
12
12
  import { effectiveImage, parseContainerTemplate, templateMountInputs, withForcedProjectMount, } from "./container-template.js";
13
13
  import { normalizeMountKind } from "./mount-enums.js";
14
+ import { mergeDefaultEnv } from "./container-env.js";
14
15
  import { readProjectTemplate, workspaceForCwd } from "./template-files.js";
15
16
  // readTemplateLoadSummary builds the approval summary for one template apply,
16
17
  // or undefined when any part of it cannot be read.
@@ -36,7 +37,7 @@ export async function readTemplateLoadSummary(resolver, projectsRoot, request) {
36
37
  : { container: port.container, host: port.host }),
37
38
  envCount: Object.keys(template.spec.env).length,
38
39
  pathCount: template.spec.paths.length,
39
- removals: removalCounts(staged, template, current),
40
+ removals: removalCounts(staged, template, current, seededEnvKeys(resolver)),
40
41
  };
41
42
  }
42
43
  catch {
@@ -118,10 +119,18 @@ function currentMountKey(mount) {
118
119
  return `project\0${stringField(mount?.projectName)}`;
119
120
  }
120
121
  }
122
+ // seededEnvKeys returns the environment keys the apply always seeds: the
123
+ // plugin's default environment, filtered exactly as mergeDefaultEnv filters it
124
+ // (empty keys and the reserved DSH_PODMAN namespace are dropped). Those keys
125
+ // survive a template load whatever the template declares, so they are never
126
+ // counted as removed.
127
+ function seededEnvKeys(resolver) {
128
+ return new Set(Object.keys(mergeDefaultEnv(resolver.getConfig().containerEnv, undefined)));
129
+ }
121
130
  // removalCounts counts the current items absent from the staged template. A
122
131
  // group the template leaves undeclared is kept by StartContainer, so its
123
132
  // current values are not removed and its count stays zero.
124
- function removalCounts(staged, template, current) {
133
+ function removalCounts(staged, template, current, seededEnv) {
125
134
  if (current === undefined) {
126
135
  return { mounts: 0, env: 0, secretEnv: 0, paths: 0 };
127
136
  }
@@ -129,19 +138,19 @@ function removalCounts(staged, template, current) {
129
138
  const currentMounts = Array.isArray(current.mounts) ? current.mounts : [];
130
139
  const mounts = currentMounts.filter((mount) => !stagedKeys.has(currentMountKey(mount)))
131
140
  .length;
132
- const env = removedKeys(current.env, template.spec.env);
141
+ const env = removedKeys(current.env, template.spec.env, seededEnv);
133
142
  const secretEnv = removedKeys(current.secretEnv, template.spec.secretEnv);
134
143
  const paths = removedPaths(current.paths, template.spec.paths);
135
144
  return { mounts, env, secretEnv, paths };
136
145
  }
137
146
  // removedKeys counts the current keys a declared map does not name. An empty
138
- // declared map means the group was not declared, so nothing is removed.
139
- function removedKeys(current, declared) {
140
- const declaredKeys = Object.keys(declared);
141
- if (declaredKeys.length === 0)
147
+ // declared map means the group was not declared, so nothing is removed. `kept`
148
+ // names keys that survive regardless of the declaration.
149
+ function removedKeys(current, declared, kept = new Set()) {
150
+ const declaredKeys = new Set(Object.keys(declared));
151
+ if (declaredKeys.size === 0)
142
152
  return 0;
143
- const declaredSet = new Set(declaredKeys);
144
- return objectKeys(current).filter((key) => !declaredSet.has(key)).length;
153
+ return objectKeys(current).filter((key) => !declaredKeys.has(key) && !kept.has(key)).length;
145
154
  }
146
155
  // removedPaths counts the current PATH additions a declared list does not
147
156
  // name. An empty list means PATH is not replaced, so nothing is removed.
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.8.1";
2
- export declare const GIT_COMMIT = "649a4c5";
1
+ export declare const VERSION = "1.10.0";
2
+ export declare const GIT_COMMIT = "304c259";
@@ -2,5 +2,5 @@
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
4
  // Generated by scripts/generate-version.mjs; do not edit.
5
- export const VERSION = "1.8.1";
6
- export const GIT_COMMIT = "649a4c5";
5
+ export const VERSION = "1.10.0";
6
+ export const GIT_COMMIT = "304c259";
@@ -14,6 +14,7 @@
14
14
  // template declares replace those groups, groups it leaves undeclared keep their
15
15
  // values, and published ports are kept.
16
16
  import { templateMountInputs, } from "./container-template.js";
17
+ import { mergeDefaultEnv } from "./container-env.js";
17
18
  import { grpc } from "./grpc/runtime-client.js";
18
19
  import { mountInputToProto } from "./mount-input.js";
19
20
  import { portProtocolToProto } from "./publish-port.js";
@@ -30,7 +31,11 @@ export async function applyContainerTemplate(resolver, options) {
30
31
  if (mounts.length > 0)
31
32
  payload.mounts = mounts;
32
33
  if (Object.keys(template.spec.env).length > 0) {
33
- payload.env = template.spec.env;
34
+ // The default environment is layered under the template's own variables,
35
+ // the same way every other creation path seeds it: a template never has to
36
+ // repeat the git identity (which it may not carry at all) and loading one
37
+ // never drops the defaults.
38
+ payload.env = mergeDefaultEnv(resolver.getConfig().containerEnv, template.spec.env);
34
39
  }
35
40
  if (Object.keys(template.spec.secretEnv).length > 0) {
36
41
  payload.secretEnv = template.spec.secretEnv;
package/dist/tool-defs.js CHANGED
@@ -153,7 +153,7 @@ export const TOOL_DESCRIPTIONS = {
153
153
  image_rebuild_all: "Rebuild every stored image in dependency order (base first), skipping any image whose rebuild fails and its dependents. Requires approval: rebuilding replaces the images' contents.",
154
154
  image_remove: "Remove a built custom image by short name. Base images are managed from the settings. Requires approval: removing deletes the image so containers using it must be recreated from another image.",
155
155
  container_list: "List the containers of the current workspace, including the default container that is started on demand.",
156
- container_template_load: "Load a container template from the project's .dsh-podman directory: build its image when needed, then create the container or replace an existing one. The workspace project mount is always added read-write. The template's mounts replace the container's mounts; the environment, secret environment and PATH additions it declares replace those groups, and groups it leaves undeclared keep their current values. Requires approval: creating or replacing a container changes what runs in the workspace.",
156
+ container_template_load: "Load a container template from the project's .dsh-podman directory: build its image when needed, then create the container or replace an existing one. The workspace project mount is always added read-write. The template's mounts replace the container's mounts; the environment, secret environment and PATH additions it declares replace those groups, and groups it leaves undeclared keep their current values. The default environment variables are layered under the environment the template declares, so a template never has to repeat them. Requires approval: creating or replacing a container changes what runs in the workspace.",
157
157
  container_template_export: "Export a container of the current workspace as a container-template YAML document (its root base image, recursive package union, mounts, environment, secrets, PATH additions and ports). Returns the YAML string and changes nothing.",
158
158
  container_template_save: "Validate a container-template YAML document and save it through the workspace container's guest agent into the project's .dsh-podman directory, creating the directory when missing. Requires approval: it writes a file into the project.",
159
159
  container_start: "Start a container in the current workspace. Named containers are created with exactly the mounts you pass — the project directory is not mounted automatically. The default container always keeps its workspace project mount. Pass paths to replace the container's PATH additions.",
@@ -47,11 +47,12 @@ section):
47
47
  the default container of a new workspace and every named container. Existing
48
48
  containers keep their own environment; a container's own `env` wins per key, and
49
49
  a recreate stores exactly the environment it is given, so edit it in the
50
- workspace and recreate to change or remove a value. The **Add container** and
51
- **Create container** dialogs open their **Environment variables** group on these
52
- defaults, so the values a new container inherits are visible; a value left alone
53
- keeps the default and an edited one becomes part of that container's own
54
- environment.
50
+ workspace and recreate to change or remove a value. Loading a container template
51
+ seeds these values under the template's `env`, so a template never has to repeat
52
+ them. The **Add container** and **Create container** dialogs open their
53
+ **Environment variables** group on these defaults, so the values a new container
54
+ inherits are visible; a value left alone keeps the default and an edited one
55
+ becomes part of that container's own environment.
55
56
 
56
57
  The Podman page's **Default environment variables** section edits it with the
57
58
  same key/value rows a container uses: add or remove variables, then **Save** (or
@@ -22,7 +22,7 @@ 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, and (for the browser half) the
25
+ Prerequisites: Go 1.27, Node ≥ 24.9, pnpm 12, and (for the browser half) the
26
26
  `@deepseek-ai/dsh-client-*` packages published on npm.
27
27
 
28
28
  ```sh
@@ -21,7 +21,7 @@ SPDX-License-Identifier: MIT
21
21
 
22
22
  ## 构建
23
23
 
24
- 前置要求:Go 1.27、Node ≥ 22、pnpm 12,以及(浏览器端所需的)发布在 npm 上的
24
+ 前置要求:Go 1.27、Node ≥ 24.9、pnpm 12,以及(浏览器端所需的)发布在 npm 上的
25
25
  `@deepseek-ai/dsh-client-*` 包。
26
26
 
27
27
  ```sh
package/docs/usage.md CHANGED
@@ -181,7 +181,7 @@ managed `DSH_*` fact.
181
181
  | Tool | Params | Description |
182
182
  | --------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
183
183
  | `container_template_export` | `container` | Export a container as a container-template YAML string (root base image, recursive package union minus the base's built-ins, mounts, environment, secret names, PATH additions and ports with explicit `protocol: tcp`); changes nothing |
184
- | `container_template_load` ✱ | `template`, optional `container` | Load a project template: build its image when needed, then create a container, publish its ports and report failures as warnings; the workspace project mount is added read-write |
184
+ | `container_template_load` ✱ | `template`, optional `container` | Load a project template: build its image when needed, then create a container, publish its ports and report failures as warnings; the workspace project mount is added read-write, and the default environment is layered under the template's `env` |
185
185
  | `container_template_save` ✱ | `container`, `name` | Save the source `container` as a template: the tool exports it to canonical YAML itself (there is no YAML argument) and writes the result through the default container's guest agent as `name` in the project's `.dsh-podman` directory, adding `.yml` when the basename has no YAML suffix and creating the directory when missing |
186
186
 
187
187
  ### Containers
@@ -734,7 +734,8 @@ grouped in the container card's order — project, volume, secret, tmpfs — and
734
734
  keep their order within a kind. The four Git identity variables
735
735
  (`GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`,
736
736
  `GIT_COMMITTER_EMAIL`) are never written to a template, and a template that
737
- declares them is loaded without them: they come from the default environment.
737
+ declares them is loaded without them: they come from the default environment,
738
+ which is layered under the `env` a template declares whenever one is loaded.
738
739
 
739
740
  The format is strict: an unknown `version` or `kind`, any key outside the sets
740
741
  above (no `command`, `resources`, tmpfs `size`, or port `protocol` other than
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exagone313/dsh-podman",
3
- "version": "1.8.1",
3
+ "version": "1.10.0",
4
4
  "description": "Podman-backed execution for DeepSeek Harness (dsh).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -56,7 +56,7 @@
56
56
  "bump-version": "node scripts/bump-version.mjs"
57
57
  },
58
58
  "dependencies": {
59
- "@grpc/grpc-js": "^1.14.6",
59
+ "@grpc/grpc-js": "^1.14.7",
60
60
  "@grpc/proto-loader": "^0.8.1",
61
61
  "@xterm/addon-fit": "^0.11.0",
62
62
  "@xterm/addon-serialize": "^0.14.0",
@@ -65,54 +65,54 @@
65
65
  "yaml": "^2.9.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@deepseek-ai/cordis": "4.0.5",
69
- "@deepseek-ai/dsh-api-remotes": "0.2.1-rc.3",
70
- "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-rc.3",
71
- "@deepseek-ai/dsh-client-locale": "0.2.1-rc.3",
72
- "@deepseek-ai/dsh-client-shortcuts": "0.2.1-rc.3",
73
- "@deepseek-ai/dsh-client-store": "0.2.1-rc.3",
74
- "@deepseek-ai/dsh-client-ui-approval": "0.2.1-rc.3",
75
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.3",
76
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.3",
77
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.3",
78
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.3",
79
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3",
80
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.3",
81
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.3",
82
- "@deepseek-ai/dsh-client-ui-tool": "0.2.1-rc.3",
83
- "@deepseek-ai/dsh-fs": "0.2.1-rc.3",
84
- "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
85
- "@deepseek-ai/schemastery": "3.18.5",
86
- "@types/node": "^26.6.5",
68
+ "@deepseek-ai/cordis": "4.1.0",
69
+ "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.1",
70
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.2-rc.1",
71
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
72
+ "@deepseek-ai/dsh-client-shortcuts": "0.2.2-rc.1",
73
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
74
+ "@deepseek-ai/dsh-client-ui-approval": "0.2.2-rc.1",
75
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
76
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.1",
77
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
78
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
79
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
80
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.1",
81
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
82
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.2-rc.1",
83
+ "@deepseek-ai/dsh-fs": "0.2.2-rc.1",
84
+ "@deepseek-ai/dsh-subprocess": "0.2.2-rc.1",
85
+ "@deepseek-ai/schemastery": "3.19.0",
86
+ "@types/node": "^26.6.6",
87
87
  "@types/react": "^18.3.31",
88
88
  "dprint": "0.64.3",
89
89
  "esbuild": "^0.28.2",
90
- "oxlint": "1.89.0",
90
+ "oxlint": "1.93.0",
91
91
  "typescript": "^7.0.2"
92
92
  },
93
93
  "engines": {
94
- "node": ">=22"
94
+ "node": ">=24.9.0"
95
95
  },
96
- "packageManager": "pnpm@12.15.0",
96
+ "packageManager": "pnpm@12.18.0",
97
97
  "publishConfig": {
98
98
  "access": "public",
99
99
  "provenance": true
100
100
  },
101
101
  "peerDependencies": {
102
- "@deepseek-ai/cordis": "4.0.5",
103
- "@deepseek-ai/dsh-client-locale": "0.2.1-rc.3",
104
- "@deepseek-ai/dsh-client-shortcuts": "0.2.1-rc.3",
105
- "@deepseek-ai/dsh-client-store": "0.2.1-rc.3",
106
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-rc.3",
107
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.3",
108
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.3",
109
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3",
110
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.3",
111
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.3",
112
- "@deepseek-ai/dsh-client-ui-tool": "0.2.1-rc.3",
113
- "@deepseek-ai/dsh-fs": "0.2.1-rc.3",
114
- "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
115
- "@deepseek-ai/schemastery": "3.18.5",
102
+ "@deepseek-ai/cordis": "4.1.0",
103
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
104
+ "@deepseek-ai/dsh-client-shortcuts": "0.2.2-rc.1",
105
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
106
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.1",
107
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.1",
108
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
109
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
110
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.1",
111
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
112
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.2-rc.1",
113
+ "@deepseek-ai/dsh-fs": "0.2.2-rc.1",
114
+ "@deepseek-ai/dsh-subprocess": "0.2.2-rc.1",
115
+ "@deepseek-ai/schemastery": "3.19.0",
116
116
  "react": "^18.2.0"
117
117
  },
118
118
  "peerDependenciesMeta": {