dsh-bash-terminal-ts 0.8.2 → 0.8.4

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 (56) hide show
  1. package/README.de.md +1 -1
  2. package/README.en.md +6 -2
  3. package/README.es.md +1 -1
  4. package/README.fr.md +1 -1
  5. package/README.it.md +1 -1
  6. package/README.md +5 -1
  7. package/README.ru.md +1 -1
  8. package/agent-presets/README.md +170 -0
  9. package/agent-presets/install-presets.mjs +179 -0
  10. package/agent-presets/standard-win/agent.cordis.yml +271 -0
  11. package/agent-presets/standard-win/preset.yml +2 -0
  12. package/agent-presets/standard-win-gitbash/agent.cordis.yml +271 -0
  13. package/agent-presets/standard-win-gitbash/preset.yml +2 -0
  14. package/agent-presets/standard-win-msys2/agent.cordis.yml +272 -0
  15. package/agent-presets/standard-win-msys2/preset.yml +2 -0
  16. package/agent-presets/standard-win-payload/agent.cordis.yml +271 -0
  17. package/agent-presets/standard-win-payload/preset.yml +2 -0
  18. package/agent-presets/standard-win-wsl2/agent.cordis.yml +271 -0
  19. package/agent-presets/standard-win-wsl2/preset.yml +2 -0
  20. package/cordis.patch.yml +12 -0
  21. package/dist/client.core.js +43 -12
  22. package/dist/client.js +43 -12
  23. package/dsh.plugin.json +2 -2
  24. package/lib/client.js +43 -12
  25. package/lib/dsh-types.d.ts +3 -1
  26. package/lib/index.d.ts +23 -2
  27. package/lib/index.js +79 -18
  28. package/lib/locales.js +27 -9
  29. package/lib/payload.d.ts +72 -0
  30. package/lib/payload.js +279 -0
  31. package/lib/shell-id.d.ts +2 -2
  32. package/lib/shells.d.ts +11 -2
  33. package/lib/shells.js +18 -4
  34. package/lib/terminal.js +1 -0
  35. package/lib/webterminals/catalog.d.ts +2 -0
  36. package/lib/webterminals/catalog.js +1 -0
  37. package/lib/webterminals/host.js +2 -2
  38. package/lib/webterminals/mount.d.ts +5 -0
  39. package/lib/webterminals/mount.js +4 -0
  40. package/package.json +17 -11
  41. package/scripts/check-artifacts.mjs +1 -1
  42. package/scripts/link-shells.mjs +22 -0
  43. package/scripts/payload-alias.mjs +97 -0
  44. package/scripts/provision-payload.mjs +233 -0
  45. package/src/client.tsx +29 -4
  46. package/src/dsh-types.ts +3 -1
  47. package/src/index.ts +117 -16
  48. package/src/locales.ts +27 -9
  49. package/src/payload.ts +322 -0
  50. package/src/shell-id.ts +2 -2
  51. package/src/shells.ts +27 -5
  52. package/src/terminal.ts +1 -0
  53. package/src/webterminals/browser/api.ts +1 -1
  54. package/src/webterminals/catalog.ts +3 -0
  55. package/src/webterminals/host.ts +2 -2
  56. package/src/webterminals/mount.ts +9 -0
