dsh-bash-terminal-ts 0.8.7 → 0.9.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 (52) hide show
  1. package/CHANGELOG.de.md +152 -0
  2. package/CHANGELOG.es.md +152 -0
  3. package/CHANGELOG.fr.md +152 -0
  4. package/CHANGELOG.it.md +152 -0
  5. package/CHANGELOG.md +201 -0
  6. package/CHANGELOG.ru.md +152 -0
  7. package/README.de.md +1 -1
  8. package/README.en.md +3 -2
  9. package/README.es.md +1 -1
  10. package/README.it.md +1 -1
  11. package/README.md +4 -3
  12. package/agent-presets/README.md +171 -170
  13. package/agent-presets/install-presets.mjs +180 -179
  14. package/agent-presets/standard-win-niu/agent.cordis.yml +271 -0
  15. package/agent-presets/standard-win-niu/preset.yml +2 -0
  16. package/cordis.patch.yml +84 -83
  17. package/dist/client.core.js +10 -1
  18. package/dist/client.js +10 -1
  19. package/docs/dsh-plugin-development.md +169 -0
  20. package/docs/niu-backend.md +197 -0
  21. package/dsh.plugin.json +22 -22
  22. package/lib/client.js +10 -1
  23. package/lib/dsh-types.d.ts +14 -2
  24. package/lib/index.d.ts +15 -2
  25. package/lib/index.js +43 -5
  26. package/lib/locales.js +9 -0
  27. package/lib/shell-id.d.ts +1 -1
  28. package/lib/shells.d.ts +1 -0
  29. package/lib/shells.js +8 -2
  30. package/lib/terminal.js +4 -0
  31. package/lib/webterminals/host.js +2 -2
  32. package/lib/webterminals/mount.js +1 -0
  33. package/locale/de.json +6 -4
  34. package/locale/en.json +6 -4
  35. package/locale/es.json +6 -4
  36. package/locale/fr.json +6 -4
  37. package/locale/it.json +6 -4
  38. package/locale/ja.json +6 -4
  39. package/locale/ko.json +6 -4
  40. package/locale/ru.json +6 -4
  41. package/locale/zh.json +6 -4
  42. package/package.json +25 -11
  43. package/scripts/check-artifacts.mjs +96 -93
  44. package/src/client.tsx +685 -685
  45. package/src/dsh-types.ts +332 -320
  46. package/src/index.ts +1316 -1275
  47. package/src/locales.ts +461 -452
  48. package/src/shell-id.ts +11 -11
  49. package/src/shells.ts +279 -272
  50. package/src/terminal.ts +616 -612
  51. package/src/webterminals/host.ts +361 -361
  52. package/src/webterminals/mount.ts +237 -236
