MCPcopy
hub / github.com/HKUDS/DeepCode / run_interactive_session

Method run_interactive_session

cli/cli_app.py:389–463  ·  view source on GitHub ↗

运行交互式会话

(self)

Source from the content-addressed store, hash-verified

387 self.cli.print_separator()
388
389 async def run_interactive_session(self):
390 """运行交互式会话"""
391 # 清屏并显示启动界面
392 self.cli.clear_screen()
393 self.cli.print_logo()
394 self.cli.print_welcome_banner()
395
396 # 初始化MCP应用
397 await self.initialize_mcp_app()
398
399 try:
400 # 主交互循环
401 while self.cli.is_running:
402 self.cli.create_menu()
403 choice = self.cli.get_user_input()
404
405 if choice in ["q", "quit", "exit"]:
406 self.cli.print_goodbye()
407 break
408
409 elif choice in ["u", "url"]:
410 url = self.cli.get_url_input()
411 if url:
412 await self.process_input(url, "url")
413
414 elif choice in ["f", "file"]:
415 file_path = self.cli.upload_file_gui()
416 if file_path:
417 await self.process_input(f"file://{file_path}", "file")
418
419 elif choice in ["t", "chat", "text"]:
420 chat_input = self.cli.get_chat_input()
421 if chat_input:
422 await self.process_input(chat_input, "chat")
423
424 elif choice in ["r", "req", "requirement", "requirements"]:
425 # NEW: Requirement Analysis workflow
426 await self.process_requirement_analysis()
427
428 elif choice in ["h", "history"]:
429 self.cli.show_history()
430
431 elif choice in ["c", "config", "configure"]:
432 # Show configuration menu - all settings managed by CLI interface
433 self.cli.show_configuration_menu()
434
435 else:
436 self.cli.print_status(
437 "Invalid choice. Please select U, F, T, R, C, H, or Q.",
438 "warning",
439 )
440
441 # 询问是否继续
442 if self.cli.is_running and choice in [
443 "u",
444 "f",
445 "t",
446 "r",

Callers 2

mainFunction · 0.95
mainFunction · 0.95

Calls 15

initialize_mcp_appMethod · 0.95
process_inputMethod · 0.95
cleanup_mcp_appMethod · 0.95
get_chat_inputMethod · 0.80
show_historyMethod · 0.80
clear_screenMethod · 0.45
print_logoMethod · 0.45
print_welcome_bannerMethod · 0.45
create_menuMethod · 0.45
get_user_inputMethod · 0.45

Tested by

no test coverage detected