packaging-prepare.mjs 683 B

123456789101112
  1. /** Match the CLI's launch initialization before the source-denied probe. */
  2. import path from 'node:path'
  3. import { createRequire } from 'node:module'
  4. import { pathToFileURL } from 'node:url'
  5. const [profile, hostAnchor] = process.argv.slice(2)
  6. const require = createRequire(hostAnchor)
  7. const { loadProfile, healProfilesModuleFallback } = await import(pathToFileURL(require.resolve('@deepseek-ai/dsh-app-boot')).href)
  8. const home = path.dirname(path.dirname(profile))
  9. await healProfilesModuleFallback({ installAnchor: hostAnchor, home,
  10. profile: loadProfile('dsh', path.basename(profile), hostAnchor, home) })
  11. console.log('Initialized the isolated profile using the host launch API')