MCPcopy Index your code
hub / github.com/HKUDS/DeepCode / run_requirement_analysis

Function run_requirement_analysis

cli/main_cli.py:207–241  ·  view source on GitHub ↗

需求分析模式(非交互式) - NEW: matching UI version

(app: CLIApp, initial_idea: str)

Source from the content-addressed store, hash-verified

205
206
207async def run_requirement_analysis(app: CLIApp, initial_idea: str):
208 """需求分析模式(非交互式) - NEW: matching UI version"""
209 try:
210 print(
211 f"\n{Colors.BOLD}{Colors.BLUE}🧠 Starting requirement analysis mode...{Colors.ENDC}"
212 )
213 print(f"{Colors.CYAN}Initial Idea: {initial_idea}{Colors.ENDC}")
214
215 # 初始化应用
216 init_result = await app.initialize_mcp_app()
217 if init_result["status"] != "success":
218 print(
219 f"{Colors.FAIL}❌ Initialization failed: {init_result['message']}{Colors.ENDC}"
220 )
221 return False
222
223 # 执行需求分析工作流
224 result = await app.process_requirement_analysis_non_interactive(initial_idea)
225
226 if result["status"] == "success":
227 print(
228 f"\n{Colors.BOLD}{Colors.OKGREEN}🎉 Requirement analysis completed successfully!{Colors.ENDC}"
229 )
230 return True
231 else:
232 print(
233 f"\n{Colors.BOLD}{Colors.FAIL}❌ Requirement analysis failed: {result.get('error', 'Unknown error')}{Colors.ENDC}"
234 )
235 return False
236
237 except Exception as e:
238 print(f"\n{Colors.FAIL}❌ Requirement analysis error: {str(e)}{Colors.ENDC}")
239 return False
240 finally:
241 await app.cleanup_mcp_app()
242
243
244async def main():

Callers 1

mainFunction · 0.85

Calls 4

getMethod · 0.80
initialize_mcp_appMethod · 0.45
cleanup_mcp_appMethod · 0.45

Tested by

no test coverage detected