Merge branch 'master' into claude/unified-environment-credentials-c8841a

Master removed the TUI package, the `meta` and `upgrade` subcommands, and
`--config-replace`, and made raw `dsh` require a `--config` overlay. Resolved
onto that shape:

- Dropped this branch's TUI edits with the surface itself, including
  `tui.cordis.yml`, `runTui`, and the TUI keyless PTY smoke.
- Dropped the `--config-replace` plumbing rather than reintroducing a flag
  master deliberately removed. The gap this branch fixed remains: `dsh -p`
  still could not name its composition, so it keeps `--config`.
- Kept this branch's deletion of the personal `$DSH_HOME/config.yaml` layer,
  which master still carried, and provided the environment snapshot in the new
  raw `runConfig` surface alongside web and headless.
- Ported the headless shutdown PTY test off the personal overlay onto a named
  `--config` file, which is what proves that flag now exists on `-p`.
This commit is contained in:
Yichen Jiang
2026-08-04 17:51:44 +08:00
668 changed files with 10527 additions and 30408 deletions

View File

@@ -6,7 +6,7 @@
* @module @deepseek-ai/dsh/bin
*/
/* v8 ignore file -- built-bin and PTY tests exercise this self-executing dispatch. */
/* v8 ignore file -- built-bin acceptance exercises this self-executing dispatch. */
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
@@ -25,10 +25,14 @@ function readVersion(): string {
}
const environment = loadLayeredEnv('dsh')
// The env opt-in is read at the process boundary; `1` is the documented value.
const invocation = parseDshArgs(process.argv.slice(2), readVersion(), process.env.DSH_EXPERIMENTAL === '1')
const invocation = parseDshArgs(process.argv.slice(2), readVersion())
switch (invocation.mode) {
case 'config': {
const { runConfig } = await import('./config.ts')
await runConfig(environment, invocation.config)
break
}
case 'web': {
const { runWeb } = await import('./web.ts')
await runWeb(
@@ -39,12 +43,7 @@ switch (invocation.mode) {
}
case 'headless': {
const { runHeadless } = await import('./headless.ts')
await runHeadless(environment, invocation.prompt, invocation.config, invocation.configReplace)
break
}
case 'tui': {
const { runTui } = await import('./tui.ts')
await runTui(environment, invocation.config, invocation.resume, undefined, undefined, invocation.configReplace)
await runHeadless(environment, invocation.prompt, invocation.config)
break
}
case 'dump-config': {
@@ -52,16 +51,6 @@ switch (invocation.mode) {
runDumpConfig(invocation.surface, invocation.defaultOnly, invocation.config)
break
}
case 'meta': {
const { runTui, SOURCE_ROOT } = await import('./tui.ts')
await runTui(environment, invocation.config, undefined, SOURCE_ROOT, undefined, invocation.configReplace)
break
}
case 'upgrade': {
const { runTui } = await import('./tui.ts')
await runTui(environment, invocation.config, undefined, undefined, `dsh-${invocation.mode}`, invocation.configReplace)
break
}
default:
invocation satisfies never
throw new Error(`dsh: unhandled invocation mode ${JSON.stringify(invocation)}`)