@@ -0,0 +1,97 @@
1
+ // scripts/payload-alias.mjs - the payload's entry in the HOST's right-sidebar
2
+ // terminal menu, shared by link-shells.mjs and provision-payload.mjs.
3
+ //
4
+ // Why a hard link with its own name (same rule as git-bash.exe / msys-bash.exe):
5
+ // `discoverShells` keys its Map by the executable FILE NAME and keeps the
6
+ // earliest entry. The payload's binary is `bash.exe` - the same key the stock
7
+ // list spends on `C:\Windows\System32\bash.exe`, the WSL forwarder. A link
8
+ // inside the payload's own `bin\` named `bash-terminal.exe` (a) cannot collide
9
+ // with the WSL `bash` row, (b) is only ever present after an operator
10
+ // provisioned AND digest-verified a payload, and (c) keeps bash's POSIX-root
11
+ // derivation intact because it sits next to the original in the same tree.
12
+ //
13
+ // Why a junction (`payloads\bash-terminal` -> `payloads\posix-<ver>`): the
14
+ // bundle patch's candidate path must be a STABLE string - the version dir
15
+ // changes with every re-provision, the junction does not. Directory junctions
16
+ // need no privilege and may cross volumes, so the store layout is:
17
+ //
18
+ // %LOCALAPPDATA%\dsh-bash-terminal-ts\payloads\
19
+ // posix-5.2.37(1)\ <- the verified root (provision writes here)
20
+ // bin\bash.exe <- upstream binary
21
+ // bin\bash-terminal.exe <- hard link, the menu's own name
22
+ // bash-terminal\ (junction) <- stable path the patch points at
23
+ //
24
+ // The patch candidate is built with `!!js` from LOCALAPPDATA; a machine with no
25
+ // provisioned payload simply has no file at that path and discoverShells skips
26
+ // it per-candidate, exactly like a missing git-bash.exe link.
27
+ import { existsSync, linkSync, mkdirSync, readdirSync, statSync } from "node:fs";
28
+ import { join } from "node:path";
29
+ import { spawnSync } from "node:child_process";
30
+
31
+ /** The store layout for one env; pure, so tests can fake LOCALAPPDATA. */
32
+ export function payloadAliasPaths(env) {
33
+ const local = (env.LOCALAPPDATA ?? "").trim();
34
+ if (local.length === 0) return undefined;
35
+ const store = join(local, "dsh-bash-terminal-ts", "payloads");
36
+ return {
37
+ store,
38
+ junction: join(store, "bash-terminal"),
39
+ /** The stable candidate the bundle patch points at (junction + link name). */
40
+ candidate: join(store, "bash-terminal", "bin", "bash-terminal.exe"),
41
+ };
42
+ }
43
+
44
+ /** The newest provisioned root under the store (`posix-*` with bin/bash.exe). */
45
+ export function findPayloadStoreRoot(store, readdir = readdirSync, exists = existsSync) {
46
+ try {
47
+ return readdir(store)
48
+ .filter((name) => name.startsWith("posix-"))
49
+ .filter((name) => exists(join(store, name, "bin", "bash.exe")))
50
+ .sort()
51
+ .pop();
52
+ } catch {
53
+ return undefined;
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Create (idempotently) the hard link inside the root and the junction.
59
+ * @param {{root: string, junction: string}} target root = a verified payload dir.
60
+ * @returns {{link: string, junction: string, created: string[] , skipped?: string}}
61
+ */
62
+ export function ensurePayloadAlias(target, log = console.log) {
63
+ const created = [];
64
+ const source = join(target.root, "bin", "bash.exe");
65
+ const link = join(target.root, "bin", "bash-terminal.exe");
66
+ if (!existsSync(source)) {
67
+ return { link, junction: target.junction, created, skipped: `no bin/bash.exe under ${target.root}` };
68
+ }
69
+ if (existsSync(link)) {
70
+ const a = statSync(source);
71
+ const b = statSync(link);
72
+ if (a.ino !== b.ino || a.dev !== b.dev) {
73
+ return { link, junction: target.junction, created, skipped: `${link} exists but is NOT a hard link of bash.exe` };
74
+ }
75
+ } else {
76
+ linkSync(source, link);
77
+ created.push(link);
78
+ log(`created ${link}`);
79
+ }
80
+ // Junction: mklink /J via cmd (no privilege needed; works cross-volume).
81
+ if (existsSync(target.junction)) {
82
+ // A junction reads as a directory through existsSync; trust it if the
83
+ // candidate resolves through it.
84
+ if (existsSync(link.replace(target.root, join(target.junction, ""))) || existsSync(join(target.junction, "bin", "bash-terminal.exe"))) {
85
+ return { link, junction: target.junction, created };
86
+ }
87
+ return { link, junction: target.junction, created, skipped: `${target.junction} exists but does not reach the payload bin` };
88
+ }
89
+ mkdirSync(target.store ?? join(target.junction, ".."), { recursive: true });
90
+ const r = spawnSync("cmd", ["/c", "mklink", "/J", target.junction, target.root], { windowsHide: true, encoding: "utf8" });
91
+ if (r.status !== 0) {
92
+ return { link, junction: target.junction, created, skipped: `mklink /J failed (exit ${r.status}): ${(r.stderr ?? "").trim()}` };
93
+ }
94
+ created.push(target.junction);
95
+ log(`created junction ${target.junction} -> ${target.root}`);
96
+ return { link, junction: target.junction, created };
97
+ }
@@ -0,0 +1,233 @@
1
+ #!/usr/bin/env node
2
+ // scripts/provision-payload.mjs - operator-side provisioning of the pinned
3
+ // backup POSIX runtime payload for dsh-bash-terminal-ts.
4
+ //
5
+ // Naming: the artifact is OUR `posix-runtime` package - by policy our names
6
+ // never carry the bash/gitbash/msys tokens (bare `bash` on Windows belongs to
7
+ // the WSL forwarder's namespace; dsh-ops ships bash-*/msys-named payloads).
8
+ // The tree inside is the Git-for-Windows runtime, unmodified - upstream facts
9
+ // keep upstream file names.
10
+ //
11
+ // What this does: takes a LOCAL Git for Windows PortableGit SFX (or an already
12
+ // extracted runtime directory), unpacks/accepts it, checks the runtime is real
13
+ // (`bash --version`), computes SHA-256 of the two files the plugin's digest
14
+ // gate reads (`bin/bash.exe`, `usr/bin/msys-2.0.dll`), and writes
15
+ // `payload.trust.json` next to the root. From then on the plugin may run THAT
16
+ // exact binary and nothing else: unknown or drifted digests fail closed.
17
+ //
18
+ // What this deliberately does NOT do:
19
+ // - no downloads. The archive must exist on this machine (`--from`). We
20
+ // repack upstream ourselves; we never consume dsh-ops's payload packages.
21
+ // - no PATH / system changes. The payload lives under %LOCALAPPDATA% (or
22
+ // wherever --into says) and is reachable only through the plugin.
23
+ // - no silent promotion. Writing the trust file IS the human approval step;
24
+ // --emit-ledger only prints a snippet, turning a local trust into a
25
+ // shipped ledger entry stays a release-time code change.
26
+ //
27
+ // Usage:
28
+ // node scripts/provision-payload.mjs --from "E:\dl\PortableGit-2.56.0.2-64-bit.7z.exe"
29
+ // node scripts/provision-payload.mjs --from "D:\PortableGit" [--into <dir>] [--pack <dir>] [--emit-ledger] [--label <name>]
30
+ import { spawnSync } from "node:child_process";
31
+ import { createHash } from "node:crypto";
32
+ import {
33
+ copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync,
34
+ statSync, writeFileSync
35
+ } from "node:fs";
36
+ import { join, resolve } from "node:path";
37
+ import { parseArgs } from "node:util";
38
+ import { ensurePayloadAlias, payloadAliasPaths } from "./payload-alias.mjs";
39
+
40
+ const REQUIRED = [
41
+ ["bin/bash.exe", "bin/bash.exe"],
42
+ ["usr/bin/msys-2.0.dll", "usr/bin/msys-2.0.dll"]
43
+ ];
44
+
45
+ const { values: opt } = parseArgs({
46
+ options: {
47
+ from: { type: "string" },
48
+ into: { type: "string" },
49
+ label: { type: "string" },
50
+ pack: { type: "string" },
51
+ "emit-ledger": { type: "boolean", default: false },
52
+ help: { type: "boolean", default: false }
53
+ }
54
+ });
55
+
56
+ if (opt.help || !opt.from) {
57
+ console.log(`usage: node scripts/provision-payload.mjs --from <PortableGit sfx | extracted dir>
58
+ [--into <payload root>] [--label <build label>]
59
+ [--pack <staging dir>] [--emit-ledger]`);
60
+ process.exit(opt.help ? 0 : 2);
61
+ }
62
+
63
+ const from = resolve(opt.from);
64
+ if (!existsSync(from)) fail(`--from does not exist: ${from}`);
65
+
66
+ function fail(msg) {
67
+ console.error(`provision-payload: ${msg}`);
68
+ process.exit(1);
69
+ }
70
+
71
+ function sha256(file) {
72
+ return createHash("sha256").update(readFileSync(file)).digest("hex");
73
+ }
74
+
75
+ // ---- 1. obtain a runtime root --------------------------------------------------
76
+
77
+ let root;
78
+ let sourceKind;
79
+ const st = statSync(from);
80
+ if (st.isFile()) {
81
+ // 7-Zip SFX used by Git for Windows PortableGit: `-y -o<dir>` extracts, overwrite-all.
82
+ const target = opt.into ? resolve(opt.into) : defaultStoreDir();
83
+ if (target && existsSync(join(target, "bin", "bash.exe"))) {
84
+ console.log(`payload root already unpacked at ${target}; re-verifying digests only (delete it to re-extract)`);
85
+ root = target;
86
+ sourceKind = "pre-extracted";
87
+ } else {
88
+ mkdirSync(target, { recursive: true });
89
+ console.log(`extracting ${from} -> ${target} ...`);
90
+ const r = spawnSync(from, ["-y", `-o${target}`], { windowsHide: true, stdio: "inherit" });
91
+ if (r.error !== undefined || (r.status !== 0 && r.status !== 1 && r.status !== 2)) {
92
+ fail(`SFX extraction failed (status=${r.status}, error=${r.error?.message ?? "none"})`);
93
+ }
94
+ if (!existsSync(join(target, "bin", "bash.exe"))) fail(`extraction produced no bin/bash.exe under ${target}`);
95
+ root = target;
96
+ sourceKind = "sfx";
97
+ }
98
+ } else if (st.isDirectory()) {
99
+ root = from;
100
+ sourceKind = "directory";
101
+ if (opt.into) {
102
+ // Copying a ~350 MB tree is the operator's explicit choice, never a side effect.
103
+ const target = resolve(opt.into);
104
+ if (!existsSync(join(target, "bin", "bash.exe"))) {
105
+ fail(`--into ${target} is not a populated runtime directory; copying a payload tree is not automated here. Extract the SFX into it or point --into at an existing root.`);
106
+ }
107
+ root = target;
108
+ }
109
+ } else {
110
+ fail(`--from must be an SFX file or a directory, got: ${from}`);
111
+ }
112
+
113
+ // ---- 2. the runtime must be real -------------------------------------------------
114
+
115
+ const bashPath = join(root, "bin", "bash.exe");
116
+ const dllPath = join(root, "usr", "bin", "msys-2.0.dll");
117
+ for (const p of [bashPath, dllPath]) {
118
+ if (!existsSync(p)) fail(`payload root is missing ${p}`);
119
+ }
120
+ const ver = spawnSync(bashPath, ["--version"], { encoding: "utf8", timeout: 15000, windowsHide: true });
121
+ if (ver.error !== undefined || ver.status !== 0) {
122
+ fail(`bin/bash.exe --version failed (status=${ver.status}, error=${ver.error?.message ?? "none"})`);
123
+ }
124
+ const versionLine = String(ver.stdout ?? "").split(/\r?\n/)[0] ?? "";
125
+ const bashVersion = /version\s+(\S+)-release/.exec(versionLine)?.[1] ?? "unknown";
126
+ console.log(`verified bash ${bashVersion} at ${bashPath}`);
127
+
128
+ // ---- 3. digests + trust file ------------------------------------------------------
129
+
130
+ const files = {};
131
+ for (const [, rel] of REQUIRED) files[rel] = sha256(join(root, rel.replaceAll("/", "\\")));
132
+ const label = opt.label ?? `posix-${bashVersion}-${new Date().toISOString().slice(0, 10)}`;
133
+ const trustPath = join(root, "payload.trust.json");
134
+ const trust = {
135
+ schema: 1,
136
+ label,
137
+ bashVersion,
138
+ files,
139
+ source: { kind: sourceKind, path: from },
140
+ provisionedAt: new Date().toISOString(),
141
+ note: "operator-provisioned payload for dsh-bash-terminal-ts; digests pinned here are the ONLY version this plugin will run"
142
+ };
143
+ writeFileSync(trustPath, JSON.stringify(trust, null, 2) + "\n", "utf8");
144
+ console.log(`trust record written: ${trustPath}`);
145
+
146
+ // The official right-sidebar menu entry (hard link + stable junction). Only
147
+ // reached after the runtime verified real, so the link can never point at an
148
+ // unverified binary.
149
+ {
150
+ const paths = payloadAliasPaths(process.env);
151
+ if (paths !== undefined) {
152
+ const done = ensurePayloadAlias({ root, junction: paths.junction });
153
+ if (done.skipped !== undefined) console.log(`NOTE: payload menu alias incomplete: ${done.skipped}`);
154
+ else console.log(`menu alias ready: ${paths.candidate}`);
155
+ }
156
+ }
157
+
158
+ // ---- 4. optional self-managed npm package ------------------------------------------
159
+
160
+ if (opt.pack) {
161
+ const staging = resolve(opt.pack);
162
+ mkdirSync(staging, { recursive: true });
163
+ const pkgDir = join(staging, "@drscrewdriver", "posix-runtime-win32-x64");
164
+ mkdirSync(pkgDir, { recursive: true });
165
+ // The WHOLE runtime tree travels, not just bin+usr: bash resolves its POSIX
166
+ // root as <dir-of>/bin/../usr and sources <root>/etc/profile (`-lc` without
167
+ // etc is a PATH-less shell). We regenerate the trust/provenance/package.json
168
+ // ourselves, so copies of them inside the root are skipped.
169
+ const SKIP = new Set(["payload.trust.json", "provenance.json", "package.json"]);
170
+ for (const name of readdirSync(root)) {
171
+ if (SKIP.has(name.toLowerCase())) continue;
172
+ const s = join(root, name);
173
+ const ist = statSync(s);
174
+ if (ist.isDirectory()) cpTree(s, join(pkgDir, name));
175
+ else if (ist.isFile()) copyFileSync(s, join(pkgDir, name));
176
+ }
177
+ const provenance = {
178
+ label,
179
+ upstream: "Git for Windows runtime tree, repacked by us unmodified - NOT dsh-ops's payload package",
180
+ source: trust.source,
181
+ bashVersion,
182
+ files,
183
+ packedAt: new Date().toISOString()
184
+ };
185
+ writeFileSync(join(pkgDir, "provenance.json"), JSON.stringify(provenance, null, 2) + "\n", "utf8");
186
+ writeFileSync(join(pkgDir, "payload.trust.json"), JSON.stringify(trust, null, 2) + "\n", "utf8");
187
+ writeFileSync(join(pkgDir, "package.json"), JSON.stringify({
188
+ name: "@drscrewdriver/posix-runtime-win32-x64",
189
+ version: "0.1.0",
190
+ description: `Pinned POSIX runtime payload (Git-for-Windows tree) for dsh-bash-terminal-ts (win32-x64, bash ${bashVersion}). Contents: the upstream tree plus provenance/trust records; licenses travel with it.`,
191
+ os: ["win32"],
192
+ cpu: ["x64"],
193
+ license: "SEE LICENSE IN LICENSE.txt",
194
+ publishConfig: { registry: "https://registry.npmjs.org", access: "public" },
195
+ dsh: { payload: { kind: "posix", bashVersion, label, digests: files } }
196
+ }, null, 2) + "\n", "utf8");
197
+ console.log(`package tree staged at ${pkgDir} (npm pack/publish is a separate, registry-pinned release step)`);
198
+ }
199
+
200
+ // ---- 5. ledger snippet --------------------------------------------------------------
201
+
202
+ if (opt["emit-ledger"]) {
203
+ console.log("\n// drop into src/payload.ts PAYLOAD_LEDGER (release-time edit, then rebuild):\n");
204
+ console.log(` ${JSON.stringify(label)}: ${JSON.stringify(files)},`);
205
+ }
206
+
207
+ console.log(`\ndone. enable in the plugin config: enablePosixPayload: true${opt.into ? "" : ` (root: ${root})`}`);
208
+
209
+ // ---- helpers ------------------------------------------------------------------------
210
+
211
+ function defaultStoreDir() {
212
+ const local = process.env.LOCALAPPDATA;
213
+ if (!local) fail("no --into given and %LOCALAPPDATA% is unset - pass --into explicitly");
214
+ const versionTag = bashVersionTagGuess();
215
+ return join(local, "dsh-bash-terminal-ts", "payloads", `posix-${versionTag}`);
216
+ }
217
+
218
+ function bashVersionTagGuess() {
219
+ // Before extraction we only have the archive name; fall back to a date tag.
220
+ const m = /(\d+\.\d+\.\d+(?:\.\d+)?)/.exec(from);
221
+ return m ? m[1] : new Date().toISOString().slice(0, 10);
222
+ }
223
+
224
+ function cpTree(src, dst) {
225
+ mkdirSync(dst, { recursive: true });
226
+ for (const name of readdirSync(src)) {
227
+ const s = join(src, name);
228
+ const d = join(dst, name);
229
+ const ist = statSync(s);
230
+ if (ist.isDirectory()) cpTree(s, d);
231
+ else if (ist.isFile()) copyFileSync(s, d);
232
+ }
233
+ }
package/src/client.tsx CHANGED
@@ -39,7 +39,7 @@ import { post, readConfig, readLegacyConfig, writeDefaultShell, writeLegacyDefau
39
39
  import type { CatalogEntry, ConfigSnapshot } from "./webterminals/browser/api";
40
40
 
41
41
  const SETTINGS_NS = "settings.bash-terminal";
42
- const SHELLS = ["powershell", "gitbash", "msys2", "wsl"] as const;
42
+ const SHELLS = ["powershell", "gitbash", "msys2", "wsl", "payload"] as const;
43
43
 
44
44
  // Injected once when the browser loads the bundle (node tests guard on document).
45
45
  const ROW_CSS =
@@ -94,7 +94,7 @@ async function bridgeConfig(): Promise<ConfigSnapshot | null> {
94
94
  }
95
95
 
96
96
  /** The catalog if the terminal routes answered, else null (the old bridge shape). */
97
- function catalogOf(snapshot: ConfigSnapshot | null): CatalogEntry[] | null {
97
+ function catalogOf(snapshot: ConfigSnapshot | null | undefined): CatalogEntry[] | null {
98
98
  if (!Array.isArray(snapshot?.catalog)) return null;
99
99
  return snapshot.catalog as CatalogEntry[];
100
100
  }
@@ -109,12 +109,36 @@ function badgeKey(row: CatalogEntry): string {
109
109
  ? "dock.state.noDistro"
110
110
  : row.reason === "launcher-only"
111
111
  ? "dock.state.launcherOnly"
112
- : "dock.state.notInstalled";
112
+ : row.reason === "wsl-preferred"
113
+ ? "dock.state.wslPreferred"
114
+ : "dock.state.notInstalled";
115
+ }
116
+
117
+ /**
118
+ * Options for the default-terminal dropdown. The host's "default" write is
119
+ * validated against activated+available catalog rows, so the picker must offer
120
+ * exactly that set (powershell included: it is the floor and always on). A
121
+ * stored value outside the set is appended - the UI shows what IS chosen, not
122
+ * only what could be, and the host still refuses to re-write it.
123
+ */
124
+ function dropdownRows(snapshot: ConfigSnapshot | null | undefined, chosen: string): { id: string; label: string }[] {
125
+ const all = SHELLS.map((id) => ({ id, label: translate("shell." + id) }));
126
+ const rows = catalogOf(snapshot);
127
+ if (rows === null) return all;
128
+ const usable = rows
129
+ .filter((row) => row.activated && row.available)
130
+ .map((row) => ({ id: row.id, label: translate("shell." + row.id) }));
131
+ if (chosen.length > 0 && !usable.some((row) => row.id === chosen)) {
132
+ const extra = all.find((row) => row.id === chosen);
133
+ if (extra !== undefined) usable.push(extra);
134
+ }
135
+ return usable;
113
136
  }
114
137
 
115
138
  /** 默认终端选择行:读写全部走宿主 bridge(六线统一)。 */
116
139
  function ShellPreferenceRow({ snapshot }: { snapshot?: ConfigSnapshot | null }) {
117
140
  const [shell, setShell] = useState("powershell");
141
+ const [snap, setSnap] = useState<ConfigSnapshot | null>(snapshot ?? null);
118
142
  const [status, setStatus] = useState<"loading" | "ready" | "unavailable">("loading");
119
143
  useEffect(() => {
120
144
  let alive = true;
@@ -123,6 +147,7 @@ function ShellPreferenceRow({ snapshot }: { snapshot?: ConfigSnapshot | null })
123
147
  if (!alive) return;
124
148
  if (v && v.defaultShell) {
125
149
  setShell(v.defaultShell);
150
+ setSnap(v);
126
151
  setStatus("ready");
127
152
  } else {
128
153
  setStatus("unavailable");
@@ -161,7 +186,7 @@ function ShellPreferenceRow({ snapshot }: { snapshot?: ConfigSnapshot | null })
161
186
  <div className="btDesc">{translate("shell.description")}</div>
162
187
  </div>
163
188
  <ShellPicker
164
- rows={SHELLS.map((id) => ({ id, label: translate("shell." + id) }))}
189
+ rows={dropdownRows(snap, shell)}
165
190
  value={shell}
166
191
  onChange={(next) => change(next)}
167
192
  />
package/src/dsh-types.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  // ---- shared ------------------------------------------------------------------
11
11
 
12
12
  /** The terminal backends this plugin exposes. */
13
- export type ShellId = "powershell" | "gitbash" | "msys2" | "wsl";
13
+ export type ShellId = "powershell" | "gitbash" | "msys2" | "wsl" | "payload";
14
14
 
15
15
  /** Permissive node of the DSH JSON-schema dialect used in tool output declarations. */
16
16
  export interface JsonSchemaNode {
@@ -225,6 +225,8 @@ export interface ResolvedPaths {
225
225
  gitbash?: string;
226
226
  msys2?: string;
227
227
  wsl?: string;
228
+ /** The digest-verified pinned POSIX runtime payload (see src/payload.ts). */
229
+ payload?: string;
228
230
  }
229
231
 
230
232
  export interface CollectSpec {