Skip to content

Commit 2be5bc4

Browse files
committed
new version update
1 parent bca0bae commit 2be5bc4

File tree

7 files changed

+134
-121
lines changed

7 files changed

+134
-121
lines changed

cli/cli_interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def __init__(self):
3939
self.uploaded_file = None
4040
self.is_running = True
4141
self.processing_history = []
42-
self.enable_indexing = False # Default configuration (matching UI: fast mode by default)
42+
self.enable_indexing = (
43+
False # Default configuration (matching UI: fast mode by default)
44+
)
4345

4446
# Load segmentation config from the same source as UI
4547
self._load_segmentation_config()

cli/workflows/cli_workflow_adapter.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def cleanup_mcp_app(self):
102102
def create_cli_progress_callback(self, enable_indexing: bool = True) -> Callable:
103103
"""
104104
Create CLI-optimized progress callback function with mode-aware stage mapping.
105-
105+
106106
This matches the UI version's detailed progress mapping logic.
107107
108108
Args:
@@ -149,7 +149,7 @@ def progress_callback(progress: int, message: str):
149149
stage = 4 # Implement (skip References, Repos, Index)
150150
else:
151151
stage = 4 # Complete
152-
152+
153153
self.cli_interface.display_processing_stages(stage, enable_indexing)
154154

155155
# Display status message
@@ -162,7 +162,7 @@ async def execute_full_pipeline(
162162
) -> Dict[str, Any]:
163163
"""
164164
Execute the complete intelligent multi-agent research orchestration pipeline.
165-
165+
166166
Updated to match UI version: default enable_indexing=False for faster processing.
167167
168168
Args:
@@ -188,7 +188,8 @@ async def execute_full_pipeline(
188188
else:
189189
mode_msg = "⚡ fast (indexing disabled)"
190190
self.cli_interface.print_status(
191-
f"🚀 Starting {mode_msg} agent orchestration pipeline...", "processing"
191+
f"🚀 Starting {mode_msg} agent orchestration pipeline...",
192+
"processing",
192193
)
193194
self.cli_interface.display_processing_stages(0, enable_indexing)
194195

@@ -203,7 +204,9 @@ async def execute_full_pipeline(
203204
# Display completion
204205
if self.cli_interface:
205206
final_stage = 8 if enable_indexing else 4
206-
self.cli_interface.display_processing_stages(final_stage, enable_indexing)
207+
self.cli_interface.display_processing_stages(
208+
final_stage, enable_indexing
209+
)
207210
self.cli_interface.print_status(
208211
"🎉 Agent orchestration pipeline completed successfully!",
209212
"complete",
@@ -226,10 +229,12 @@ async def execute_full_pipeline(
226229
"pipeline_mode": "comprehensive" if enable_indexing else "optimized",
227230
}
228231

229-
async def execute_chat_pipeline(self, user_input: str, enable_indexing: bool = False) -> Dict[str, Any]:
232+
async def execute_chat_pipeline(
233+
self, user_input: str, enable_indexing: bool = False
234+
) -> Dict[str, Any]:
230235
"""
231236
Execute the chat-based planning and implementation pipeline.
232-
237+
233238
Updated to match UI version: accepts enable_indexing parameter.
234239
235240
Args:
@@ -259,17 +264,20 @@ def chat_progress_callback(progress: int, message: str):
259264
stage = 3 # Save Plan
260265
else:
261266
stage = 4 # Implement
262-
267+
263268
self.cli_interface.display_processing_stages(stage, chat_mode=True)
264269

265270
# Display status message
266271
self.cli_interface.print_status(message, "processing")
267272

268273
# Display pipeline start
269274
if self.cli_interface:
270-
indexing_note = " (with indexing)" if enable_indexing else " (fast mode)"
275+
indexing_note = (
276+
" (with indexing)" if enable_indexing else " (fast mode)"
277+
)
271278
self.cli_interface.print_status(
272-
f"🚀 Starting chat-based planning pipeline{indexing_note}...", "processing"
279+
f"🚀 Starting chat-based planning pipeline{indexing_note}...",
280+
"processing",
273281
)
274282
self.cli_interface.display_processing_stages(0, chat_mode=True)
275283

@@ -303,7 +311,7 @@ async def process_input_with_orchestration(
303311
) -> Dict[str, Any]:
304312
"""
305313
Process input using the intelligent agent orchestration engine.
306-
314+
307315
This is the main CLI interface to the latest agent orchestration capabilities.
308316
Updated to match UI version: default enable_indexing=False.
309317

mcp_agent.config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mcp:
5353
- .
5454
command: node
5555

56-
56+
5757
code-implementation:
5858
args:
5959
- tools/code_implementation_server.py

tools/pdf_downloader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ def format_file_operation_result(
188188
"""
189189
if result["success"]:
190190
size_mb = result["size"] / (1024 * 1024)
191-
191+
192192
# 处理不同操作类型的动词形式
193193
if operation == "copy":
194194
operation_verb = "copied"
195195
elif operation == "download":
196196
operation_verb = "downloaded"
197197
else: # move
198198
operation_verb = "moved"
199-
199+
200200
msg = f"[SUCCESS] Successfully {operation_verb}: {source}\n"
201201

202202
if operation == "download":
@@ -1180,7 +1180,7 @@ async def move_file_to(
11801180
) -> str:
11811181
"""
11821182
Copy a local file to a new location (preserves original file).
1183-
1183+
11841184
Note: Despite the name "move_file_to", this tool COPIES the file to preserve the original.
11851185
This prevents data loss during file processing workflows.
11861186

ui/components.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ def file_input_component(task_counter: int) -> Optional[str]:
368368
# Save uploaded file using cross-platform file handler
369369
try:
370370
import sys
371-
import os
372371
from pathlib import Path
373372

374373
# Add project root to path for imports
@@ -389,15 +388,17 @@ def file_input_component(task_counter: int) -> Optional[str]:
389388
original_file_path = file_handler.create_safe_temp_file(
390389
suffix=f".{file_ext}",
391390
prefix=f"upload_{uploaded_file.name.split('.')[0]}_",
392-
content=uploaded_file.getvalue()
391+
content=uploaded_file.getvalue(),
393392
)
394393

395394
st.success("✅ File uploaded successfully!")
396395

397396
# Check if file is already PDF
398397
if file_ext == "pdf":
399398
st.info("📑 File is already in PDF format, no conversion needed.")
400-
return str(original_file_path) # Convert Path to string for compatibility
399+
return str(
400+
original_file_path
401+
) # Convert Path to string for compatibility
401402

402403
# Convert to PDF
403404
with st.spinner(f"🔄 Converting {file_ext.upper()} to PDF..."):

ui/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,13 @@ def cleanup_temp_file(input_source: str, input_type: str):
583583
if input_type == "file" and input_source:
584584
try:
585585
from utils.cross_platform_file_handler import get_file_handler
586+
586587
file_handler = get_file_handler()
587588
file_handler.safe_remove_file(input_source)
588589
except Exception as e:
589590
# Log but don't fail - cleanup is best effort
590591
import logging
592+
591593
logging.getLogger(__name__).warning(
592594
f"Failed to cleanup temp file {input_source}: {e}"
593595
)

0 commit comments

Comments
 (0)