dsh-bash-terminal-ts 0.9.0 → 0.9.2

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 (70) hide show
  1. package/CHANGELOG.md +205 -201
  2. package/CHANGELOG.pt.md +151 -0
  3. package/README.de.md +206 -206
  4. package/README.en.md +212 -212
  5. package/README.es.md +206 -206
  6. package/README.fr.md +206 -206
  7. package/README.it.md +206 -206
  8. package/README.md +423 -423
  9. package/README.pt.md +212 -0
  10. package/README.ru.md +206 -206
  11. package/agent-presets/README.md +171 -171
  12. package/agent-presets/install-presets.mjs +180 -180
  13. package/agent-presets/standard-win/agent.cordis.yml +271 -271
  14. package/agent-presets/standard-win/preset.yml +2 -2
  15. package/agent-presets/standard-win-gitbash/agent.cordis.yml +271 -271
  16. package/agent-presets/standard-win-gitbash/preset.yml +2 -2
  17. package/agent-presets/standard-win-msys2/agent.cordis.yml +272 -272
  18. package/agent-presets/standard-win-msys2/preset.yml +2 -2
  19. package/agent-presets/standard-win-niu/agent.cordis.yml +270 -270
  20. package/agent-presets/standard-win-niu/preset.yml +2 -2
  21. package/agent-presets/standard-win-payload/agent.cordis.yml +271 -271
  22. package/agent-presets/standard-win-payload/preset.yml +2 -2
  23. package/agent-presets/standard-win-wsl2/agent.cordis.yml +271 -271
  24. package/agent-presets/standard-win-wsl2/preset.yml +2 -2
  25. package/cordis.patch.yml +72 -84
  26. package/dist/client.core.js +54 -16
  27. package/dist/client.js +54 -16
  28. package/docs/niu-backend.md +197 -197
  29. package/dsh.plugin.json +23 -22
  30. package/lib/client.js +54 -16
  31. package/lib/dsh-types.d.ts +0 -2
  32. package/lib/index.d.ts +2 -23
  33. package/lib/index.js +4 -34
  34. package/lib/locales.js +49 -11
  35. package/lib/payload.d.ts +72 -72
  36. package/lib/payload.js +279 -279
  37. package/lib/shell-id.d.ts +2 -2
  38. package/lib/shells.d.ts +2 -11
  39. package/lib/shells.js +4 -14
  40. package/lib/terminal.js +0 -1
  41. package/lib/webterminals/catalog.d.ts +0 -2
  42. package/lib/webterminals/catalog.js +0 -1
  43. package/lib/webterminals/mount.d.ts +0 -5
  44. package/lib/webterminals/mount.js +0 -4
  45. package/locale/de.json +5 -5
  46. package/locale/en.json +5 -5
  47. package/locale/es.json +5 -5
  48. package/locale/fr.json +5 -5
  49. package/locale/it.json +5 -5
  50. package/locale/ja.json +5 -5
  51. package/locale/ko.json +5 -5
  52. package/locale/pt.json +6 -0
  53. package/locale/ru.json +5 -5
  54. package/locale/zh.json +5 -5
  55. package/package.json +3 -5
  56. package/scripts/check-artifacts.mjs +96 -96
  57. package/scripts/link-shells.mjs +0 -21
  58. package/src/client.tsx +685 -685
  59. package/src/dsh-types.ts +330 -332
  60. package/src/index.ts +1267 -1316
  61. package/src/locales.ts +499 -461
  62. package/src/shell-id.ts +11 -11
  63. package/src/shells.ts +263 -279
  64. package/src/terminal.ts +615 -616
  65. package/src/webterminals/catalog.ts +0 -3
  66. package/src/webterminals/host.ts +361 -361
  67. package/src/webterminals/mount.ts +228 -237
  68. package/scripts/payload-alias.mjs +0 -97
  69. package/scripts/provision-payload.mjs +0 -233
  70. package/src/payload.ts +0 -322
