runtime-bootstrap.mjs 1.0 KB

123456789101112131415161718192021222324
  1. #!/usr/bin/env node
  2. /** Private entry owned by the Python single-file runtime packaging. */
  3. import { fileURLToPath } from 'node:url'
  4. const selectorName = 'DSH_SUBPROCESS_RUNNER'
  5. const selection = process.env[selectorName]
  6. const aclRunner = process.platform === 'win32'
  7. ? fileURLToPath(import.meta.resolve('@deepseek-ai/dsh-sandbox-windows-acl/runner'))
  8. : undefined
  9. if (aclRunner !== undefined && process.argv[2] === aclRunner) {
  10. process.argv.splice(1, 1)
  11. await import('@deepseek-ai/dsh-sandbox-windows-acl/runner')
  12. } else if (process.env.DSH_PTC_RUNTIME_NODE === '1') {
  13. Reflect.deleteProperty(process.env, 'DSH_PTC_RUNTIME_NODE')
  14. await import('@deepseek-ai/dsh-ptc-runtime-node/process')
  15. } else if (selection === undefined) {
  16. const { runCli } = await import('@deepseek-ai/dsh/lib/bin.js')
  17. await runCli()
  18. } else {
  19. Reflect.deleteProperty(process.env, selectorName)
  20. const { runSelectedSubprocessRunner } = await import('@deepseek-ai/dsh-subprocess-local/runner')
  21. await runSelectedSubprocessRunner(selection)
  22. }