@@ -1,236 +1,237 @@
1
- // The wiring seam between the plugin's live config and the browser terminal.
2
- //
3
- // It lives in its own module because of one hard ordering fact (findings F1): the
4
- // host entry this plugin ships returns early on non-Windows platforms, since the
5
- // *model tool* is Windows-only. The browser terminal is not a Windows-only idea,
6
- // so its mount has to happen before that return - and keeping it in one call makes
7
- // that ordering visible at the call site instead of buried in a 1000-line apply().
8
- //
9
- // Everything environment-dependent arrives as live reads (config fields are
10
- // `.volatile()` on the 0.1.7+ lines, and older lines re-read from the same
11
- // closure), never a snapshot: a switch flipped in the settings page must apply to
12
- // the next allocation without a restart.
13
-
14
- import { createCatalogProvider } from "./catalog.js";
15
- import { listWslDistros } from "./catalog.js";
16
- import { reportSettingsSurface, settingsSurface } from "../settings-surface.js";
17
- import { registerUiTerminalRoutes } from "./host.js";
18
- import { UiTerminalRegistry } from "./registry.js";
19
- import { createUiSpawner, detectBackend } from "./pty.js";
20
- import { SHELL_PRIORITY } from "../shells.js";
21
- import type { ShellSwitches } from "../shells.js";
22
- import type { ResolvedPaths } from "../dsh-types.js";
23
-
24
- /** How many terminals one session may hold, and how many exist host-wide. */
25
- const MAX_PER_SESSION = 6;
26
- const MAX_TOTAL = 12;
27
- /** Detached-shell grace: long enough to survive a page reload, short enough to
28
- * not leak a shell someone abandoned. */
29
- const IDLE_GRACE_MS = 120_000;
30
- /** Replayed screen budget per terminal. */
31
- const SCROLLBACK_BYTES = 200_000;
32
-
33
- /** A live `.volatile()` reference as the 0.1.7+ loader hands it. */
34
- interface VolatileRef<T> {
35
- get(): T;
36
- }
37
-
38
- /** Read a config field that may be a value or a live ref. */
39
- function live<T>(value: T | VolatileRef<T> | undefined, fallback: T): T {
40
- if (typeof value === "object" && value !== null && typeof (value as VolatileRef<T>).get === "function") {
41
- const got = (value as VolatileRef<T>).get();
42
- return got === undefined ? fallback : got;
43
- }
44
- return value === undefined ? fallback : (value as T);
45
- }
46
-
47
- /** The session lookup for one terminal's cwd. */
48
- interface SessionsLike {
49
- get?(id: string): { header?: { cwd?: string } } | undefined;
50
- }
51
-
52
- /** The service-arrival context cordis hands the `inject` callback. */
53
- interface ArrivalContext {
54
- webServer?: unknown;
55
- settings?: unknown;
56
- effect(fn: () => unknown, name?: string): unknown;
57
- }
58
-
59
- /** What the caller passes; all of it comes from the plugin's own context. */
60
- export interface MountInput {
61
- /** The plugin context, widened: only three reads are used. */
62
- ctx: {
63
- subprocess?: { spawnTerminal?: unknown };
64
- get?(name: string): unknown;
65
- effect(fn: () => unknown, name?: string): unknown;
66
- inject?(deps: string[], fn: (svcCtx: ArrivalContext) => void): void;
67
- logger?: { info?(msg: string): void; warn?(msg: string): void };
68
- };
69
- config: Record<string, unknown>;
70
- paths: ResolvedPaths;
71
- /** The stored default shell ('' when the user never chose one). */
72
- configuredShell(): string;
73
- /**
74
- * Persist one config path. index.ts owns this (it holds the settings-service
75
- * dance for every line, including the <=0.1.6 self-registration retry), and the
76
- * service instance only exists here, so it is passed back in.
77
- */
78
- persist(svc: unknown, path: readonly string[], value: unknown): Promise<void>;
79
- /**
80
- * True when the startup payload gate was vetoed by a detected WSL distro
81
- * (index.ts owns the answer; the catalog only uses it for the row badge).
82
- */
83
- payloadSuppressed?(): boolean;
84
- platform?: NodeJS.Platform;
85
- }
86
-
87
- /** The mount outcome, reported through the routes' `unavailable` field. */
88
- export interface BrowserTerminalMount {
89
- /** 'ok', or why a terminal cannot be offered. */
90
- unavailable(): string;
91
- dispose(): void;
92
- }
93
-
94
- /**
95
- * Mount the browser terminal: routes, socket, registry, catalog cache.
96
- * @returns the disposer and the availability answer the settings page reads.
97
- */
98
- export function mountBrowserTerminals(input: MountInput): BrowserTerminalMount {
99
- const platform = input.platform ?? process.platform;
100
- const config = input.config;
101
- /**
102
- * In-process overrides for the fields this feature writes.
103
- *
104
- * Hosts up to 0.1.6 have no config hot-reload: `settings.mutate` persists the
105
- * value, but the object handed to `apply` never changes, so a switch flipped in
106
- * the settings page would only take effect after a restart. The plugin's legacy
107
- * bridge already solves that for `defaultShell` with a `shellOverride`; this is
108
- * the same mechanism for the activation switches. On 0.1.7+ the `.volatile()` ref
109
- * is already live, the map merely shadows it with the value we just wrote - a
110
- * no-op in the good case, the fix in the old one.
111
- */
112
- const overrides = new Map<string, unknown>();
113
- const readField = <T>(key: string, fallback: T): T => {
114
- if (overrides.has(key)) return overrides.get(key) as T;
115
- return live(config[key] as T | VolatileRef<T> | undefined, fallback);
116
- };
117
- const switches = (): ShellSwitches => ({
118
- // Powershell is not in here: it is the floor and has no switch by design (R2).
119
- gitbash: readField("shellGitBash", true),
120
- msys2: readField("shellMsys2", true),
121
- wsl: readField("shellWsl", true),
122
- // Opt-in twice over: enablePosixPayload provisions the runtime, this
123
- // switch decides whether a provisioned payload may show in pickers.
124
- payload: readField("shellPayload", false),
125
- });
126
- const wslDistro = (): string => readField("wslDistro", "").trim();
127
- /** The master switch: off hides the child switches and refuses allocations. */
128
- const enabled = (): boolean => readField("bottomTerminal", true);
129
- /**
130
- * Opt-in to publishing `webTerminals` for the official bottom row. Off by default and
131
- * deliberately NOT derived from "no controller detected": the client-side check that
132
- * would be needed for that is a boot-time race, and losing it takes down the host's
133
- * own terminal (findings D15-1).
134
- */
135
- const shimOfficialTerminal = (): boolean => readField("shimOfficialTerminal", false);
136
-
137
- // The WSL distro list, probed LAZILY on the first catalog read and re-probed
138
- // after a switch write. `undefined` is "still unknown / the probe timed out",
139
- // which the catalog treats as neutral rather than as evidence of absence.
140
- // Lazy matters: mounting the routes must not spawn `wsl.exe` in a process that
141
- // never opens a terminal (unit mocks, headless hosts, non-WSL machines).
142
- let distros: readonly string[] | undefined;
143
- let probing = false;
144
- const reprobe = (): void => {
145
- probing = true;
146
- void listWslDistros(input.paths.wsl).then((found) => {
147
- distros = found;
148
- probing = false;
149
- catalog.invalidate();
150
- }, () => {
151
- probing = false;
152
- });
153
- };
154
-
155
- const catalog = createCatalogProvider({
156
- paths: () => input.paths,
157
- switches,
158
- wslDistro,
159
- payloadSuppressed: input.payloadSuppressed ?? (() => false),
160
- distros: () => {
161
- if (distros === undefined && !probing) reprobe();
162
- return distros;
163
- },
164
- });
165
-
166
- const backend = detectBackend({ platform, seam: input.ctx.subprocess as never });
167
- const spawner = backend === undefined ? undefined : createUiSpawner({ platform, seam: input.ctx.subprocess as never });
168
- const registry = new UiTerminalRegistry({
169
- maxPerSession: MAX_PER_SESSION,
170
- maxTotal: MAX_TOTAL,
171
- idleGraceMs: IDLE_GRACE_MS,
172
- scrollback: SCROLLBACK_BYTES,
173
- spawn: async (spec) => {
174
- if (spawner === undefined) throw new Error("no PTY backend on this host");
175
- return await spawner.spawn(spec);
176
- },
177
- });
178
-
179
- let unavailable = "not-installed";
180
- let routes: { dispose(): void; socket: string } | undefined;
181
- const isLoopback = (request: { socket?: { remoteAddress?: string } }): boolean => {
182
- const addr = request.socket?.remoteAddress ?? "";
183
- return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
184
- };
185
- const cwdFor = (sessionId: string): string => {
186
- const sessions = (input.ctx.get?.("sessions") ?? undefined) as SessionsLike | undefined;
187
- return sessions?.get?.(sessionId)?.header?.cwd ?? process.cwd();
188
- };
189
-
190
- // webServer arrives only through injection; until then the routes report their
191
- // absence rather than pretending a terminal is available.
192
- input.ctx.inject?.(["webServer", "settings"], (svcCtx) => {
193
- // Classified the moment the settings service arrives: the browser cannot tell which
194
- // generation it is talking to, and the answer decides whether it paints its own
195
- // floating panel or stays out of the way.
196
- reportSettingsSurface(svcCtx.settings as never);
197
- routes = registerUiTerminalRoutes(svcCtx.webServer as Parameters<typeof registerUiTerminalRoutes>[0], {
198
- catalog: () => catalog.catalog(),
199
- paths: () => input.paths,
200
- env: (id) => catalog.env(id),
201
- enabled,
202
- shimOfficialTerminal,
203
- settingsSurface,
204
- configuredShell: input.configuredShell,
205
- switches,
206
- wslDistro,
207
- writeConfig: async (path, value) => {
208
- await input.persist(svcCtx.settings, path, value);
209
- // Remember it for this process too (the ≤0.1.6 hot-reload gap above).
210
- overrides.set(path.join("."), value);
211
- // A write also forgets the cached catalog and the WSL answer, so the
212
- // settings row never reports a stale result immediately after a click.
213
- distros = undefined;
214
- catalog.invalidate();
215
- },
216
- registry,
217
- cwdFor,
218
- unavailableReason: () => unavailable,
219
- isLoopback,
220
- });
221
- unavailable = backend === undefined ? "no-pty-backend" : routes.socket === "mounted" ? "ok" : routes.socket;
222
- input.ctx.logger?.info?.(`dsh-bash-terminal-ts: browser terminal routes ${unavailable} (backend=${backend ?? "none"}, priority=${SHELL_PRIORITY.join(">")})`);
223
- svcCtx.effect(() => () => {
224
- routes?.dispose();
225
- void registry.dispose();
226
- }, "bash-terminal: browser terminal routes");
227
- });
228
-
229
- return {
230
- unavailable: () => unavailable,
231
- dispose: () => {
232
- routes?.dispose();
233
- void registry.dispose();
234
- },
235
- };
236
- }
1
+ // The wiring seam between the plugin's live config and the browser terminal.
2
+ //
3
+ // It lives in its own module because of one hard ordering fact (findings F1): the
4
+ // host entry this plugin ships returns early on non-Windows platforms, since the
5
+ // *model tool* is Windows-only. The browser terminal is not a Windows-only idea,
6
+ // so its mount has to happen before that return - and keeping it in one call makes
7
+ // that ordering visible at the call site instead of buried in a 1000-line apply().
8
+ //
9
+ // Everything environment-dependent arrives as live reads (config fields are
10
+ // `.volatile()` on the 0.1.7+ lines, and older lines re-read from the same
11
+ // closure), never a snapshot: a switch flipped in the settings page must apply to
12
+ // the next allocation without a restart.
13
+
14
+ import { createCatalogProvider } from "./catalog.js";
15
+ import { listWslDistros } from "./catalog.js";
16
+ import { reportSettingsSurface, settingsSurface } from "../settings-surface.js";
17
+ import { registerUiTerminalRoutes } from "./host.js";
18
+ import { UiTerminalRegistry } from "./registry.js";
19
+ import { createUiSpawner, detectBackend } from "./pty.js";
20
+ import { SHELL_PRIORITY } from "../shells.js";
21
+ import type { ShellSwitches } from "../shells.js";
22
+ import type { ResolvedPaths } from "../dsh-types.js";
23
+
24
+ /** How many terminals one session may hold, and how many exist host-wide. */
25
+ const MAX_PER_SESSION = 6;
26
+ const MAX_TOTAL = 12;
27
+ /** Detached-shell grace: long enough to survive a page reload, short enough to
28
+ * not leak a shell someone abandoned. */
29
+ const IDLE_GRACE_MS = 120_000;
30
+ /** Replayed screen budget per terminal. */
31
+ const SCROLLBACK_BYTES = 200_000;
32
+
33
+ /** A live `.volatile()` reference as the 0.1.7+ loader hands it. */
34
+ interface VolatileRef<T> {
35
+ get(): T;
36
+ }
37
+
38
+ /** Read a config field that may be a value or a live ref. */
39
+ function live<T>(value: T | VolatileRef<T> | undefined, fallback: T): T {
40
+ if (typeof value === "object" && value !== null && typeof (value as VolatileRef<T>).get === "function") {
41
+ const got = (value as VolatileRef<T>).get();
42
+ return got === undefined ? fallback : got;
43
+ }
44
+ return value === undefined ? fallback : (value as T);
45
+ }
46
+
47
+ /** The session lookup for one terminal's cwd. */
48
+ interface SessionsLike {
49
+ get?(id: string): { header?: { cwd?: string } } | undefined;
50
+ }
51
+
52
+ /** The service-arrival context cordis hands the `inject` callback. */
53
+ interface ArrivalContext {
54
+ webServer?: unknown;
55
+ settings?: unknown;
56
+ effect(fn: () => unknown, name?: string): unknown;
57
+ }
58
+
59
+ /** What the caller passes; all of it comes from the plugin's own context. */
60
+ export interface MountInput {
61
+ /** The plugin context, widened: only three reads are used. */
62
+ ctx: {
63
+ subprocess?: { spawnTerminal?: unknown };
64
+ get?(name: string): unknown;
65
+ effect(fn: () => unknown, name?: string): unknown;
66
+ inject?(deps: string[], fn: (svcCtx: ArrivalContext) => void): void;
67
+ logger?: { info?(msg: string): void; warn?(msg: string): void };
68
+ };
69
+ config: Record<string, unknown>;
70
+ paths: ResolvedPaths;
71
+ /** The stored default shell ('' when the user never chose one). */
72
+ configuredShell(): string;
73
+ /**
74
+ * Persist one config path. index.ts owns this (it holds the settings-service
75
+ * dance for every line, including the <=0.1.6 self-registration retry), and the
76
+ * service instance only exists here, so it is passed back in.
77
+ */
78
+ persist(svc: unknown, path: readonly string[], value: unknown): Promise<void>;
79
+ /**
80
+ * True when the startup payload gate was vetoed by a detected WSL distro
81
+ * (index.ts owns the answer; the catalog only uses it for the row badge).
82
+ */
83
+ payloadSuppressed?(): boolean;
84
+ platform?: NodeJS.Platform;
85
+ }
86
+
87
+ /** The mount outcome, reported through the routes' `unavailable` field. */
88
+ export interface BrowserTerminalMount {
89
+ /** 'ok', or why a terminal cannot be offered. */
90
+ unavailable(): string;
91
+ dispose(): void;
92
+ }
93
+
94
+ /**
95
+ * Mount the browser terminal: routes, socket, registry, catalog cache.
96
+ * @returns the disposer and the availability answer the settings page reads.
97
+ */
98
+ export function mountBrowserTerminals(input: MountInput): BrowserTerminalMount {
99
+ const platform = input.platform ?? process.platform;
100
+ const config = input.config;
101
+ /**
102
+ * In-process overrides for the fields this feature writes.
103
+ *
104
+ * Hosts up to 0.1.6 have no config hot-reload: `settings.mutate` persists the
105
+ * value, but the object handed to `apply` never changes, so a switch flipped in
106
+ * the settings page would only take effect after a restart. The plugin's legacy
107
+ * bridge already solves that for `defaultShell` with a `shellOverride`; this is
108
+ * the same mechanism for the activation switches. On 0.1.7+ the `.volatile()` ref
109
+ * is already live, the map merely shadows it with the value we just wrote - a
110
+ * no-op in the good case, the fix in the old one.
111
+ */
112
+ const overrides = new Map<string, unknown>();
113
+ const readField = <T>(key: string, fallback: T): T => {
114
+ if (overrides.has(key)) return overrides.get(key) as T;
115
+ return live(config[key] as T | VolatileRef<T> | undefined, fallback);
116
+ };
117
+ const switches = (): ShellSwitches => ({
118
+ // Powershell is not in here: it is the floor and has no switch by design (R2).
119
+ gitbash: readField("shellGitBash", true),
120
+ msys2: readField("shellMsys2", true),
121
+ wsl: readField("shellWsl", true),
122
+ // Opt-in twice over: enablePosixPayload provisions the runtime, this
123
+ // switch decides whether a provisioned payload may show in pickers.
124
+ payload: readField("shellPayload", false),
125
+ niu: readField("shellNiu", true),
126
+ });
127
+ const wslDistro = (): string => readField("wslDistro", "").trim();
128
+ /** The master switch: off hides the child switches and refuses allocations. */
129
+ const enabled = (): boolean => readField("bottomTerminal", true);
130
+ /**
131
+ * Opt-in to publishing `webTerminals` for the official bottom row. Off by default and
132
+ * deliberately NOT derived from "no controller detected": the client-side check that
133
+ * would be needed for that is a boot-time race, and losing it takes down the host's
134
+ * own terminal (findings D15-1).
135
+ */
136
+ const shimOfficialTerminal = (): boolean => readField("shimOfficialTerminal", false);
137
+
138
+ // The WSL distro list, probed LAZILY on the first catalog read and re-probed
139
+ // after a switch write. `undefined` is "still unknown / the probe timed out",
140
+ // which the catalog treats as neutral rather than as evidence of absence.
141
+ // Lazy matters: mounting the routes must not spawn `wsl.exe` in a process that
142
+ // never opens a terminal (unit mocks, headless hosts, non-WSL machines).
143
+ let distros: readonly string[] | undefined;
144
+ let probing = false;
145
+ const reprobe = (): void => {
146
+ probing = true;
147
+ void listWslDistros(input.paths.wsl).then((found) => {
148
+ distros = found;
149
+ probing = false;
150
+ catalog.invalidate();
151
+ }, () => {
152
+ probing = false;
153
+ });
154
+ };
155
+
156
+ const catalog = createCatalogProvider({
157
+ paths: () => input.paths,
158
+ switches,
159
+ wslDistro,
160
+ payloadSuppressed: input.payloadSuppressed ?? (() => false),
161
+ distros: () => {
162
+ if (distros === undefined && !probing) reprobe();
163
+ return distros;
164
+ },
165
+ });
166
+
167
+ const backend = detectBackend({ platform, seam: input.ctx.subprocess as never });
168
+ const spawner = backend === undefined ? undefined : createUiSpawner({ platform, seam: input.ctx.subprocess as never });
169
+ const registry = new UiTerminalRegistry({
170
+ maxPerSession: MAX_PER_SESSION,
171
+ maxTotal: MAX_TOTAL,
172
+ idleGraceMs: IDLE_GRACE_MS,
173
+ scrollback: SCROLLBACK_BYTES,
174
+ spawn: async (spec) => {
175
+ if (spawner === undefined) throw new Error("no PTY backend on this host");
176
+ return await spawner.spawn(spec);
177
+ },
178
+ });
179
+
180
+ let unavailable = "not-installed";
181
+ let routes: { dispose(): void; socket: string } | undefined;
182
+ const isLoopback = (request: { socket?: { remoteAddress?: string } }): boolean => {
183
+ const addr = request.socket?.remoteAddress ?? "";
184
+ return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
185
+ };
186
+ const cwdFor = (sessionId: string): string => {
187
+ const sessions = (input.ctx.get?.("sessions") ?? undefined) as SessionsLike | undefined;
188
+ return sessions?.get?.(sessionId)?.header?.cwd ?? process.cwd();
189
+ };
190
+
191
+ // webServer arrives only through injection; until then the routes report their
192
+ // absence rather than pretending a terminal is available.
193
+ input.ctx.inject?.(["webServer", "settings"], (svcCtx) => {
194
+ // Classified the moment the settings service arrives: the browser cannot tell which
195
+ // generation it is talking to, and the answer decides whether it paints its own
196
+ // floating panel or stays out of the way.
197
+ reportSettingsSurface(svcCtx.settings as never);
198
+ routes = registerUiTerminalRoutes(svcCtx.webServer as Parameters<typeof registerUiTerminalRoutes>[0], {
199
+ catalog: () => catalog.catalog(),
200
+ paths: () => input.paths,
201
+ env: (id) => catalog.env(id),
202
+ enabled,
203
+ shimOfficialTerminal,
204
+ settingsSurface,
205
+ configuredShell: input.configuredShell,
206
+ switches,
207
+ wslDistro,
208
+ writeConfig: async (path, value) => {
209
+ await input.persist(svcCtx.settings, path, value);
210
+ // Remember it for this process too (the ≤0.1.6 hot-reload gap above).
211
+ overrides.set(path.join("."), value);
212
+ // A write also forgets the cached catalog and the WSL answer, so the
213
+ // settings row never reports a stale result immediately after a click.
214
+ distros = undefined;
215
+ catalog.invalidate();
216
+ },
217
+ registry,
218
+ cwdFor,
219
+ unavailableReason: () => unavailable,
220
+ isLoopback,
221
+ });
222
+ unavailable = backend === undefined ? "no-pty-backend" : routes.socket === "mounted" ? "ok" : routes.socket;
223
+ input.ctx.logger?.info?.(`dsh-bash-terminal-ts: browser terminal routes ${unavailable} (backend=${backend ?? "none"}, priority=${SHELL_PRIORITY.join(">")})`);
224
+ svcCtx.effect(() => () => {
225
+ routes?.dispose();
226
+ void registry.dispose();
227
+ }, "bash-terminal: browser terminal routes");
228
+ });
229
+
230
+ return {
231
+ unavailable: () => unavailable,
232
+ dispose: () => {
233
+ routes?.dispose();
234
+ void registry.dispose();
235
+ },
236
+ };
237
+ }