Remove the redundant dsh-tui-demo bin and the RESUME_SESSION_ID environment
variable, leaving dsh as the one terminal entrypoint.
The dsh-tui-demo package was a plugin (the TUI app bundle mounted by dsh's
config) plus a bin that booted a leaf cordis.yml — the same job `dsh [config]`
does. The bin, its ./bin export, its built-bin.e2e.ts, the tsdown bin entry,
and the now-unused dsh-app-boot dependency are removed; the package keeps its
plugin and invariant. demo:cordis, demo:code-mode, and the tui-agent and
cordis-agent keyless PTY smokes now launch through apps/cli/src/bin.ts with the
config as the positional argument. cli-demo/acp-demo/jsonrpc-demo keep their
bins (distinct surfaces).
RESUME_SESSION_ID was the only bridge from --resume into the shipped config;
--resume now provides the id on the boot context via ctx.provide(
RESUME_SESSION_ID_KEY, id), and the four configs read it as a bare identifier
through a quoted typeof-guarded !!js expression. The TUI resumeCommand fixtures
and docs move to `dsh --resume {session}`.
Agent Note and its Chinese pair updated; config-catalog regenerated.
23 lines
947 B
JavaScript
23 lines
947 B
JavaScript
/**
|
|
* Boot the TUI or ACP Code Mode overlay, defaulting to TUI. Each overlay
|
|
* includes its base example, selects Code Mode, and adds the worker runtime.
|
|
* All require a DeepSeek API key; unsupported arguments fail with usage.
|
|
*/
|
|
import { spawn } from 'node:child_process'
|
|
|
|
// Each UI's node invocation matches its base demo script plus the overlay config.
|
|
const UIS = new Map([
|
|
['tui', ['--import', 'tsx', 'apps/cli/src/bin.ts', 'examples/tui-agent/code-mode.cordis.yml']],
|
|
['acp', ['--import', 'tsx', 'packages/examples/acp-demo/src/bin.ts', '--config', 'examples/acp-agent/code-mode.cordis.yml']],
|
|
])
|
|
|
|
const ui = process.argv[2] ?? 'tui'
|
|
const args = UIS.get(ui)
|
|
if (!args || process.argv.length > 3) {
|
|
console.error('usage: pnpm run demo:code-mode [tui|acp]')
|
|
process.exit(2)
|
|
}
|
|
|
|
const child = spawn(process.execPath, args, { stdio: 'inherit' })
|
|
child.on('exit', (code, signal) => { process.exit(signal !== null ? 1 : code ?? 1) })
|