@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
@@ -0,0 +1,74 @@
1
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
+ //
3
+ // SPDX-License-Identifier: MIT
4
+ // A relative creation time in the reader's own language. The exact instant
5
+ // stays available beside it — a container field copies it, a build time keeps
6
+ // it as a title tooltip — so this never has to be precise: it names the moment
7
+ // the way a person would ("5 minutes ago", "today", "yesterday").
8
+ const MINUTE = 60_000;
9
+ const HOUR = 60 * MINUTE;
10
+ const DAY = 24 * HOUR;
11
+ const MONTH = 30 * DAY;
12
+ const YEAR = 365 * DAY;
13
+ // Constructing a formatter is the expensive part, so the ones already built are
14
+ // kept per locale. A locale the runtime refuses falls back to its default,
15
+ // which is also what an empty locale asks for.
16
+ const formatters = new Map();
17
+ function formatter(locale) {
18
+ const cached = formatters.get(locale);
19
+ if (cached !== undefined)
20
+ return cached;
21
+ let created;
22
+ try {
23
+ created = new Intl.RelativeTimeFormat(locale === "" ? undefined : locale, {
24
+ numeric: "auto",
25
+ });
26
+ }
27
+ catch {
28
+ try {
29
+ created = new Intl.RelativeTimeFormat(undefined, { numeric: "auto" });
30
+ }
31
+ catch {
32
+ // A runtime without Intl.RelativeTimeFormat at all: the caller shows the
33
+ // raw timestamp rather than a guessed label.
34
+ created = undefined;
35
+ }
36
+ }
37
+ if (created !== undefined)
38
+ formatters.set(locale, created);
39
+ return created;
40
+ }
41
+ /**
42
+ * The relative creation time of a container, e.g. "5 minutes ago", "today" or
43
+ * "yesterday". A stamp the browser cannot read, and a runtime without
44
+ * {@link Intl.RelativeTimeFormat}, both fall back to the raw value.
45
+ *
46
+ * @param createdAt - the container's timestamp, as the snapshot reported it.
47
+ * @param locale - the plugin's active locale; "" asks for the runtime default.
48
+ * @param now - the current instant, injected for pure rendering.
49
+ */
50
+ export function relativeTimeLabel(createdAt, locale, now = Date.now()) {
51
+ const at = Date.parse(createdAt);
52
+ if (Number.isNaN(at))
53
+ return createdAt;
54
+ const format = formatter(locale);
55
+ if (format === undefined)
56
+ return createdAt;
57
+ // A clock ahead of this browser must not read as a future creation.
58
+ const elapsed = Math.max(0, now - at);
59
+ // A moment ago is named as today: that is how a creation time reads, and the
60
+ // exact instant still sits beside it.
61
+ if (elapsed < MINUTE)
62
+ return format.format(0, "day");
63
+ if (elapsed < HOUR) {
64
+ return format.format(-Math.floor(elapsed / MINUTE), "minute");
65
+ }
66
+ if (elapsed < DAY)
67
+ return format.format(-Math.floor(elapsed / HOUR), "hour");
68
+ if (elapsed < MONTH)
69
+ return format.format(-Math.floor(elapsed / DAY), "day");
70
+ if (elapsed < YEAR) {
71
+ return format.format(-Math.floor(elapsed / MONTH), "month");
72
+ }
73
+ return format.format(-Math.floor(elapsed / YEAR), "year");
74
+ }
@@ -1 +1,9 @@
1
+ declare module "@deepseek-ai/dsh-client-ui-slots" {
2
+ interface SlotMap {
3
+ "shell.overlay": {
4
+ kind: "list";
5
+ scope: "root";
6
+ };
7
+ }
8
+ }
1
9
  export {};