@@ -0,0 +1,151 @@
1
+ # Changelog
2
+
3
+ ## 0.7.0 (2026-09-29)
4
+
5
+ - **Linha de compatibilidade DSH 0.2.0** (branch `compat/0.2.0`, dist-tag npm `dsh-0.2.0`): os 11 ranges peer `@deepseek-ai/dsh-*` passam em bloco para `>=0.2.0-rc.1 <0.2.1-0` (a linha 0.1.7 fica congelada em `compat/0.1.7` seguindo para servir os hosts antigos, sem ser afetada). O 0.2.0-rc.1 é totalmente compatível com a API de plugins da 0.1.7; esta linha não muda nada de código, é uma adaptação puramente de metadados.
6
+ - **Atualização sincronizada de devDependencies**: os 15 pacotes `dsh-*` fixados com precisão em `0.1.7-rc.2` (11 homônimos dos peer + scope / subprocess / sandbox-policy / http-proxy) → `0.2.0-rc.1`, de modo que o build/test de um checkout limpo continue representativo frente a um host 0.2.0.
7
+ - **Lockfile no repositório**: este branch remove do `.gitignore` a linha que ignorava `package-lock.json`; o lockfile atualizado após a atualização da árvore de dependências é enviado junto (a linha 0.1.7 mantém o ignore atual).
8
+ - **Metadados de publicação**: versão 0.6.4 → 0.7.0; `publishConfig.tag` `dsh-0.1.7` → `dsh-0.2.0`; `version` e `engines.dsh` do `dsh.plugin.json` atualizados em conformidade.
9
+ - **Reordenação da matriz de compatibilidade do README** (bilíngue zh/en): adicionadas as linhas 0.1.7 e 0.2.0, corrigida a narrativa desatualizada de «nomes de pacote distintos» (as linhas agora compartilham o nome de pacote `dsh-bash-terminal-ts` e são distinguíveis por dist-tag); a seção de instalação é atualizada para o duplo critério 0.1.7-rc.1 / 0.2.0-rc.1.
10
+ - **Verificação**: `npm install` / `build` / `test` todos no verde (4 suítes unit / apply / client / terminal), `npm ls` sem conflitos de peer.
11
+
12
+ ## 0.6.4 (2026-09-26)
13
+
14
+ - **Causa raiz da falha de carga corrigida (resíduo da troca de nome do pacote)**: o pacote já havia sido renomeado para `dsh-bash-terminal-ts`, mas o `name` da entrada bundle do `cordis.patch.yml` ainda apontava para o `dsh-bash-terminal` pré-bifurcação. O carregador da 0.1.7 resolve módulos por nome, então a falha era inevitável (`failed to import loader entry (dsh-bash-terminal)`); nem uma fiber era criada, e nem a montagem a quente nem um reinício recuperavam. Agora o `name` da entrada coincide com o nome do pacote e a ativação funciona normalmente sob DSH 0.1.7.
15
+ - **Bifurcação completa do nome do projeto**: o `id` / `name` do `dsh.plugin.json`, o id de registro do cliente, `install.ps1` (caminhos junction, nome do bundle, textos de ajuda), bem como os caminhos e descrições do projeto em README / CONTRIBUTING / documento de compatibilidade passam todos para `dsh-bash-terminal-ts`; ficam inalterados apenas `MAXeaglet/dsh-bash-terminal` (referência ao repositório upstream) e o id da entrada de ferramenta `tool-bash-terminal`. A regex de limpeza do uninstall do `install.ps1` passa a `dsh-bash-terminal(-ts)?`, de modo que os blocos legados do formato antigo continuem removíveis.
16
+ - **Robustez do cliente**: a página de ajustes mostra uma linha «indisponível» (com dicas de diagnóstico) quando o host não fornece a entrada `configForms` deste plugin, em vez de ficar em branco em silêncio.
17
+
18
+ ## 0.3.18 (não publicado)
19
+
20
+ - **Sincronização da linha de compatibilidade DSH 0.1.5** (esta linha mantém `ts/0.1.5`): as mudanças independentes aplicadas à linha 0.1.2 após a bifurcação foram verificadas uma a uma e transferidas para esta linha.
21
+ - **Manifesto padrão concluído**: adicionados `dsh.plugin.json` (`id` / `components` / `engines`) e `screenshots.json`, ambos incluídos na allowlist `files`.
22
+ - **Fechamento de `engines`**: `node` sobe de `>=20` para `>=22` e é adicionado `engines.dsh` = `>=0.1.5-alpha.1 <0.2.0-0` (antes era justamente esta linha que carecia dessa declaração).
23
+ - **Correção da atribuição de identidade do pacote**: `author` / `repository` / `bugs` / `homepage` passam do fork upstream (MAXeaglet/dsh-bash-terminal) para este repositório (drscrewdriver/dsh-bash-terminal-ts).
24
+ - **Typecheck possível em checkout limpo**: as devDependencies são completadas com os pacotes peer do DSH (fixados com exatidão em `0.1.5-rc.2`). Antes da correção, o `tsc` reportava `TS7006` (`revision` / `writable` any implícito em `src/client.tsx`) — os peer só estavam declarados em `peerDependencies` e como opcionais, então o `npm install` não instalava nada. Como o `dsh-shell@0.1.5-rc.1` ainda declara o peer `0.1.2-rc.1`, instalar a árvore exigia `--legacy-peer-deps`.
25
+ - **`react-dom` adicionado como devDependency**: antes o `react` era resolvido a partir deste repositório enquanto o `react-dom/server` caía na cópia aninhada da árvore de instalação do DSH; o `renderToString` recebia duas instâncias React diferentes e o test do cliente falhava com “Objects are not valid as a React child”. Após o complemento, `react` e `react-dom` são ambos 18.3.1 e os testes passam.
26
+ - **Decisão consciente de não renomear**: esta linha mantém o nome de pacote `dsh-bash-terminal-ts` (não segue o `dsh-bash-terminal-ts` da linha 0.1.2), de modo que as duas linhas possam coexistir na instalação sem colidir pela identidade do pacote.
27
+ - **Verificação (testado em local)**: `npm run build` exit 0; `test-dist/{unit,apply,client}.js` exit 0 cada; `test-dist/terminal.js` executado à parte exit 0 (3/3 superados). O smoke MSYS2 do `unit` **roda de verdade** e extrai `MSYSTEM=MINGW64`, `/mingw64/bin/gcc`, `/usr/bin/bash`: a semântica de ambiente MSYS2, razão de ser desta linha, fica confirmada de ponta a ponta.
28
+ - **Falha ambiental conhecida (não introduzida por esta linha)**: o 4.º segmento do `npm test` encadeado (`terminal.js`) reporta `AttachConsole failed` em console não interativa (sem Console ao qual se prender); na baseline sem modificações reproduz-se igual.
29
+
30
+ ## 0.3.17 (2026-09-13)
31
+
32
+ - **MSYS2 se torna o 4.º backend de terminal** (ordem de `SHELLS`: powershell / gitbash / msys2 / wsl). `Config` adiciona `msys2Path`, cabeado via `resolveAllPaths`; `SHELL_DESCRIPTIONS.msys2` e `toolDescription` completados com a descrição do backend.
33
+ - **Ajuste de MSYS2 concluído (cliente)**: a linha «Terminal padrão» da UI web antes oferecia apenas powershell / gitbash / wsl — o backend MSYS2 existia, mas o frontend não permitia escolhê-lo. `src/client.tsx` adiciona a opção `msys2` e os textos bilíngues de `shell.msys2` (MSYS2 é nome próprio, idêntico em chinês e inglês).
34
+ - **Correção do stdio por pipe no MSYS2**: `C:\msys64\msys2.exe` é um lançador Cygwin que aloca console; com stdio por pipe ele retorna exit 0 e zero bytes (stdout/stderr em 0 bytes, medido com MSYS2 bash 5.3.15), então qualquer comando MSYS2 ficava mudo, sem saída. A ordem de candidatos passa a ser: primeiro `C:\msys64\usr\bin\bash.exe` → `bin\bash.exe` → entradas mingw64/msys64 do PATH, com `msys2.exe` rebaixado a rede de segurança no fim da lista.
35
+ - **Login shell do MSYS2**: o `buildArgv` usa `-lc` em vez de `-c`; somente o login shell faz source do `/etc/profile`, adicionando `/usr/bin` e `/mingw64/bin` ao PATH (com um `-c` pelado, `bash` resolve para `C:\Windows\System32\bash.exe`, e `gcc`/`make` dão ambos command not found).
36
+ - **Ambiente MSYS2**: o `buildEnv` injeta `MSYSTEM=MINGW64` (o valor explicitamente passado pelo usuário tem prioridade) para que o gcc e o make de `/mingw64/bin` entrem no PATH; o env das sessões interativas da ferramenta `terminal` fica alinhado a esse comportamento.
37
+ - **Sandbox do MSYS2**: como o Git Bash, sem envasamento (o runner de token restrito com ACL do Windows é incompatível com Cygwin/MSYS2); o resultado informa `enforcement: msys2-unconfined`.
38
+ - **O env do terminal interativo passa pelo `buildEnv`**: o `src/terminal.ts` antes montava seu próprio env, contornando a injeção de MSYSTEM do `buildEnv` — resultado: a ferramenta `shell` funcionava, mas o **terminal interativo** msys2 não tinha `/mingw64/bin` (`/etc/profile` configurava o PATH para o ambiente MSYS padrão). Agora: `buildEnv(shell, ctx.shellEnv.collect(exec), process.env.WSLENV)` — obtém a injeção de MSYSTEM e não duplica mais a lógica de WSLENV. O terceiro parâmetro precisa ser passado explicitamente: o `spawnTerminal` substitui por completo o ambiente do processo filho via `childEnv(spec.env)`, de modo que o WSLENV do ambiente continuaria invisível.
39
+ - **WSL `WSLENV`: acumular em vez de reconstruir**: o WSLENV é a allowlist transfronteiriça do WSL; o código antigo a reconstruía apenas a partir do `dshEnv`, perdendo as entradas já presentes no ambiente (em local `WSLENV=WT_SESSION:WT_PROFILE_ID:`, exportado pelo Windows Terminal), que deixariam de entrar no WSL. Agora se acumula sobre os valores herdados: dividir por `:` e filtrar as entradas vazias (o valor herdado termina em `:`, a mera concatenação de strings produziria entradas vazias), excluir a própria chave `WSLENV` (também é uma chave do `dshEnv`, adicioná-la produziria `...:WSLENV`); o WSLENV que o chamador passa explicitamente tem prioridade sobre os herdado.
40
+ - **Terminal interativo**: o `terminalArgv("msys2")` usa `-l`. Não dá para manter `-lc`: aquele argv não leva comando (o PTY é em si a sessão), e um `bash -lc` sem operandos sai imediatamente com `-c: option requires an argument` (exit 2).
41
+ - **Bundle do cliente reproduzível**: o `scripts/build-client.mjs` antes deixava o esbuild procurar o tsconfig subindo desde `src/client.tsx`; um build dentro do repositório achava o `tsconfig.json` raiz e emitia uma linha `"use strict";` a mais, o que um build de worktree fora do repositório não fazia — o mesmo código-fonte produzia dois artefatos commitados diferentes. Agora fixa explicitamente `tsconfigRaw: { compilerOptions: { target: "ES2022", useDefineForClassFields: true } }` (ou seja, os valores de fato vigentes do tsconfig raiz); a única diferença observável é o desaparecimento daquela linha `"use strict";`.
42
+ - **Proteção contra regressões**: o `test/unit.ts` confere o argv `-lc` do msys2, a injeção de `MSYSTEM` com prioridade do valor do usuário, que `bash.exe` deva vir antes de `msys2.exe` e a semântica de acumulação do `WSLENV` (as entradas herdadas são preservadas / não há entradas vazias / `WSLENV` em si não é adicionado / o valor explícito vence), mais uma checagem smoke de spawn real (stdout não vazio e com `/mingw64/bin/gcc`; 0 bytes = falha); o `test/apply.ts` confere o argv/env do msys2, o `msys2-unconfined` e a estrutura do WSLENV; o `test/terminal.ts` confere o argv interativo e o cabeamento do PTY env via `buildEnv`, e abre uma **sessão msys2 real com node-pty** (checagens de `MSYSTEM=MINGW64`, `/mingw64/bin/gcc`, `BASH=/usr/bin/bash`); o `test/client.ts` ganha um guardião anti-deriva — para cada `SHELLS` do host confere se a lista do bundle do cliente e as entradas de menu renderizadas coincidem (ordem incluída) e se tanto o dicionário chinês quanto o inglês têm `shell.<id>`. Cada um desses guardiões foi contrastado no sentido inverso (quebrar o artefato de build → a checagem falha → no verde após restaurar).
43
+ ## 0.3.16 (2026-09-12)
44
+
45
+ - **Reescrita TypeScript integral**. Lado servidor `lib/index.js` / `lib/terminal.js` → `src/index.ts` / `src/terminal.ts`; cliente `src/client.jsx` → `src/client.tsx`; testes `test/*.mjs` → `test/*.ts` (compilados para `test-dist/` e executados de lá). `tsc --strict` + `noUncheckedIndexedAccess` tudo no verde.
46
+ - Os contratos do plugin para as costuras do DSH são reduzidos a tipos estruturais escritos à mão (`src/dsh-types.ts`); os imports de valor dos pacotes peer passam todos pela ponte de estreitamento `src/dsh.ts`, a deriva de versões dos peer não vaza mais no código reescrito.
47
+ - Cadeia de build: `npm run build` = `tsc` (servidor → `lib/`) + `tsc -p tsconfig.client.json` (checagem de tipos do cliente) + esbuild (`src/client.tsx` → `lib/client.js` + `dist/client.js`) + `tsc -p tsconfig.test.json`. Os artefatos `lib/` e `dist/` continuam enviados ao repositório, e o caminho de carga `lib/index.js` por parte do DSH não muda.
48
+ - Superfície de exportação preservada à risca (`name` / `inject` / `Config` / `apply` / `SHELLS` / `DEFAULT_SHELL` / `SETTINGS_NAMESPACE` / `internals`), comportamento em execução idêntico ao da 0.3.15; apenas foram removidas uma função morta `pathResolve` inalcançável no fim de terminal.js e o import sem uso `MAX_TIMER_DELAY_MS`.
49
+
50
+ ## 0.3.15 (2026-09-11)
51
+
52
+ - **Adaptação ao DSH 0.1.5-rc.1**. A tabela de módulos do cliente (`PLATFORM_MODULES`) renomeia `@deepseek-ai/dsh-client-runtime` para `@deepseek-ai/dsh-client-store` e só captura por **nome pelado exato** (sem subrota `/client`, sem reserva à fábrica do pacote). O bundle do cliente antes fazia `require("@deepseek-ai/dsh-client-runtime/client")`, sob 0.1.5 uma falha garantida → a GUI web caía no boot com `Failed to load plugins / require(...) missed the module table`. Agora usa `@deepseek-ai/dsh-client-store`, e os 4 require do bundle (`react`, `react/jsx-runtime`, `dsh-client-store`, `dsh-client-ui-primitives`) caem todos dentro da tabela-semente da plataforma, sem necessidade de `dsh.client.external`.
53
+ - O `dsh.client.inject` é atualizado com os nomes reais dos pacotes de cliente existentes na 0.1.5 (`dsh-client-locale`, `dsh-client-ui-settings`, `dsh-api-remotes`).
54
+ - A costura de settings do servidor não exporta mais `settingsNamespace()` (desde 0.1.5, `register(ns: string, schema, { base })` recebe direto a string de namespace); o invólucro foi retirado em conformidade e o código vale para as duas gerações de API, 0.1.0/0.1.5.
55
+ - `peerDependencies` alinhadas com `^0.1.5-rc.1` (`dsh-sandbox` adicionado, realmente dependido; `cordis` sobe para `^4.0.2`); o test do cliente ganha uma asserção anti-regressão: o bundle não deve voltar a conter `dsh-client-runtime`.
56
+ - O patch da allowlist de settings do `install.ps1` ganha uma sonda de existência: o 0.1.5 não tem mais allowlist codificada à mão, o script não reescreve mais o arquivo do host por substituições sem casamento (o único efeito era adicionar-lhe um BOM).
57
+ - O Git Bash deixa de ser envasado via `ctx.sandbox.confine`: o runner de token restrito com ACL do Windows do DSH é incompatível com Cygwin/MSYS2 (o bash aborta no boot com o erro Win32 5 de `CreateFileMapping`); agora o Git Bash também corre sem envasamento em modo restrito, e o resultado informa `enforcement: gitbash-unconfined`. Corrige #6.
58
+
59
+ ## 0.3.14 (2026-08-14)
60
+
61
+ - A linha de ajustes reflete agora exatamente a EnterBehaviorRow incluída: disposição da linha (título + descrição terciária à esquerda, seletor de cápsula à direita), disparador de cápsula de 36px (`--dsw-alias-bg-module-platform`, radius 18px, estado hover) com chevron, Menu em portal com `align="end"`. CSS injetado da mesma forma que as linhas de primeira parte.
62
+ - A frase descritiva «(由你决定,AI 无法更改)» foi removida.
63
+
64
+ ## 0.3.13 (2026-08-14)
65
+
66
+ - A linha de ajustes segue a gramática das linhas da seção Geral incluída (empilhamento em coluna, filete inferior de 1px via `--dsw-alias-border-l2`, padding vertical de 16px, título de 14px/400) — coincide com a disposição da linha Appearance.
67
+
68
+ ## 0.3.12 (2026-08-14)
69
+
70
+ - **UI nativa orientada ao usuário**: a linha «Terminal padrão» de Configurações → Geral agora é renderizada com primitivas nativas do DSH (`Menu` + `Button` + `IconCodeOutline16`) em lugar de um simples `<select>` HTML — tem exatamente a mesma aparência e comportamento de um ajuste de primeira parte. O test do cliente renderiza a linha via React real (renderToString) com primitivas simuladas.
71
+
72
+ ## 0.3.11 (2026-08-14)
73
+
74
+ - Ferramenta `terminal`: o WSL interativo sobre a distribuição padrão agora usa `wsl -- bash -i` (o `-e` pelado falha sob ConPTY com o erro RPC 0x8007072c do serviço WSL); um `-d <distro>` explícito mantém `-e`. Verificado: pwd → /mnt/d/WorkSpace.
75
+ - Correções de CI: a asserção do argv do wsl usa SystemRoot (sem diferenciar maiúsculas); os testes client/terminal resolvem react + node-pty entre ambientes (a CI os instala no-save); o test interativo de wsl tolera ambientes sem distribuição.
76
+
77
+ ## 0.3.10 (2026-08-14)
78
+
79
+ - O install.ps1 migra o perfil para a instalação por bundle oficial (adiciona `dsh-bash-terminal-ts` ao `dsh.profile.bundles` e remove a inserção manual legada), escrevendo o package.json sem BOM UTF-8 (o BOM do `Set-Content` do PS 5.1 quebrava o JSON.parse do DSH). Perfil web atual verificado: o bundle fornece a entrada `tool-bash-terminal` via `--dump-config`.
80
+
81
+ ## 0.3.9 (2026-08-14)
82
+
83
+ - **Manifesto de bundle oficial**: o pacote agora declara `dsh.bundle.patch` (traz seu próprio `cordis.patch.yml`); um perfil que liste `dsh-bash-terminal-ts` em `dsh.profile.bundles` aplica a montagem automaticamente — verificado com um perfil temporário + `--dump-config` (a entrada aparece sem nenhum patch manual do perfil).
84
+
85
+ ## 0.3.8 (2026-08-14)
86
+
87
+ - Cobertura de testes: a execução em segundo plano do `shell` registra um job com hooks `cancel` / `done` / `readOutput` funcionais (13 casos apply/execute no total).
88
+
89
+ ## 0.3.7 (2026-08-14)
90
+
91
+ - Ferramenta `terminal`: as leituras agora esperam a saída assentar (300 ms de silêncio, teto de 5 s) em vez de um retardo fixo, de modo que o `send` devolve a resposta COMPLETA (verificado: saída multilinha completa, p. ex. `seq 1 8`).
92
+
93
+ ## 0.3.6 (2026-08-14)
94
+
95
+ - Cobertura de testes: a abertura do `terminal` com comando inicial (execução imediata em um shell novo) e a forma dos hooks do job (cancel / done / readOutput) verificadas contra uma sessão real de node-pty.
96
+
97
+ ## 0.3.5 (2026-08-14)
98
+
99
+ - Ferramenta `terminal`: o estouro do buffer é reportado (flag `truncated` + aviso “[terminal buffer overflowed; oldest output dropped]”) para que uma sessão muito ativa nunca perca o histórico em silêncio.
100
+
101
+ ## 0.3.4 (2026-08-14)
102
+
103
+ - Ferramenta `terminal`: as sessões WSL agora levam as variáveis de ambiente DSH_* via WSLENV, em sintonia com a ferramenta `shell`.
104
+
105
+ ## 0.3.3 (2026-08-14)
106
+
107
+ - Ferramenta `terminal`: a nova ação `list` enumera as sessões ativas (sessionId / shell / pid) para a gestão multissessão.
108
+
109
+ ## 0.3.2 (2026-08-14)
110
+
111
+ - Teto de sessões: no máximo 8 sessões de terminal simultâneas (além disso: falha rápida).
112
+ - Verificação interativa multi-backend: Git Bash (completo), limites ConPTY documentados do PowerShell 5.1 e do wsl.exe (0x8009001d / 0x8007072c; pwsh 7 e os comandos de tiro único -lc funcionam).
113
+ - README (zh/en): limitações conhecidas do terminal interativo.
114
+
115
+ ## 0.3.1 (2026-08-14)
116
+
117
+ - As sessões de terminal são registradas no registro genérico de jobs (jobId na abertura; `job_kill` / `job_output` funcionam sobre elas).
118
+ - Tempo de espera por ociosidade: as sessões se fecham sozinhas após 10 minutos sem send/read/signal (configurável via `idleMs` na abertura) para que PTYs abandonados nunca deixem árvores de processos escapando.
119
+
120
+ ## 0.3.0 (2026-08-14)
121
+
122
+ - **Ferramenta de terminal interativo (`terminal`)**: sessões PTY persistentes sobre a costura oficial `ctx.subprocess.spawnTerminal` (node-pty). Ações: `open` / `send` / `read` / `signal` (Ctrl+C etc.) / `close`. O estado do shell (cwd, variáveis, aliases) persiste entre chamadas; o backend segue o ajuste do terminal padrão do usuário. Verificado com uma sessão interativa real de Git Bash via node-pty (cd + pwd + echo + SIGINT + close).
123
+
124
+ ## 0.2.3 (2026-08-14)
125
+
126
+ - Cobertura de testes fail-closed (um backend de sandbox indisponível recusa a chamada).
127
+ - Documentação da sandbox no README.
128
+ - CI com GitHub Actions (suítes unit / apply / client em windows-latest).
129
+
130
+ ## 0.2.2 (2026-08-14)
131
+
132
+ - **Renderização oficial das recusas**: uma chamada envasada cujo stderr casa com as assinaturas de recusa do runner informa `sandbox.denied: true`, e a saída orientada ao modelo leva os marcadores oficiais exatos — `[sandbox: file access denied under <mode> mode]` mais a dica de escalada do mesmo turno.
133
+
134
+ ## 0.2.1 (2026-08-14)
135
+
136
+ - **Superfície oficial de escalada da sandbox**: a ferramenta `shell` agora anuncia `sandbox_permissions` / `justification` (o contrato exato de tool-bash / tool-pwsh): uma chamada recusada pode ser tentada de novo uma vez com o modo mais amplo mais estreito possível, roteada via `ctx.approval` (`approveEscalation`), com validação estrita de alargamento.
137
+
138
+ ## 0.2.0 (2026-08-14)
139
+
140
+ - **Integração da sandbox (costura oficial)**: a ferramenta `shell` resolve a política de sandbox do DSH em cada chamada (`ctx.sandboxPolicy`) e envasa o argv de PowerShell / Git Bash através de `ctx.sandbox` — a mesma semântica fail-closed `SandboxUnavailableError` dos executores incluídos. O WSL corre sem envasar (o isolamento por VM Linux dele É a sandbox). Os dados da sandbox (`sandbox.mode` / `sandbox.enforcement`) viajam nos resultados de primeiro plano.
141
+ - **Preferência do modelo**: a seção do system prompt do plugin indica aos agentes que prefiram a ferramenta `shell` ao `pwsh` para comandos de terminal; a descrição da ferramenta encabeça com o terminal padrão escolhido pelo usuário.
142
+
143
+ ## 0.1.0 (2026-08-14)
144
+
145
+ Lançamento inicial.
146
+
147
+ - Ferramenta `shell`: executar comandos através de PowerShell / Git Bash / WSL no Windows.
148
+ - O terminal padrão é escolhido pelo usuário nos ajustes da UI web (Configurações → Geral → Terminal padrão); o modelo não pode sobrescrevê-lo.
149
+ - Execução em segundo plano pelo registro genérico de jobs (`run_in_background` / `job_output` / `job_kill`).
150
+ - O plugin cliente registra a linha de ajustes; o plugin host lê o ajuste do usuário em cada chamada.
151
+ - install.ps1: instalação junction, montagem cordis.patch.yml e patch automático da allowlist de settings dsh-host-apiproxy (limitação do DSH; ver README).
package/README.de.md CHANGED
@@ -1,206 +1,206 @@
1
- # dsh-bash-terminal-ts
2
-
3
- > 🌐 [简体中文](README.md) | [English](README.en.md) | [Français](README.fr.md) | [Deutsch](README.de.md) | [Italiano](README.it.md) | [Русский](README.ru.md) | [Español](README.es.md) · Community: [LINUX DO](https://linux.do) · [GitHub](https://github.com/drscrewdriver/dsh-bash-terminal-ts)
4
-
5
- ![test](https://github.com/drscrewdriver/dsh-bash-terminal-ts/actions/workflows/test.yml/badge.svg)
6
-
7
- DSH-Plugin (DeepSeek Harness): ein `shell`-Werkzeug, das unter Windows die Befehle **vierer** Terminals – **PowerShell / Git Bash / MSYS2 / WSL** – einheitlich ausführt.
8
-
9
- > **Dieses Repository ist die TypeScript-Neuschreibung von `MAXeaglet/dsh-bash-terminal`** mit funktionsfähiger MSYS2/MINGW64-Unterstützung. Die Kompatibilitätslinien werden pro DSH-Host-Segment geschnitten; alle Linien teilen sich den Paketnamen `dsh-bash-terminal-ts` und werden über npm-dist-tags unterschieden:
10
- >
11
- > | DSH-Segment | Branch | Plugin-Version | npm-dist-tag |
12
- > |--------|------|----------|--------------|
13
- > | `>=0.1.0-rc.2 <0.3.0-0` (begrenzte Spanne) | `main` (dieser Branch, versionsübergreifender Hauptzweig) | 0.8.x | `latest` |
14
- > | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (historisch, eingefroren) | 0.7.x | `dsh-0.2.0` |
15
- > | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
16
- > | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (historisch, eingefroren) | ≤ 0.5.2 | `dsh-0.1.5` |
17
- > | 0.1.2-alpha.1 – 0.1.2-rc.x | frühe `main`-Commits (pro Tag eingefroren) | ≤ 0.4.2 | `dsh-0.1.2` |
18
- >
19
- > Wählen Sie die Linie passend zu Ihrer DSH-Version; die Versionsserien überlappen nicht, daher kann eine `^`-Installation nie über Linien hinweg auflösen.
20
-
21
- | Backend | Tatsächliche Ausführung | Syntax / Pfade | Umgebungsvariablen |
22
- |------|----------|-------------|----------|
23
- | `powershell` (Standard) | `pwsh -NoLogo -NoProfile -NonInteractive -Command <cmd>` | PowerShell; `C:\...` | `$env:NAME` |
24
- | `gitbash` | `bash -lc <cmd>` aus Git for Windows | POSIX; `/d/workspace`; PATH enthält `/usr/bin` und `/mingw64/bin` | `$NAME` |
25
- | `msys2` | MSYS2 `bash -lc <cmd>` (`C:\msys64\usr\bin\bash.exe`) | POSIX; `/c/...`; PATH enthält `/usr/bin` und `/mingw64/bin` (gcc / make) | `$NAME` (`MSYSTEM=MINGW64` wird automatisch injiziert) |
26
- | `wsl` | `wsl [-d <distro>] -e bash -lc <cmd>` | Linux; `/mnt/d/...` | `$NAME` (über WSLENV) |
27
-
28
- Jeder Aufruf startet eine komplett neue Shell: **Es wird kein Zustand bewahrt** (cwd / Variablen / Aliasse) – übergeben Sie `workdir`, statt `cd` zu verwenden.
29
-
30
- ## Vorschau der Oberfläche
31
-
32
- Die Zeile „Standardterminal" in Einstellungen → Allgemein: Der Nutzer wählt zwischen PowerShell / Git Bash / MSYS2 / WSL, und das `shell`-Werkzeug führt ausschließlich gemäß dieser Einstellung aus – das Modell kann sie nicht überschreiben:
33
-
34
- ![Zeile für die Standardterminal-Einstellung](assets/shells.png)
35
-
36
- ## Entwurfsprinzipien
37
-
38
- - **Das Terminal bestimmt der Nutzer, die KI kann es nicht ändern**: Die Einstellungsseite der Web-UI (Einstellungen → Allgemein) bietet ein Dropdown „Standardterminal" (PowerShell / Git Bash / MSYS2 / WSL); das `shell`-Werkzeug folgt stets ausschließlich dieser Einstellung und legt dem Modell keine Terminal-Parameter offen. Die Einstellung wird über das DSH-Settings-System persistiert (settings.yaml).
39
- - **Belegt die Fähigkeitsschnittstelle `ctx.shell` nicht**: Das sandboxierte `pwsh`-Werkzeug von DSH bleibt unverändert nutzbar; das `shell`-Werkzeug dieses Plugins ist ein **zusätzlicher** Multi-Terminal-Einstiegspunkt.
40
- - Prozesse werden über die gemeinsame `ctx.subprocess`-Naht erzeugt: Beendigung des Prozessbaums (unter Windows `taskkill /T`), SIGTERM → Gnistenfrist → SIGKILL, Ausgabe-Spill-Dateien – Verhalten identisch zu den offiziellen Werkzeugen `dsh-tool-bash` / `dsh-tool-pwsh`.
41
- - Hintergrundaufgaben werden im generischen `jobs`-Registry registriert, mit Unterstützung für `run_in_background` / `job_output` / `job_kill`.
42
- - Die Zeile „Standardterminal" der Frontend-Einstellungsseite ist eine Enumeration (von der UI automatisch als Dropdown gerendert); das Modell führt bei jedem Aufruf gemäß dieser Einstellung aus und kann das Terminal nicht eigenmächtig wechseln.
43
-
44
- ## Installation (Web-Profil)
45
-
46
- ### Standardinstallation (nach der npm-Veröffentlichung, offizieller Bundle-Mechanismus)
47
-
48
- Das Plugin bringt das offizielle `dsh.bundle`-Manifest mit (eigene `cordis.patch.yml` im Paket); sobald ein Profil dieses Paket aufführt, **wendet DSH den Mount automatisch an** – eine manuelle Anpassung der Profil-Konfiguration ist nicht nötig:
49
-
50
- ```powershell
51
- # 1. Plugin-Paket installieren
52
- npm install -g dsh-bash-terminal-ts
53
- dsh plugin --profile web add dsh-bash-terminal-ts # automatisch in die Profile-Bundles aufnehmen und Patch anwenden
54
-
55
- # 2. Settings-Allowlist von DSH patchen (DSH-Einschränkung, siehe Erläuterung unten)
56
- powershell -ExecutionPolicy Bypass -File install.ps1 install
57
-
58
- # 3. dsh web neu starten
59
- ```
60
-
61
- > Mit einem temporären Profil praktisch erprobt: `bundles: [dsh-bash-terminal-ts]` → der Eintrag `tool-bash-terminal` erscheint automatisch im dump-config.
62
-
63
- ### Installation für die lokale Entwicklung (Junction, Quellcode-Änderungen wirken sofort)
64
-
65
- ```powershell
66
- # 1. Plugin-Paket in die node_modules des Profils linken (Junction, Quellcode-Änderungen wirken sofort)
67
- $profile = "$env:USERPROFILE\.dsh\profiles\web"
68
- New-Item -ItemType Junction -Path "$profile\node_modules\dsh-bash-terminal-ts" -Target "D:\workspace\projects\dsh-bash-terminal-ts" | Out-Null
69
-
70
- # 2. Dem Plugin die Auflösung der @deepseek-ai/*-Abhängigkeiten ermöglichen (Junction in den Abhängigkeitsbaum des Profils; Plugin und Host teilen sich dieselben Modulinstanzen)
71
- New-Item -ItemType Junction -Path "D:\workspace\projects\dsh-bash-terminal-ts\node_modules\@deepseek-ai" -Target "$profile\..\node_modules\@deepseek-ai" | Out-Null
72
-
73
- # 3. Das Profil das Plugin über das offizielle Bundle mounten lassen (install.ps1 install erledigt das automatisch; entspricht dem Eintrag "dsh-bash-terminal-ts" in dsh.profile.bundles)
74
- # 4. (nur nach Änderungen am Frontend-Quellcode) Client-Bundle neu bauen:
75
- # cd D:\workspace\projects\dsh-bash-terminal-ts && node scripts/build-client.mjs
76
- # 5. dsh web neu starten
77
- ```
78
-
79
- > ⚠️ **Führen Sie in diesem Projekt kein `npm install` aus**: Es würde die Junction aus Schritt 2 oben löschen und stattdessen eine **eigenständige** Kopie von
80
- > `@deepseek-ai/*` für das Plugin installieren – Plugin und Host teilten sich dann keine Modulinstanzen mehr, und nach einem Host-Upgrade bliebe das Plugin auf der alten API hängen
81
- > (dieses Projekt hing dadurch einmal auf 0.1.0-rc.6 fest). Nur zum Aktualisieren des Locks `npm install --package-lock-only` verwenden.
82
-
83
- > **Kompatibilität**: Erfordert DSH ≥ **0.1.7-rc.1** (Linie `compat/0.1.7`) oder ≥ **0.2.0-rc.1** (Linie `compat/0.2.0`, dieser Branch).
84
- > Historischer Hintergrund: In 0.1.5 wurde `@deepseek-ai/dsh-client-runtime` in der Client-Modultabelle in `@deepseek-ai/dsh-client-store` umbenannt und wird nur über exakte Treffer des nackten Namens aufgelöst; alte Bundles schlagen auf dem neuen Host fehl mit
85
- > `Failed to load plugins` / `require(...) missed the module table`.
86
- >
87
- > Hinweis: Seit 0.1.5 nutzt die Web-Settings-Oberfläche die dynamische Enumeration `settings.describe()` und hat **keine Namespace-Allowlist mehr**
88
- > (`settings-not-exposed` existiert nicht mehr); der Allowlist-Patch in `install.ps1` ist nur noch ein historisches Überbleibsel und kann ignoriert werden.
89
-
90
- > Eine manuelle Anpassung der `cordis.patch.yml` des Profils ist nicht mehr erforderlich: Das Plugin-Paket bringt sein eigenes `dsh.bundle.patch` mit (`cordis.patch.yml` im Paket); sobald `dsh-bash-terminal-ts` im `dsh.profile.bundles` des Profils steht, mountet DSH das Plugin automatisch.
91
-
92
- Kombinierten Baum verifizieren (ohne Neustart):
93
-
94
- ```powershell
95
- node "$env:APPDATA\nvm\<node-version>\node_modules\@deepseek-ai\dsh\lib\bin.js" --profile web --dump-config | Select-String dsh-bash-terminal-ts
96
- ```
97
-
98
- ## Verwendung
99
-
100
- **Der Nutzer wählt das Standardterminal in der Web-UI**: Einstellungen (Zahnrad) öffnen → Allgemein → Dropdown „Standardterminal" und eines der Terminals PowerShell / Git Bash / MSYS2 / WSL wählen. Änderungen wirken sofort und werden persistiert.
101
-
102
- Sobald das Modell das `shell`-Werkzeug sieht, verwendet es automatisch das von Ihnen gewählte Terminal (das Werkzeug legt keinen Terminal-Parameter offen; das Modell kann Ihre Wahl nicht ändern):
103
-
104
- - Standardterminal = Git Bash: `shell(command: "git status")` läuft über Git Bash
105
- - Standardterminal = MSYS2: `shell(command: "gcc --version")` läuft über MSYS2 (MINGW64-Umgebung, gcc und make aus `/mingw64/bin` verfügbar)
106
- - Standardterminal = WSL: `shell(command: "ls -la /mnt/d/workspace")` läuft über WSL; mit `distro: "Ubuntu"` lässt sich die Distribution angeben
107
- - Standardterminal = PowerShell: `shell(command: "Get-Process node")` läuft über PowerShell
108
-
109
- ## Beispiele zur Modellnutzung
110
-
111
- - Einmalbefehl (Standardterminal): `shell(command: "git status", description: "Git-Status prüfen")`
112
- - Zustand über Runden hinweg bewahren (interaktiv): `terminal(action: "open")` → `sessionId` notieren → `terminal(action: "send", sessionId, input: "cd /d/project\n")` → `terminal(action: "send", sessionId, input: "npm run dev\n")` → `terminal(action: "close", sessionId)`
113
- - Laufendes Programm unterbrechen: `terminal(action: "signal", sessionId, signal: "SIGINT")`
114
- - Aktive Sitzungen einsehen: `terminal(action: "list")`
115
- - Eskalation nach Sandbox-Ablehnung: `shell(command: ..., sandbox_permissions: "workspace-write", justification: "...")`
116
-
117
- ## Konfiguration
118
-
119
- **Web-UI-Einstellungen** (empfohlen): Einstellungen → Allgemein → „Standardterminal".
120
-
121
- `config` der Plugin-Zeile (überschreibt die Standardwerte und dient als Kompositionsgrundlage der Einstellungen):
122
-
123
- | Schlüssel | Standard | Beschreibung |
124
- |----|------|------|
125
- | `defaultShell` | `powershell` | Backend, sofern die Einstellungen nichts anderes festlegen |
126
- | `timeoutMs` | 120000 | Standard-Timeout |
127
- | `maxTimeoutMs` | 600000 | Obergrenze für das timeoutMs des Aufrufers |
128
- | `pwshPath` | automatische Erkennung | Fester Pfad zu pwsh.exe |
129
- | `gitBashPath` | automatische Erkennung | Fester Pfad zu git bash.exe |
130
- | `msys2Path` | automatische Erkennung (`C:\msys64\usr\bin\bash.exe` bevorzugt, Fallback `msys2.exe`) | Fester Pfad zu MSYS2 bash.exe |
131
- | `wslPath` | automatische Erkennung | Fester Pfad zu wsl.exe |
132
-
133
- ## Veröffentlichung (npm)
134
-
135
- Das npm-Konto hat die 2FA-Verifizierung für Veröffentlichungen aktiviert; ein Einmalcode ist erforderlich:
136
-
137
- ```powershell
138
- cd D:\workspace\projects\dsh-bash-terminal-ts
139
- npm publish --otp <Code> # der Code stammt von Ihrem Authentifikator
140
- ```
141
-
142
- Vor der Veröffentlichung mit `npm pack --dry-run` den Inhalt prüfen und `npm run build` ausführen, um alles neu zu bauen (tsc-Serverkompilierung + Client-Bundle + Testkompilierung).
143
-
144
- ## Deinstallation
145
-
146
- Einfach ausführen:
147
-
148
- ```powershell
149
- powershell -ExecutionPolicy Bypass -File install.ps1 uninstall
150
- ```
151
-
152
- Der Befehl entfernt die Junctions, stellt die Settings-Allowlist wieder her, räumt die veralteten `cordis.patch.yml`-Mount-Blöcke früherer Versionen auf und entfernt `dsh-bash-terminal-ts` aus dem `dsh.profile.bundles`. Anschließend dsh web neu starten.
153
-
154
- Bei manueller Deinstallation ist – neben dem Entfernen von `node_modules\dsh-bash-terminal-ts` – auch daran zu denken, `dsh-bash-terminal-ts` aus dem `dsh.profile.bundles` der Profil-`package.json` zu entfernen.
155
-
156
- ## Interaktives Terminal (Werkzeug `terminal`)
157
-
158
- Das Werkzeug `terminal` stellt **persistente interaktive Sitzungen** über die PTY-Naht bereit (node-pty; unter Windows direkt über node-pty, weil der Process Inspector des upstream `spawnTerminal` nur POSIX unterstützt – `lib/terminal.js` verbindet sich daher direkt mit node-pty; unter Nicht-Windows wird weiterhin das offizielle `ctx.subprocess.spawnTerminal` verwendet):
159
-
160
- - `action: open` startet eine echte Terminal-Sitzung (gemäß Ihrer Standardterminal-Einstellung; bei wsl kann `distro` angegeben werden) und liefert eine `sessionId`
161
- - `action: send` schreibt die Eingabe und liest die neue Ausgabe; `action: read` liest nur, ohne zu schreiben; `action: signal` sendet ein Signal an die Vordergrund-Prozessgruppe (SIGINT = Ctrl+C)
162
- - `action: close` beendet die Sitzung
163
- - **Der Sitzungszustand bleibt über Aufrufe hinweg erhalten** (cwd / Variablen / Aliasse), geeignet für REPL, ssh und interaktive CLIs
164
- - `send` wartet, bis sich die Ausgabe stabilisiert hat (300 ms Stille, Obergrenze 5 s), und liefert die **vollständige Antwort**; bei mehr als 1 MB Ausgabe folgt der Hinweis `truncated`
165
- - Die Eingabe endet mit `\\n` (oder \\r), um die Eingabetaste zu signalisieren
166
-
167
- ## Sandbox (Anbindung an den offiziellen Mechanismus)
168
-
169
- Das `shell`-Werkzeug nutzt die offizielle Sandbox-Naht von DSH (`ctx.sandboxPolicy` + `ctx.sandbox`):
170
-
171
- - Bei jedem Aufruf wird die aktuelle Sandbox-Richtlinie aufgelöst; `danger-full-access`-Sitzungen werden direkt ausgeführt (ohne Ummantelung).
172
- - Das PowerShell-Backend umhüllt argv über `ctx.sandbox.confine` – dieselbe **Fail-closed**-Semantik wie bei den offiziellen Executoren: Wird der eingeschränkte Modus angefordert, aber kein Backend gefunden, fliegt eine `SandboxUnavailableError`; ein ungeschützter Lauf wird verweigert.
173
- - Das Git-Bash-Backend wird nicht umhüllt: Der Windows-ACL-Restricted-Token-Runner von DSH ist inkompatibel mit Cygwin/MSYS2 (bash bricht beim Start mit `CreateFileMapping` Win32-Fehler 5 ab); daher läuft Git Bash auch im eingeschränkten Modus ohne Sandbox-Ummantelung; das Ergebnis meldet `enforcement: gitbash-unconfined`.
174
- - Das MSYS2-Backend wird ebenfalls nicht umhüllt (dieselbe Cygwin/MSYS2-Laufzeitinkompatibilität); das Ergebnis meldet `enforcement: msys2-unconfined`.
175
- - Das WSL-Backend wird nicht umhüllt: Die eigenständige Linux-VM von WSL ist selbst die Isolation (das Ergebnis meldet `enforcement: wsl-isolation`).
176
- - Wird ein Aufruf im eingeschränkten Modus von der Sandbox abgelehnt, trägt das Ergebnis das offizielle Kennzeichen `[sandbox: file access denied under <mode> mode]` samt Eskalationshinweis für dieselbe Runde; das Modell kann mit `sandbox_permissions` + `justification` eine Eskalation anstoßen (Nutzerfreigabe über `ctx.approval`) – exakt wie bei den offiziellen bash/pwsh-Werkzeugen.
177
- - Hinweis: Wenn der Windows-ACL-Runner von DSH verfügbar ist, wird der eingeschränkte Modus von PowerShell über ihn umhüllt; Git Bash und MSYS2 bleiben wegen der Cygwin/MSYS2-Inkompatibilität unumhüllt.
178
-
179
- ## ⚠️ Sicherheitshinweis
180
-
181
- Das `shell`-Werkzeug im eingeschränkten Modus: PowerShell wird über `ctx.sandbox.confine` umhüllt (fail-closed); Git Bash und MSYS2 bleiben wegen der Inkompatibilität von Cygwin/MSYS2 mit dem Windows-ACL-Restricted-Token **unumhüllt** (gleiche Berechtigungen wie der dsh-Prozess); WSL bleibt dank seiner eigenständigen Linux-VM unumhüllt. Es ist ein **zusätzlicher Multi-Terminal-Einstiegspunkt** und genießt nicht die ConstrainedLanguage-Einschränkungen des offiziellen `pwsh`-Werkzeugs. Die Datei-Werkzeuge von DSH (read/write/edit) unterliegen weiterhin der Datei-Sandbox. Nur in Sitzungen verwenden, denen Sie vertrauen; für sandboxgeschütztes PowerShell weiterhin das offizielle `pwsh`-Werkzeug nutzen.
182
-
183
- ## Bekannte Einschränkungen des interaktiven Terminals (ConPTY)
184
-
185
- - **PowerShell 5.1 kann in einem ConPTY nicht starten** (0x8009001d) – für interaktives PowerShell [PowerShell 7](https://github.com/PowerShell/PowerShell/releases) installieren (Einmalbefehle sind nicht betroffen).
186
- - **Der interaktive Modus von wsl.exe kann unter ConPTY einen RPC-Fehler des WSL-Dienstes auslösen** (0x8007072c, sporadisch) – Einmalbefehle `wsl -e bash -lc ...` funktionieren normal; für interaktive Sitzungen besser Windows Terminal / ein WSL-Terminal verwenden oder es erneut versuchen.
187
- - **node-pty akzeptiert unter Windows keine benannten Signale**: `SIGINT` von `signal` wird auf Ctrl+C (`\x03`) abgebildet; andere Signale (`SIGTERM` / `SIGKILL` / `SIGTSTP` / `SIGHUP`) degradieren zur Beendigung der Sitzung.
188
- - Interaktive Git-Bash-Sitzungen funktionieren vollumfänglich.
189
-
190
- ## Bekannte Einschränkungen
191
-
192
- - WSL-Hintergrundprozesse können nach Timeout/Abbruch noch kurz in der Distribution weiterlaufen (die WSL-Instanz schaltet sich nach dem Ende des letzten Prozesses automatisch ab).
193
- - Git Bash ist eine msys2-Umgebung und weicht vom Linux-Verhalten von WSL ab (Pfad-Mapping, Paketverfügbarkeit).
194
- - Das MSYS2-Backend erfordert eine lokal installierte MSYS2 (Standard `C:\msys64`); ohne Installation meldet `shell` den Fehler `backend unavailable`, mit `msys2Path` lässt sich ein benutzerdefinierter Ort angeben. Die Kandidatenreihenfolge bleibt immer: `bash.exe` zuerst, `msys2.exe` als Fallback – bei weitergeleitetem stdio liefert `msys2.exe` stumm null Byte und dient nur als letzte Rettung.
195
- - Dieses Plugin registriert seine Werkzeuge nur auf der Plattform `win32`.
196
-
197
- ## Tests
198
-
199
- ```powershell
200
- cd D:\workspace\projects\dsh-bash-terminal-ts
201
- npm install # Abhängigkeiten installieren (typescript inklusive)
202
- npm run build # tsc-Kompilierung src/*.ts → lib/*.js; client.tsx → lib/client.js + dist/client.js; test/*.ts → test-dist/
203
- npm test # node test-dist/unit.js → apply.js → client.js → terminal.js
204
- ```
205
-
206
- Der Quellcode ist TypeScript (`strict` + `noUncheckedIndexedAccess`); die Build-Artefakte `lib/` und `dist/` werden mit dem Repository eingecheckt, DSH lädt direkt `lib/index.js` – ohne Installation einsatzbereit.
1
+ # dsh-bash-terminal-ts
2
+
3
+ > 🌐 [简体中文](README.md) | [English](README.en.md) | [Français](README.fr.md) | [Deutsch](README.de.md) | [Italiano](README.it.md) | [Русский](README.ru.md) | [Español](README.es.md) | [Português](README.pt.md) · Community: [LINUX DO](https://linux.do) · [GitHub](https://github.com/drscrewdriver/dsh-bash-terminal-ts)
4
+
5
+ ![test](https://github.com/drscrewdriver/dsh-bash-terminal-ts/actions/workflows/test.yml/badge.svg)
6
+
7
+ DSH-Plugin (DeepSeek Harness): ein `shell`-Werkzeug, das unter Windows die Befehle **vierer** Terminals – **PowerShell / Git Bash / MSYS2 / WSL** – einheitlich ausführt.
8
+
9
+ > **Dieses Repository ist die TypeScript-Neuschreibung von `MAXeaglet/dsh-bash-terminal`** mit funktionsfähiger MSYS2/MINGW64-Unterstützung. Die Kompatibilitätslinien werden pro DSH-Host-Segment geschnitten; alle Linien teilen sich den Paketnamen `dsh-bash-terminal-ts` und werden über npm-dist-tags unterschieden:
10
+ >
11
+ > | DSH-Segment | Branch | Plugin-Version | npm-dist-tag |
12
+ > |--------|------|----------|--------------|
13
+ > | `>=0.1.0-rc.2 <0.3.0-0` (begrenzte Spanne) | `main` (dieser Branch, versionsübergreifender Hauptzweig) | 0.8.x | `latest` |
14
+ > | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (historisch, eingefroren) | 0.7.x | `dsh-0.2.0` |
15
+ > | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
16
+ > | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (historisch, eingefroren) | ≤ 0.5.2 | `dsh-0.1.5` |
17
+ > | 0.1.2-alpha.1 – 0.1.2-rc.x | frühe `main`-Commits (pro Tag eingefroren) | ≤ 0.4.2 | `dsh-0.1.2` |
18
+ >
19
+ > Wählen Sie die Linie passend zu Ihrer DSH-Version; die Versionsserien überlappen nicht, daher kann eine `^`-Installation nie über Linien hinweg auflösen.
20
+
21
+ | Backend | Tatsächliche Ausführung | Syntax / Pfade | Umgebungsvariablen |
22
+ |------|----------|-------------|----------|
23
+ | `powershell` (Standard) | `pwsh -NoLogo -NoProfile -NonInteractive -Command <cmd>` | PowerShell; `C:\...` | `$env:NAME` |
24
+ | `gitbash` | `bash -lc <cmd>` aus Git for Windows | POSIX; `/d/workspace`; PATH enthält `/usr/bin` und `/mingw64/bin` | `$NAME` |
25
+ | `msys2` | MSYS2 `bash -lc <cmd>` (`C:\msys64\usr\bin\bash.exe`) | POSIX; `/c/...`; PATH enthält `/usr/bin` und `/mingw64/bin` (gcc / make) | `$NAME` (`MSYSTEM=MINGW64` wird automatisch injiziert) |
26
+ | `wsl` | `wsl [-d <distro>] -e bash -lc <cmd>` | Linux; `/mnt/d/...` | `$NAME` (über WSLENV) |
27
+
28
+ Jeder Aufruf startet eine komplett neue Shell: **Es wird kein Zustand bewahrt** (cwd / Variablen / Aliasse) – übergeben Sie `workdir`, statt `cd` zu verwenden.
29
+
30
+ ## Vorschau der Oberfläche
31
+
32
+ Die Zeile „Standardterminal" in Einstellungen → Allgemein: Der Nutzer wählt zwischen PowerShell / Git Bash / MSYS2 / WSL, und das `shell`-Werkzeug führt ausschließlich gemäß dieser Einstellung aus – das Modell kann sie nicht überschreiben:
33
+
34
+ ![Zeile für die Standardterminal-Einstellung](assets/shells.png)
35
+
36
+ ## Entwurfsprinzipien
37
+
38
+ - **Das Terminal bestimmt der Nutzer, die KI kann es nicht ändern**: Die Einstellungsseite der Web-UI (Einstellungen → Allgemein) bietet ein Dropdown „Standardterminal" (PowerShell / Git Bash / MSYS2 / WSL); das `shell`-Werkzeug folgt stets ausschließlich dieser Einstellung und legt dem Modell keine Terminal-Parameter offen. Die Einstellung wird über das DSH-Settings-System persistiert (settings.yaml).
39
+ - **Belegt die Fähigkeitsschnittstelle `ctx.shell` nicht**: Das sandboxierte `pwsh`-Werkzeug von DSH bleibt unverändert nutzbar; das `shell`-Werkzeug dieses Plugins ist ein **zusätzlicher** Multi-Terminal-Einstiegspunkt.
40
+ - Prozesse werden über die gemeinsame `ctx.subprocess`-Naht erzeugt: Beendigung des Prozessbaums (unter Windows `taskkill /T`), SIGTERM → Gnistenfrist → SIGKILL, Ausgabe-Spill-Dateien – Verhalten identisch zu den offiziellen Werkzeugen `dsh-tool-bash` / `dsh-tool-pwsh`.
41
+ - Hintergrundaufgaben werden im generischen `jobs`-Registry registriert, mit Unterstützung für `run_in_background` / `job_output` / `job_kill`.
42
+ - Die Zeile „Standardterminal" der Frontend-Einstellungsseite ist eine Enumeration (von der UI automatisch als Dropdown gerendert); das Modell führt bei jedem Aufruf gemäß dieser Einstellung aus und kann das Terminal nicht eigenmächtig wechseln.
43
+
44
+ ## Installation (Web-Profil)
45
+
46
+ ### Standardinstallation (nach der npm-Veröffentlichung, offizieller Bundle-Mechanismus)
47
+
48
+ Das Plugin bringt das offizielle `dsh.bundle`-Manifest mit (eigene `cordis.patch.yml` im Paket); sobald ein Profil dieses Paket aufführt, **wendet DSH den Mount automatisch an** – eine manuelle Anpassung der Profil-Konfiguration ist nicht nötig:
49
+
50
+ ```powershell
51
+ # 1. Plugin-Paket installieren
52
+ npm install -g dsh-bash-terminal-ts
53
+ dsh plugin --profile web add dsh-bash-terminal-ts # automatisch in die Profile-Bundles aufnehmen und Patch anwenden
54
+
55
+ # 2. Settings-Allowlist von DSH patchen (DSH-Einschränkung, siehe Erläuterung unten)
56
+ powershell -ExecutionPolicy Bypass -File install.ps1 install
57
+
58
+ # 3. dsh web neu starten
59
+ ```
60
+
61
+ > Mit einem temporären Profil praktisch erprobt: `bundles: [dsh-bash-terminal-ts]` → der Eintrag `tool-bash-terminal` erscheint automatisch im dump-config.
62
+
63
+ ### Installation für die lokale Entwicklung (Junction, Quellcode-Änderungen wirken sofort)
64
+
65
+ ```powershell
66
+ # 1. Plugin-Paket in die node_modules des Profils linken (Junction, Quellcode-Änderungen wirken sofort)
67
+ $profile = "$env:USERPROFILE\.dsh\profiles\web"
68
+ New-Item -ItemType Junction -Path "$profile\node_modules\dsh-bash-terminal-ts" -Target "D:\workspace\projects\dsh-bash-terminal-ts" | Out-Null
69
+
70
+ # 2. Dem Plugin die Auflösung der @deepseek-ai/*-Abhängigkeiten ermöglichen (Junction in den Abhängigkeitsbaum des Profils; Plugin und Host teilen sich dieselben Modulinstanzen)
71
+ New-Item -ItemType Junction -Path "D:\workspace\projects\dsh-bash-terminal-ts\node_modules\@deepseek-ai" -Target "$profile\..\node_modules\@deepseek-ai" | Out-Null
72
+
73
+ # 3. Das Profil das Plugin über das offizielle Bundle mounten lassen (install.ps1 install erledigt das automatisch; entspricht dem Eintrag "dsh-bash-terminal-ts" in dsh.profile.bundles)
74
+ # 4. (nur nach Änderungen am Frontend-Quellcode) Client-Bundle neu bauen:
75
+ # cd D:\workspace\projects\dsh-bash-terminal-ts && node scripts/build-client.mjs
76
+ # 5. dsh web neu starten
77
+ ```
78
+
79
+ > ⚠️ **Führen Sie in diesem Projekt kein `npm install` aus**: Es würde die Junction aus Schritt 2 oben löschen und stattdessen eine **eigenständige** Kopie von
80
+ > `@deepseek-ai/*` für das Plugin installieren – Plugin und Host teilten sich dann keine Modulinstanzen mehr, und nach einem Host-Upgrade bliebe das Plugin auf der alten API hängen
81
+ > (dieses Projekt hing dadurch einmal auf 0.1.0-rc.6 fest). Nur zum Aktualisieren des Locks `npm install --package-lock-only` verwenden.
82
+
83
+ > **Kompatibilität**: Erfordert DSH ≥ **0.1.7-rc.1** (Linie `compat/0.1.7`) oder ≥ **0.2.0-rc.1** (Linie `compat/0.2.0`, dieser Branch).
84
+ > Historischer Hintergrund: In 0.1.5 wurde `@deepseek-ai/dsh-client-runtime` in der Client-Modultabelle in `@deepseek-ai/dsh-client-store` umbenannt und wird nur über exakte Treffer des nackten Namens aufgelöst; alte Bundles schlagen auf dem neuen Host fehl mit
85
+ > `Failed to load plugins` / `require(...) missed the module table`.
86
+ >
87
+ > Hinweis: Seit 0.1.5 nutzt die Web-Settings-Oberfläche die dynamische Enumeration `settings.describe()` und hat **keine Namespace-Allowlist mehr**
88
+ > (`settings-not-exposed` existiert nicht mehr); der Allowlist-Patch in `install.ps1` ist nur noch ein historisches Überbleibsel und kann ignoriert werden.
89
+
90
+ > Eine manuelle Anpassung der `cordis.patch.yml` des Profils ist nicht mehr erforderlich: Das Plugin-Paket bringt sein eigenes `dsh.bundle.patch` mit (`cordis.patch.yml` im Paket); sobald `dsh-bash-terminal-ts` im `dsh.profile.bundles` des Profils steht, mountet DSH das Plugin automatisch.
91
+
92
+ Kombinierten Baum verifizieren (ohne Neustart):
93
+
94
+ ```powershell
95
+ node "$env:APPDATA\nvm\<node-version>\node_modules\@deepseek-ai\dsh\lib\bin.js" --profile web --dump-config | Select-String dsh-bash-terminal-ts
96
+ ```
97
+
98
+ ## Verwendung
99
+
100
+ **Der Nutzer wählt das Standardterminal in der Web-UI**: Einstellungen (Zahnrad) öffnen → Allgemein → Dropdown „Standardterminal" und eines der Terminals PowerShell / Git Bash / MSYS2 / WSL wählen. Änderungen wirken sofort und werden persistiert.
101
+
102
+ Sobald das Modell das `shell`-Werkzeug sieht, verwendet es automatisch das von Ihnen gewählte Terminal (das Werkzeug legt keinen Terminal-Parameter offen; das Modell kann Ihre Wahl nicht ändern):
103
+
104
+ - Standardterminal = Git Bash: `shell(command: "git status")` läuft über Git Bash
105
+ - Standardterminal = MSYS2: `shell(command: "gcc --version")` läuft über MSYS2 (MINGW64-Umgebung, gcc und make aus `/mingw64/bin` verfügbar)
106
+ - Standardterminal = WSL: `shell(command: "ls -la /mnt/d/workspace")` läuft über WSL; mit `distro: "Ubuntu"` lässt sich die Distribution angeben
107
+ - Standardterminal = PowerShell: `shell(command: "Get-Process node")` läuft über PowerShell
108
+
109
+ ## Beispiele zur Modellnutzung
110
+
111
+ - Einmalbefehl (Standardterminal): `shell(command: "git status", description: "Git-Status prüfen")`
112
+ - Zustand über Runden hinweg bewahren (interaktiv): `terminal(action: "open")` → `sessionId` notieren → `terminal(action: "send", sessionId, input: "cd /d/project\n")` → `terminal(action: "send", sessionId, input: "npm run dev\n")` → `terminal(action: "close", sessionId)`
113
+ - Laufendes Programm unterbrechen: `terminal(action: "signal", sessionId, signal: "SIGINT")`
114
+ - Aktive Sitzungen einsehen: `terminal(action: "list")`
115
+ - Eskalation nach Sandbox-Ablehnung: `shell(command: ..., sandbox_permissions: "workspace-write", justification: "...")`
116
+
117
+ ## Konfiguration
118
+
119
+ **Web-UI-Einstellungen** (empfohlen): Einstellungen → Allgemein → „Standardterminal".
120
+
121
+ `config` der Plugin-Zeile (überschreibt die Standardwerte und dient als Kompositionsgrundlage der Einstellungen):
122
+
123
+ | Schlüssel | Standard | Beschreibung |
124
+ |----|------|------|
125
+ | `defaultShell` | `powershell` | Backend, sofern die Einstellungen nichts anderes festlegen |
126
+ | `timeoutMs` | 120000 | Standard-Timeout |
127
+ | `maxTimeoutMs` | 600000 | Obergrenze für das timeoutMs des Aufrufers |
128
+ | `pwshPath` | automatische Erkennung | Fester Pfad zu pwsh.exe |
129
+ | `gitBashPath` | automatische Erkennung | Fester Pfad zu git bash.exe |
130
+ | `msys2Path` | automatische Erkennung (`C:\msys64\usr\bin\bash.exe` bevorzugt, Fallback `msys2.exe`) | Fester Pfad zu MSYS2 bash.exe |
131
+ | `wslPath` | automatische Erkennung | Fester Pfad zu wsl.exe |
132
+
133
+ ## Veröffentlichung (npm)
134
+
135
+ Das npm-Konto hat die 2FA-Verifizierung für Veröffentlichungen aktiviert; ein Einmalcode ist erforderlich:
136
+
137
+ ```powershell
138
+ cd D:\workspace\projects\dsh-bash-terminal-ts
139
+ npm publish --otp <Code> # der Code stammt von Ihrem Authentifikator
140
+ ```
141
+
142
+ Vor der Veröffentlichung mit `npm pack --dry-run` den Inhalt prüfen und `npm run build` ausführen, um alles neu zu bauen (tsc-Serverkompilierung + Client-Bundle + Testkompilierung).
143
+
144
+ ## Deinstallation
145
+
146
+ Einfach ausführen:
147
+
148
+ ```powershell
149
+ powershell -ExecutionPolicy Bypass -File install.ps1 uninstall
150
+ ```
151
+
152
+ Der Befehl entfernt die Junctions, stellt die Settings-Allowlist wieder her, räumt die veralteten `cordis.patch.yml`-Mount-Blöcke früherer Versionen auf und entfernt `dsh-bash-terminal-ts` aus dem `dsh.profile.bundles`. Anschließend dsh web neu starten.
153
+
154
+ Bei manueller Deinstallation ist – neben dem Entfernen von `node_modules\dsh-bash-terminal-ts` – auch daran zu denken, `dsh-bash-terminal-ts` aus dem `dsh.profile.bundles` der Profil-`package.json` zu entfernen.
155
+
156
+ ## Interaktives Terminal (Werkzeug `terminal`)
157
+
158
+ Das Werkzeug `terminal` stellt **persistente interaktive Sitzungen** über die PTY-Naht bereit (node-pty; unter Windows direkt über node-pty, weil der Process Inspector des upstream `spawnTerminal` nur POSIX unterstützt – `lib/terminal.js` verbindet sich daher direkt mit node-pty; unter Nicht-Windows wird weiterhin das offizielle `ctx.subprocess.spawnTerminal` verwendet):
159
+
160
+ - `action: open` startet eine echte Terminal-Sitzung (gemäß Ihrer Standardterminal-Einstellung; bei wsl kann `distro` angegeben werden) und liefert eine `sessionId`
161
+ - `action: send` schreibt die Eingabe und liest die neue Ausgabe; `action: read` liest nur, ohne zu schreiben; `action: signal` sendet ein Signal an die Vordergrund-Prozessgruppe (SIGINT = Ctrl+C)
162
+ - `action: close` beendet die Sitzung
163
+ - **Der Sitzungszustand bleibt über Aufrufe hinweg erhalten** (cwd / Variablen / Aliasse), geeignet für REPL, ssh und interaktive CLIs
164
+ - `send` wartet, bis sich die Ausgabe stabilisiert hat (300 ms Stille, Obergrenze 5 s), und liefert die **vollständige Antwort**; bei mehr als 1 MB Ausgabe folgt der Hinweis `truncated`
165
+ - Die Eingabe endet mit `\\n` (oder \\r), um die Eingabetaste zu signalisieren
166
+
167
+ ## Sandbox (Anbindung an den offiziellen Mechanismus)
168
+
169
+ Das `shell`-Werkzeug nutzt die offizielle Sandbox-Naht von DSH (`ctx.sandboxPolicy` + `ctx.sandbox`):
170
+
171
+ - Bei jedem Aufruf wird die aktuelle Sandbox-Richtlinie aufgelöst; `danger-full-access`-Sitzungen werden direkt ausgeführt (ohne Ummantelung).
172
+ - Das PowerShell-Backend umhüllt argv über `ctx.sandbox.confine` – dieselbe **Fail-closed**-Semantik wie bei den offiziellen Executoren: Wird der eingeschränkte Modus angefordert, aber kein Backend gefunden, fliegt eine `SandboxUnavailableError`; ein ungeschützter Lauf wird verweigert.
173
+ - Das Git-Bash-Backend wird nicht umhüllt: Der Windows-ACL-Restricted-Token-Runner von DSH ist inkompatibel mit Cygwin/MSYS2 (bash bricht beim Start mit `CreateFileMapping` Win32-Fehler 5 ab); daher läuft Git Bash auch im eingeschränkten Modus ohne Sandbox-Ummantelung; das Ergebnis meldet `enforcement: gitbash-unconfined`.
174
+ - Das MSYS2-Backend wird ebenfalls nicht umhüllt (dieselbe Cygwin/MSYS2-Laufzeitinkompatibilität); das Ergebnis meldet `enforcement: msys2-unconfined`.
175
+ - Das WSL-Backend wird nicht umhüllt: Die eigenständige Linux-VM von WSL ist selbst die Isolation (das Ergebnis meldet `enforcement: wsl-isolation`).
176
+ - Wird ein Aufruf im eingeschränkten Modus von der Sandbox abgelehnt, trägt das Ergebnis das offizielle Kennzeichen `[sandbox: file access denied under <mode> mode]` samt Eskalationshinweis für dieselbe Runde; das Modell kann mit `sandbox_permissions` + `justification` eine Eskalation anstoßen (Nutzerfreigabe über `ctx.approval`) – exakt wie bei den offiziellen bash/pwsh-Werkzeugen.
177
+ - Hinweis: Wenn der Windows-ACL-Runner von DSH verfügbar ist, wird der eingeschränkte Modus von PowerShell über ihn umhüllt; Git Bash und MSYS2 bleiben wegen der Cygwin/MSYS2-Inkompatibilität unumhüllt.
178
+
179
+ ## ⚠️ Sicherheitshinweis
180
+
181
+ Das `shell`-Werkzeug im eingeschränkten Modus: PowerShell wird über `ctx.sandbox.confine` umhüllt (fail-closed); Git Bash und MSYS2 bleiben wegen der Inkompatibilität von Cygwin/MSYS2 mit dem Windows-ACL-Restricted-Token **unumhüllt** (gleiche Berechtigungen wie der dsh-Prozess); WSL bleibt dank seiner eigenständigen Linux-VM unumhüllt. Es ist ein **zusätzlicher Multi-Terminal-Einstiegspunkt** und genießt nicht die ConstrainedLanguage-Einschränkungen des offiziellen `pwsh`-Werkzeugs. Die Datei-Werkzeuge von DSH (read/write/edit) unterliegen weiterhin der Datei-Sandbox. Nur in Sitzungen verwenden, denen Sie vertrauen; für sandboxgeschütztes PowerShell weiterhin das offizielle `pwsh`-Werkzeug nutzen.
182
+
183
+ ## Bekannte Einschränkungen des interaktiven Terminals (ConPTY)
184
+
185
+ - **PowerShell 5.1 kann in einem ConPTY nicht starten** (0x8009001d) – für interaktives PowerShell [PowerShell 7](https://github.com/PowerShell/PowerShell/releases) installieren (Einmalbefehle sind nicht betroffen).
186
+ - **Der interaktive Modus von wsl.exe kann unter ConPTY einen RPC-Fehler des WSL-Dienstes auslösen** (0x8007072c, sporadisch) – Einmalbefehle `wsl -e bash -lc ...` funktionieren normal; für interaktive Sitzungen besser Windows Terminal / ein WSL-Terminal verwenden oder es erneut versuchen.
187
+ - **node-pty akzeptiert unter Windows keine benannten Signale**: `SIGINT` von `signal` wird auf Ctrl+C (`\x03`) abgebildet; andere Signale (`SIGTERM` / `SIGKILL` / `SIGTSTP` / `SIGHUP`) degradieren zur Beendigung der Sitzung.
188
+ - Interaktive Git-Bash-Sitzungen funktionieren vollumfänglich.
189
+
190
+ ## Bekannte Einschränkungen
191
+
192
+ - WSL-Hintergrundprozesse können nach Timeout/Abbruch noch kurz in der Distribution weiterlaufen (die WSL-Instanz schaltet sich nach dem Ende des letzten Prozesses automatisch ab).
193
+ - Git Bash ist eine msys2-Umgebung und weicht vom Linux-Verhalten von WSL ab (Pfad-Mapping, Paketverfügbarkeit).
194
+ - Das MSYS2-Backend erfordert eine lokal installierte MSYS2 (Standard `C:\msys64`); ohne Installation meldet `shell` den Fehler `backend unavailable`, mit `msys2Path` lässt sich ein benutzerdefinierter Ort angeben. Die Kandidatenreihenfolge bleibt immer: `bash.exe` zuerst, `msys2.exe` als Fallback – bei weitergeleitetem stdio liefert `msys2.exe` stumm null Byte und dient nur als letzte Rettung.
195
+ - Dieses Plugin registriert seine Werkzeuge nur auf der Plattform `win32`.
196
+
197
+ ## Tests
198
+
199
+ ```powershell
200
+ cd D:\workspace\projects\dsh-bash-terminal-ts
201
+ npm install # Abhängigkeiten installieren (typescript inklusive)
202
+ npm run build # tsc-Kompilierung src/*.ts → lib/*.js; client.tsx → lib/client.js + dist/client.js; test/*.ts → test-dist/
203
+ npm test # node test-dist/unit.js → apply.js → client.js → terminal.js
204
+ ```
205
+
206
+ Der Quellcode ist TypeScript (`strict` + `noUncheckedIndexedAccess`); die Build-Artefakte `lib/` und `dist/` werden mit dem Repository eingecheckt, DSH lädt direkt `lib/index.js` – ohne Installation einsatzbereit.