直接处理模式(非交互式)
(app: CLIApp, input_source: str, input_type: str)
| 164 | |
| 165 | |
| 166 | async def run_direct_processing(app: CLIApp, input_source: str, input_type: str): |
| 167 | """直接处理模式(非交互式)""" |
| 168 | try: |
| 169 | print( |
| 170 | f"\n{Colors.BOLD}{Colors.CYAN}🚀 Starting direct processing mode...{Colors.ENDC}" |
| 171 | ) |
| 172 | print(f"{Colors.CYAN}Input: {input_source}{Colors.ENDC}") |
| 173 | print(f"{Colors.CYAN}Type: {input_type}{Colors.ENDC}") |
| 174 | print( |
| 175 | f"{Colors.CYAN}Mode: {'🧠 Comprehensive' if app.cli.enable_indexing else '⚡ Optimized'}{Colors.ENDC}" |
| 176 | ) |
| 177 | |
| 178 | # 初始化应用 |
| 179 | init_result = await app.initialize_mcp_app() |
| 180 | if init_result["status"] != "success": |
| 181 | print( |
| 182 | f"{Colors.FAIL}❌ Initialization failed: {init_result['message']}{Colors.ENDC}" |
| 183 | ) |
| 184 | return False |
| 185 | |
| 186 | # 处理输入 |
| 187 | result = await app.process_input(input_source, input_type) |
| 188 | |
| 189 | if result["status"] == "success": |
| 190 | print( |
| 191 | f"\n{Colors.BOLD}{Colors.OKGREEN}🎉 Processing completed successfully!{Colors.ENDC}" |
| 192 | ) |
| 193 | return True |
| 194 | else: |
| 195 | print( |
| 196 | f"\n{Colors.BOLD}{Colors.FAIL}❌ Processing failed: {result.get('error', 'Unknown error')}{Colors.ENDC}" |
| 197 | ) |
| 198 | return False |
| 199 | |
| 200 | except Exception as e: |
| 201 | print(f"\n{Colors.FAIL}❌ Direct processing error: {str(e)}{Colors.ENDC}") |
| 202 | return False |
| 203 | finally: |
| 204 | await app.cleanup_mcp_app() |
| 205 | |
| 206 | |
| 207 | async def run_requirement_analysis(app: CLIApp, initial_idea: str): |
no test coverage detected