@@ -121,7 +121,7 @@ function argSummary(args, keys, fallback) {
121
121
  const value = args[key];
122
122
  if (typeof value === "string" && value !== "")
123
123
  return firstLine(value);
124
- // Numeric operands (a pod port) are JSON numbers, not strings.
124
+ // Numeric operands (a container port) are JSON numbers, not strings.
125
125
  if (typeof value === "number")
126
126
  return String(value);
127
127
  if (Array.isArray(value) && value.length > 0) {
@@ -18,7 +18,7 @@ export function mergeDefaultEnv(defaults, env) {
18
18
  continue;
19
19
  merged[key] = value;
20
20
  }
21
- return { ...merged, ...(env ?? {}) };
21
+ return { ...merged, ...env };
22
22
  }
23
23
  // missingDefaultEnv returns the defaults a container does not have yet, so a
24
24
  // synchronisation can add exactly those and never overwrite an existing value.
@@ -1,14 +1,12 @@
1
- export interface EnvDraft {
1
+ export declare function orderedEnvEntries(env: Record<string, string>): [string, string][];
2
+ export declare function orderedEnvRecord(env: Record<string, string>): Record<string, string>;
3
+ export interface EnvEditRow {
4
+ id: number;
2
5
  key: string;
3
6
  value: string;
4
7
  }
5
- export interface EnvRow extends EnvDraft {
6
- pending: boolean;
7
- }
8
- export declare function emptyEnvDraft(): EnvDraft;
9
- export declare function envRows(env: Record<string, string>, draft: EnvDraft | undefined): EnvRow[];
10
- export declare function envKeyAvailable(env: Record<string, string>, key: string): boolean;
11
- export declare function commitEnvDraft(env: Record<string, string>, draft: EnvDraft): Record<string, string> | undefined;
12
- export declare function renameEnvKey(env: Record<string, string>, index: number, key: string): Record<string, string>;
13
- export declare function setEnvValue(env: Record<string, string>, index: number, value: string): Record<string, string>;
14
- export declare function removeEnvRow(env: Record<string, string>, index: number): Record<string, string>;
8
+ export declare function envEditRows(env: Record<string, string>): EnvEditRow[];
9
+ export declare function emptyEnvRow(): EnvEditRow;
10
+ export declare function envRecordFromRows(rows: readonly EnvEditRow[]): Record<string, string>;
11
+ export declare function conflictingEnvNames(names: readonly string[]): Set<string>;
12
+ export declare function firstDuplicateEnvName(names: readonly string[]): string | undefined;
package/dist/env-rows.js CHANGED
@@ -1,52 +1,84 @@
1
1
  // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
- export function emptyEnvDraft() {
5
- return { key: "", value: "" };
4
+ // The environment and secret environment editors' row model, kept out of the
5
+ // components so the rules stay testable: a row owns the draft, so a key that is
6
+ // retyped — emptied, or renamed onto a name already used — keeps its place in
7
+ // the list until the user removes it, and the parent record is derived from the
8
+ // rows whose key is non-empty.
9
+ // The order a container block lists an environment map in: by variable name,
10
+ // case-insensitively and ascending, so a reload of the snapshot never shuffles
11
+ // the rows. The create dialogs seed their draft in it too, so a seeded default
12
+ // reads where the block lists it. It is display-only: an edit keeps the row
13
+ // order the draft is given, so a staged row never moves.
14
+ export function orderedEnvEntries(env) {
15
+ return Object.entries(env).sort(([left], [right]) => {
16
+ const a = left.toLowerCase();
17
+ const b = right.toLowerCase();
18
+ if (a !== b)
19
+ return a < b ? -1 : 1;
20
+ // Two names that differ only by case still read in one fixed order.
21
+ return left < right ? -1 : left > right ? 1 : 0;
22
+ });
23
+ }
24
+ // orderedEnvRecord is the same order as a fresh record, so a seeded draft lists
25
+ // its rows exactly as the container block shows them.
26
+ export function orderedEnvRecord(env) {
27
+ return Object.fromEntries(orderedEnvEntries(env));
6
28
  }
7
- export function envRows(env, draft) {
8
- const rows = Object.entries(env).map(([key, value]) => ({
29
+ let nextEnvRowId = 0;
30
+ // envEditRows wraps a record's entries for editing, in the order a container
31
+ // block lists them — by variable name, case-insensitively and ascending — each
32
+ // with its own id. This is the one place an editor builds its rows, so the
33
+ // dialog opens in the order the block shows and no later change re-sorts them.
34
+ export function envEditRows(env) {
35
+ return orderedEnvEntries(env).map(([key, value]) => ({
36
+ id: nextEnvRowId++,
9
37
  key,
10
38
  value,
11
- pending: false,
12
39
  }));
13
- if (draft !== undefined)
14
- rows.push({ ...draft, pending: true });
15
- return rows;
16
- }
17
- // Whether a draft's key can become a variable: non-empty and not already used.
18
- export function envKeyAvailable(env, key) {
19
- return key !== "" && !Object.prototype.hasOwnProperty.call(env, key);
20
40
  }
21
- // commitEnvDraft appends the draft to the record once its key is usable, or
22
- // returns undefined so the caller keeps the row open instead of inventing a
23
- // placeholder variable name.
24
- export function commitEnvDraft(env, draft) {
25
- if (!envKeyAvailable(env, draft.key))
26
- return undefined;
27
- return { ...env, [draft.key]: draft.value };
41
+ // emptyEnvRow is the row an editor appends: unnamed and empty, waiting for the
42
+ // name that makes it a variable.
43
+ export function emptyEnvRow() {
44
+ return { id: nextEnvRowId++, key: "", value: "" };
28
45
  }
29
- // Every mutation rebuilds the record in order, so a renamed key stays in place
30
- // instead of jumping to the end.
31
- export function renameEnvKey(env, index, key) {
32
- const next = {};
33
- Object.entries(env).forEach(([current, value], at) => {
34
- next[at === index ? key : current] = value;
35
- });
36
- return next;
46
+ // envRecordFromRows derives the variables an editor commits from its rows: a
47
+ // row is committed only while its key is non-empty, so a row left unnamed is
48
+ // never applied, and a name two rows repeat commits the last of them while the
49
+ // duplicate check refuses the apply in the meantime.
50
+ export function envRecordFromRows(rows) {
51
+ return Object.fromEntries(rows.filter((row) => row.key !== "").map((row) => [row.key, row.value]));
37
52
  }
38
- export function setEnvValue(env, index, value) {
39
- const next = {};
40
- Object.entries(env).forEach(([key, current], at) => {
41
- next[key] = at === index ? value : current;
42
- });
43
- return next;
53
+ // Every name a container's environment will hold, across both the environment
54
+ // variables and the secret environment variables, each editor contributing its
55
+ // rows as they are typed. A name is a conflict when it is empty or when it is
56
+ // listed more than once; both end up refused by the dialog's action, so both
57
+ // groups check the same list.
58
+ export function conflictingEnvNames(names) {
59
+ const seen = new Set();
60
+ const conflicts = new Set();
61
+ for (const name of names) {
62
+ if (name === "")
63
+ conflicts.add(name);
64
+ else if (seen.has(name))
65
+ conflicts.add(name);
66
+ else
67
+ seen.add(name);
68
+ }
69
+ return conflicts;
44
70
  }
45
- export function removeEnvRow(env, index) {
46
- const next = {};
47
- Object.entries(env).forEach(([key, value], at) => {
48
- if (at !== index)
49
- next[key] = value;
50
- });
51
- return next;
71
+ // The first name the list repeats, in the order given, or undefined when every
72
+ // name is distinct. An empty name is left to the required-name message, so the
73
+ // duplicate message always names a real variable.
74
+ export function firstDuplicateEnvName(names) {
75
+ const seen = new Set();
76
+ for (const name of names) {
77
+ if (name === "")
78
+ continue;
79
+ if (seen.has(name))
80
+ return name;
81
+ seen.add(name);
82
+ }
83
+ return undefined;
52
84
  }
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.2.0";
2
- export declare const GIT_COMMIT = "46ae489";
1
+ export declare const VERSION = "1.3.0";
2
+ export declare const GIT_COMMIT = "cf0e325";
@@ -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.2.0";
6
- export const GIT_COMMIT = "46ae489";
5
+ export const VERSION = "1.3.0";
6
+ export const GIT_COMMIT = "cf0e325";
@@ -96,7 +96,7 @@ export function openGuestTerminal(binding, options) {
96
96
  call.on("end", () => {
97
97
  settle(new Error("terminal stream ended before the process exited"));
98
98
  });
99
- const env = { ...(options.env ?? {}) };
99
+ const env = { ...options.env };
100
100
  if (options.terminalType !== undefined &&
101
101
  options.terminalType !== "" &&
102
102
  env.TERM === undefined) {
@@ -20,3 +20,14 @@ export declare function mountModeToProto(mode: string | undefined): string;
20
20
  export declare function mountKindFromProto(proto: string | undefined): string | undefined;
21
21
  /** The logical mount mode for a proto enum value, or undefined when unspecified. */
22
22
  export declare function mountModeFromProto(proto: string | undefined): string | undefined;
23
+ /**
24
+ * The logical mount kind for any spelling a decode can produce: the short name,
25
+ * the enum name with or without its MOUNT_KIND_ prefix, its numeric string, or
26
+ * the enum number. An unspecified or unknown kind reads as a project mount.
27
+ */
28
+ export declare function normalizeMountKind(kind: unknown): string;
29
+ /**
30
+ * The logical mount mode for any spelling a decode can produce, mirroring
31
+ * normalizeMountKind. An unspecified or unknown mode reads as read-write.
32
+ */
33
+ export declare function normalizeMountMode(mode: unknown): string;
@@ -17,6 +17,31 @@ const KIND_FROM_PROTO = {
17
17
  MOUNT_KIND_VOLUME: "volume",
18
18
  MOUNT_KIND_SECRET: "secret",
19
19
  };
20
+ // The logical names and the proto enum numbers a mount kind can decode to. A
21
+ // value reaches a layer in one of several spellings — the enum name with or
22
+ // without its MOUNT_KIND_ prefix, the short name, or the number a decoder that
23
+ // renders enums as integers produces — so normalisation is table-driven rather
24
+ // than inferred from which source field happens to be filled.
25
+ const MOUNT_KIND_NAMES = {
26
+ project: "project",
27
+ tmpfs: "tmpfs",
28
+ volume: "volume",
29
+ secret: "secret",
30
+ };
31
+ const MOUNT_KIND_NUMBERS = {
32
+ 1: "project",
33
+ 2: "tmpfs",
34
+ 3: "volume",
35
+ 4: "secret",
36
+ };
37
+ const MOUNT_MODE_NAMES = {
38
+ read_only: "read_only",
39
+ read_write: "read_write",
40
+ };
41
+ const MOUNT_MODE_NUMBERS = {
42
+ 1: "read_only",
43
+ 2: "read_write",
44
+ };
20
45
  const MODE_FROM_PROTO = {
21
46
  MOUNT_MODE_READ_ONLY: "read_only",
22
47
  MOUNT_MODE_READ_WRITE: "read_write",
@@ -80,3 +105,38 @@ export function mountModeFromProto(proto) {
80
105
  ? MODE_FROM_PROTO[proto]
81
106
  : undefined;
82
107
  }
108
+ // lookupNormalized resolves a value against one short-name table and one enum
109
+ // number table, accepting either a string (short or prefixed enum name, or a
110
+ // numeric string) or a number. Anything unrecognised uses the fallback, so an
111
+ // unknown enum number can never be read as a different kind by accident.
112
+ function lookupNormalized(value, names, numbers, prefix, fallback) {
113
+ if (typeof value === "number")
114
+ return numbers[value] ?? fallback;
115
+ if (typeof value !== "string")
116
+ return fallback;
117
+ const short = value.startsWith(prefix)
118
+ ? value.slice(prefix.length).toLowerCase()
119
+ : value.toLowerCase();
120
+ if (Object.prototype.hasOwnProperty.call(names, short))
121
+ return names[short];
122
+ const numeric = Number(value);
123
+ if (value !== "" && Number.isInteger(numeric)) {
124
+ return numbers[numeric] ?? fallback;
125
+ }
126
+ return fallback;
127
+ }
128
+ /**
129
+ * The logical mount kind for any spelling a decode can produce: the short name,
130
+ * the enum name with or without its MOUNT_KIND_ prefix, its numeric string, or
131
+ * the enum number. An unspecified or unknown kind reads as a project mount.
132
+ */
133
+ export function normalizeMountKind(kind) {
134
+ return lookupNormalized(kind, MOUNT_KIND_NAMES, MOUNT_KIND_NUMBERS, "MOUNT_KIND_", "project");
135
+ }
136
+ /**
137
+ * The logical mount mode for any spelling a decode can produce, mirroring
138
+ * normalizeMountKind. An unspecified or unknown mode reads as read-write.
139
+ */
140
+ export function normalizeMountMode(mode) {
141
+ return lookupNormalized(mode, MOUNT_MODE_NAMES, MOUNT_MODE_NUMBERS, "MOUNT_MODE_", "read_write");
142
+ }
@@ -13,7 +13,7 @@ export function createSubprocessProvider(resolver) {
13
13
  const live = new Set();
14
14
  return {
15
15
  dispose: () => {
16
- for (const terminate of [...live])
16
+ for (const terminate of Array.from(live))
17
17
  terminate();
18
18
  },
19
19
  // The harness's resolveExecutable carries no cwd, and this provider's
@@ -224,7 +224,7 @@ export class TerminalSessions {
224
224
  /** Close every terminal and stop the retention sweep. */
225
225
  dispose() {
226
226
  clearInterval(this.sweep);
227
- for (const entry of [...this.entries.values()]) {
227
+ for (const entry of Array.from(this.entries.values())) {
228
228
  this.entries.delete(entry.key);
229
229
  this.byId.delete(entry.terminalId);
230
230
  void entry.terminal.terminate();
@@ -242,7 +242,7 @@ export class TerminalSessions {
242
242
  // reap closes terminals no browser has attached for the retention window.
243
243
  reap() {
244
244
  const cutoff = Date.now() - this.retentionMs;
245
- for (const entry of [...this.entries.values()]) {
245
+ for (const entry of Array.from(this.entries.values())) {
246
246
  if (entry.listener === undefined && entry.lastUsed < cutoff) {
247
247
  this.drop(entry.key);
248
248
  void entry.terminal.terminate();
@@ -35,7 +35,7 @@ const PROBE_SCRIPT = [
35
35
  "done",
36
36
  "if [ -f /etc/shells ]; then",
37
37
  " while IFS= read -r candidate; do",
38
- ' case $candidate in ""|\#*) continue ;; esac',
38
+ ' case $candidate in ""|#*) continue ;; esac',
39
39
  ' case $candidate in /*) [ -x "$candidate" ] && printf "%s\\t%s\\n" "${candidate##*/}" "$candidate" ;; esac',
40
40
  " done < /etc/shells",
41
41
  "fi",
@@ -8,7 +8,7 @@ import { publicContainer, publicDaemon, publicImage, publicMount, publicPublishe
8
8
  import { portProtocolToProto } from "./publish-port.js";
9
9
  import { grpc } from "./grpc/runtime-client.js";
10
10
  import { defaultMountMode, mountKindToProto, mountModeToProto, } from "./mount-enums.js";
11
- import { containerNotFound, } from "./workspace-binding.js";
11
+ import { containerNotFound } from "./workspace-binding.js";
12
12
  // Cap on paths `container_glob` returns, matching the built-in glob tool's
13
13
  // default result limit; `--sort=modified` makes the retained head the newest.
14
14
  const GLOB_MAX_RESULTS = 100;
@@ -54,7 +54,7 @@ export class WorkspaceResolver {
54
54
  // a removed (or recreated) workspace cannot serve stale rows.
55
55
  forgetWorkspace(slug) {
56
56
  const prefix = `${slug}:`;
57
- for (const key of [...this.containerBindings.keys()]) {
57
+ for (const key of Array.from(this.containerBindings.keys())) {
58
58
  if (key.startsWith(prefix))
59
59
  this.containerBindings.delete(key);
60
60
  }
@@ -148,7 +148,7 @@ export class WorkspaceResolver {
148
148
  // creating it once. It deliberately stops at an "ensureContainer + build a
149
149
  // binding" step: readiness is per-call, so a credential refresh can never
150
150
  // recurse through this path.
151
- resolveContainerBinding(slug, container, key, signal) {
151
+ resolveContainerBinding(slug, container, key, _signal) {
152
152
  let entry = this.containerBindings.get(key);
153
153
  if (entry === undefined) {
154
154
  entry = this.buildContainerBinding(slug, container, key).catch((error) => {
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # Architecture
8
8
 
9
+ English | [中文](architecture.zh.md)
10
+
9
11
  dsh-podman has four components:
10
12
 
11
13
  | Component | Runs | What it does |
@@ -73,10 +75,10 @@ model reads the artifact back with the container file tools instead of a host
73
75
  path the container cannot reach.
74
76
 
75
77
  A workspace's pod is torn down when its last container is removed, or directly
76
- through `RemoveWorkspace` (the Podman page's **Remove pod** action), which stops
77
- the containers' daemons, removes the pod and its containers, cleans their socket
78
- directories, and drops the stored workspace. Volumes, secrets, and project data
79
- are left untouched.
78
+ through `RemoveWorkspace` (the Podman page's **Remove containers** action),
79
+ which stops the containers' daemons, removes the pod and its containers, cleans
80
+ their socket directories, and drops the stored workspace. Volumes, secrets, and
81
+ project data are left untouched.
80
82
 
81
83
  Beyond project mounts, a container can mount named volumes (prefixed
82
84
  `DSH_PODMAN_VOLUME_PREFIX`, default `dsh-podman-`, and auto-created by podman on
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # 架构
8
8
 
9
+ [English](architecture.md) | 中文
10
+
9
11
  dsh-podman 由四个组件组成:
10
12
 
11
13
  | 组件 | 运行位置 | 功能 |
@@ -57,7 +59,7 @@ UUID),因此其容器共享一个网络命名空间。每个工作区都有
57
59
  `/tmp/dsh-podman/spill/<session>/`——因此模型会用容器文件工具读回该产物,而不是使用容器无法访问的主机路径。
58
60
 
59
61
  工作区的 Pod 会在其最后一个容器被移除时拆除,也可直接通过
60
- `RemoveWorkspace`(Podman 页面中的 **移除 Pod**
62
+ `RemoveWorkspace`(Podman 页面中的 **移除容器**
61
63
  操作)拆除:它会停止各容器的守护进程、移除 Pod 及其容器、清理它们的 socket
62
64
  目录,并删除存储的工作区记录。卷、机密和项目数据保持不变。
63
65
 
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # Configuration
8
8
 
9
+ English | [中文](configuration.zh.md)
10
+
9
11
  Environment variables use the `DSH_PODMAN_` prefix and are listed under the
10
12
  component that reads them (a variable read by several components appears in each
11
13
  of their sections). The plugin also exposes a few **UI settings** on its
@@ -30,32 +32,33 @@ cordis, then the environment variables below, then built-in defaults.
30
32
  ## Plugin (dsh client) — UI settings
31
33
 
32
34
  Editable on the **dsh-podman** page (sidebar **Plugins** panel → **Installed**;
33
- the images' Set-default popup and the **Default environment** section):
34
-
35
- | Setting | Default | Description |
36
- | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37
- | `defaultImage` | `archlinux` | Image **short name** used for new workspaces; chosen from base and custom images via the Set-default popup |
38
- | `uiLocale` | `""` | Plugin-managed active locale, written by the browser client so the host can render approval text in the session language (see [Approval](usage.md#approval)); not user-editable |
39
- | `containerEnv` | `{}` | Default environment seeded into a container when it is created; see [Default environment](#default-environment) |
40
-
41
- ### Default environment
42
-
43
- `containerEnv` is one map of variables seeded into a container when it is
44
- created: the default container of a new workspace and every named container. A
45
- container's own `env` wins per key, and a recreate stores exactly the
46
- environment it is given, so removing a value from a container's environment and
47
- recreating it removes that value for good.
48
-
49
- The Podman page's **Default environment** section edits it with the same
50
- key/value rows a container uses: add or remove variables, then **Save** (or
35
+ the images' **Set default** action and the **Default environment variables**
36
+ section):
37
+
38
+ | Setting | Default | Description |
39
+ | -------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | `defaultImage` | `archlinux` | Image **short name** used for new workspaces; chosen from base and custom images via the images card's **Set default** action. When it is unset, the card names the effective default instead (the first base image, `archlinux`) |
41
+ | `uiLocale` | `""` | Plugin-managed active locale, written by the browser client so the host can render approval text in the session language (see [Approval](usage.md#approval)); not user-editable |
42
+ | `containerEnv` | `{}` | Default environment used for containers created from now on; see [Default environment variables](#default-environment-variables) |
43
+
44
+ ### Default environment variables
45
+
46
+ `containerEnv` is one map of variables used for containers created from now on:
47
+ the default container of a new workspace and every named container. Existing
48
+ containers keep their own environment; a container's own `env` wins per key, and
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.
55
+
56
+ The Podman page's **Default environment variables** section edits it with the
57
+ same key/value rows a container uses: add or remove variables, then **Save** (or
51
58
  **Discard**). **Git identity** fills `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`,
52
- `GIT_COMMITTER_NAME` and `GIT_COMMITTER_EMAIL` from one name and one email, and
53
- **Apply default environment variables** adds the missing values to the running
54
- containers that lack them, recreating only those and never overwriting an
55
- existing value; stopped containers are left for their next start. Every
56
- workspace row offers the same action for its own containers. Reserved
57
- `DSH_PODMAN*` keys are ignored, and the values are not secret — use `secretEnv`
58
- for secrets (see [Secrets](usage.md#secrets)).
59
+ `GIT_COMMITTER_NAME` and `GIT_COMMITTER_EMAIL` from one name and one email.
60
+ Reserved `DSH_PODMAN*` keys are ignored, and the values are not secret — use
61
+ `secretEnv` for secrets (see [Secrets](usage.md#secrets)).
59
62
 
60
63
  ## Orchestrator (`dsh-podman-orchestrator`)
61
64
 
@@ -6,6 +6,8 @@ SPDX-License-Identifier: MIT
6
6
 
7
7
  # 配置
8
8
 
9
+ [English](configuration.md) | 中文
10
+
9
11
  环境变量使用 `DSH_PODMAN_`
10
12
  前缀,并按读取它们的组件分组列出(被多个组件读取的变量会出现在每个组件的对应章节中)。插件还在
11
13
  侧边栏 **插件** 面板 → **已安装** 中的 **dsh-podman** 页面中暴露了一些 **UI
@@ -27,28 +29,30 @@ SPDX-License-Identifier: MIT
27
29
 
28
30
  ## 插件(dsh 客户端)— UI 设置
29
31
 
30
- 可在侧边栏 **插件** 面板 → **已安装** 的 **dsh-podman** 页面内编辑(镜像的
31
- Set-default 弹窗和**默认环境变量**区块):
32
+ 可在侧边栏 **插件** 面板 → **已安装** 的 **dsh-podman** 页面内编辑(镜像卡片的
33
+ **Set default** 操作和**默认环境变量**区块):
32
34
 
33
- | 设置 | 默认值 | 说明 |
34
- | -------------- | ----------- | -------------------------------------------------------------------------------------------------------------------- |
35
- | `defaultImage` | `archlinux` | 用于新工作区的镜像**短名称**;可通过 Set-default 弹窗从基础镜像和自定义镜像中选择 |
36
- | `uiLocale` | `""` | 插件管理的当前语言,由浏览器客户端写入,以便主机以会话语言呈现审批文本(见[审批](usage.zh.md#审批));不可由用户编辑 |
37
- | `containerEnv` | `{}` | 容器创建时注入的默认环境变量;见[默认环境变量](#默认环境变量) |
35
+ | 设置 | 默认值 | 说明 |
36
+ | -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37
+ | `defaultImage` | `archlinux` | 用于新工作区的镜像**短名称**;可通过镜像卡片的 **Set default** 操作从基础镜像和自定义镜像中选择。未设置时,卡片会显示实际生效的默认镜像(首个基础镜像 `archlinux`) |
38
+ | `uiLocale` | `""` | 插件管理的当前语言,由浏览器客户端写入,以便主机以会话语言呈现审批文本(见[审批](usage.zh.md#审批));不可由用户编辑 |
39
+ | `containerEnv` | `{}` | 用于此后创建的容器的默认环境变量;见[默认环境变量](#默认环境变量) |
38
40
 
39
41
  ### 默认环境变量
40
42
 
41
43
  `containerEnv`
42
- 是一个在容器创建时注入的环境变量映射:新工作区的默认容器与每个命名容器都会收到它。容器自身的
44
+ 是一个用于此后创建的容器的环境变量映射:新工作区的默认容器与每个命名容器都会收到它。已有容器保留各自的环境变量;容器自身的
43
45
  `env`
44
- 按变量逐个优先,而重建容器时会完全采用传入的环境变量,因此在容器的环境变量里删除某一项并重建该容器,即可彻底移除它。
46
+ 按变量逐个优先,而重建容器时会完全采用传入的环境变量,因此请在工作区中编辑它并重建容器,以修改或移除某一项。**添加容器**
47
+ 与 **创建容器** 对话框的 **环境变量**
48
+ 分组会以这些默认值开头,使新容器将继承的值可见;不改动的值保留默认值,改动过的值成为该容器自身环境变量的一部分。
45
49
 
46
50
  Podman
47
51
  页面中的**默认环境变量**区块使用与容器相同的键/值行进行编辑:增删变量后点击**保存**(或**放弃**)。**Git
48
52
  身份**用一份姓名与邮箱填入
49
53
  `GIT_AUTHOR_NAME`、`GIT_AUTHOR_EMAIL`、`GIT_COMMITTER_NAME` 与
50
- `GIT_COMMITTER_EMAIL`;**应用默认环境变量**会把缺少的变量补给尚未具备它们的运行中容器,只重建这些容器,且绝不覆盖已有值;已停止的容器留待下次启动。每个工作区行也提供同样的操作,只作用于该工作区。保留的
51
- `DSH_PODMAN*` 键会被忽略,且这些值并非机密——机密请使用
54
+ `GIT_COMMITTER_EMAIL`。保留的 `DSH_PODMAN*`
55
+ 键会被忽略,且这些值并非机密——机密请使用
52
56
  `secretEnv`(见[机密](usage.zh.md#机密))。
53
57
 
54
58
  ## Orchestrator(`dsh-podman-orchestrator`)