mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
# Conflicts: # docs/config-catalog.md # docs/development.i18n.yaml # docs/development.zh.md # docs/rfc/implemented/feature/2026-06-14-acp-agent-client-protocol.md # docs/rfc/implemented/feature/2026-07-06-sandbox.md # examples/AGENTS.md # examples/README.md # examples/acp-agent/README.md # examples/acp-agent/cordis.yml # examples/acp-agent/tests/acp.e2e.ts # examples/acp-agent/tests/escalation.e2e.ts # examples/sandbox-acp-agent/README.md # examples/sandbox-acp-agent/cordis.snapshot.yml # examples/sandbox-acp-agent/cordis.yml # examples/sandbox-acp-agent/tests/acp.snapshot.ts # packages/ui/acp-agent/src/bin.ts # packages/ui/acp/README.md # packages/ui/jsonrpc-agent/README.md # packages/ui/jsonrpc-agent/src/bin.ts # scripts/verify-translation-pairing.ts
25 lines
1.1 KiB
JavaScript
25 lines
1.1 KiB
JavaScript
/**
|
|
* Boot the REPL or ACP Code Mode overlay, defaulting to REPL. Each overlay
|
|
* includes its base example, selects Code Mode, and adds the worker runtime.
|
|
* Both require a DeepSeek API key; unsupported arguments fail with usage.
|
|
*/
|
|
import { spawn } from 'node:child_process'
|
|
|
|
// Each UI's node invocation, verbatim what its base demo script runs plus
|
|
// the overlay config (the stdio bin keeps --expose-internals for the cordis
|
|
// Loader's HMR path).
|
|
const UIS = new Map([
|
|
['repl', ['--expose-internals', '--import', 'tsx', 'packages/ui/stdio-agent/src/bin.ts', 'examples/coding-agent/code-mode.cordis.yml']],
|
|
['acp', ['--import', 'tsx', 'packages/ui/acp-agent/src/bin.ts', '--config', 'examples/acp-agent/code-mode.cordis.yml']],
|
|
])
|
|
|
|
const ui = process.argv[2] ?? 'repl'
|
|
const args = UIS.get(ui)
|
|
if (!args || process.argv.length > 3) {
|
|
console.error('usage: pnpm run demo:code-mode [repl|acp]')
|
|
process.exit(2)
|
|
}
|
|
|
|
const child = spawn(process.execPath, args, { stdio: 'inherit' })
|
|
child.on('exit', (code, signal) => { process.exit(signal !== null ? 1 : code ?? 1) })
|