vasanthfeb13 commited on
Commit
6922580
Β·
1 Parent(s): 4663b65

Fix: Remove ALL remaining macbook-local references (conversational_ui, HTML, examples)

Browse files
src/nacc_orchestrator/server.py CHANGED
@@ -224,7 +224,7 @@ def create_app(service: OrchestratorService) -> FastAPI:
224
  "sync_files": {
225
  "description": "Share or sync files between nodes (e.g., from Kali to Mac)",
226
  "parameters": ["source_path", "target_nodes"],
227
- "examples": ["share test.txt from kali-vm to macbook-local", "sync file.txt to mac", "copy data.json from kali to macbook"]
228
  },
229
  "execute_command": {
230
  "description": "Execute a shell command on current node",
@@ -947,7 +947,7 @@ connect to 473293 at 192.168.1.50 and name it as vasanth-laptop
947
  }
948
  else:
949
  return {
950
- "response": "❌ Could not determine sync parameters. Please specify: `share file.txt from kali-vm to macbook-local`",
951
  "context": context
952
  }
953
 
 
224
  "sync_files": {
225
  "description": "Share or sync files between nodes (e.g., from Kali to Mac)",
226
  "parameters": ["source_path", "target_nodes"],
227
+ "examples": ["share test.txt from vm-node-01 to hf-space-local", "sync file.txt to local", "copy data.json from vm to local"]
228
  },
229
  "execute_command": {
230
  "description": "Execute a shell command on current node",
 
947
  }
948
  else:
949
  return {
950
+ "response": "❌ Could not determine sync parameters. Please specify: `share file.txt from vm-node-01 to hf-space-local`",
951
  "context": context
952
  }
953
 
src/nacc_ui/conversational_ui.py CHANGED
@@ -60,7 +60,7 @@ class SessionState:
60
  self.conversation_history: List[Dict[str, Any]] = []
61
  self.tool_execution_log: List[Dict[str, Any]] = []
62
  self.context_window_size = 10 # Last N messages for AI context
63
- self.current_node = "macbook-local" # Default to local Mac
64
  self.current_path = get_nacc_workspace() # Dynamic workspace
65
  self.created_at = datetime.now()
66
 
@@ -417,7 +417,7 @@ class NACCConversationUI:
417
  ai_response = f"πŸ“„ **File Contents**: `{Path(filepath).name}`\n\n```\n{stdout[:500]}{'...' if len(stdout) > 500 else ''}\n```"
418
  right_panel = self.render_file_content(Path(filepath).name, stdout)
419
  else:
420
- ai_response = f"❌ Could not read file: {filepath}"
421
  right_panel = f"<div class='error'>File not found or not readable</div>"
422
  else:
423
  ai_response = f"❌ Error reading file: {result.get('error', 'Unknown error')}"
@@ -481,7 +481,7 @@ class NACCConversationUI:
481
  # Also try to extract names in quotes or after common prepositions
482
  if not filename:
483
  for i, word in enumerate(words):
484
- if word.lower() in ["nacc", "config", "node-config.yml", "src", "Documents"]:
485
  filename = word
486
  break
487
 
@@ -539,15 +539,15 @@ class NACCConversationUI:
539
 
540
  # Extract target nodes (simplified)
541
  target_nodes = []
542
- if "macos" in message_lower:
543
- target_nodes.append("macos-node")
544
  if "kali" in message_lower:
545
  target_nodes.append("kali-vm")
546
 
547
  if target_nodes:
548
  result = self.tool_sync_files(session.current_node, target_nodes)
549
  if "error" not in result:
550
- ai_response = f"Perfect! οΏ½ Using **sync_files** tool.\n\nSyncing files from **{session.current_node}** to {', '.join(target_nodes)}..."
551
  right_panel = f"<div class='success'>Sync initiated to {len(target_nodes)} node(s)</div>"
552
  else:
553
  ai_response = f"Sync encountered an error: {result.get('error')}"
@@ -678,7 +678,7 @@ class NACCConversationUI:
678
  html += f"""
679
  <div>πŸ’» <strong>CPU:</strong> {metrics.get('cpu_percent', 0):.1f}%</div>
680
  <div>πŸ’Ύ <strong>Memory:</strong> {metrics.get('memory_percent', 0):.1f}%</div>
681
- <div>οΏ½ <strong>Disk:</strong> {metrics.get('disk_percent', 0):.1f}%</div>
682
  """
683
 
684
  html += """
@@ -873,7 +873,7 @@ def create_ui():
873
  ["Navigate to file A and share the contents to me"],
874
  ["Can you show me the nodes of NACC?"],
875
  ["Add a print statement to the Python file"],
876
- ["Transfer this file to my macOS"]
877
  ],
878
  inputs=msg
879
  )
 
60
  self.conversation_history: List[Dict[str, Any]] = []
61
  self.tool_execution_log: List[Dict[str, Any]] = []
62
  self.context_window_size = 10 # Last N messages for AI context
63
+ self.current_node = "hf-space-local" # Default to HF Space local node
64
  self.current_path = get_nacc_workspace() # Dynamic workspace
65
  self.created_at = datetime.now()
66
 
 
417
  ai_response = f"πŸ“„ **File Contents**: `{Path(filepath).name}`\n\n```\n{stdout[:500]}{'...' if len(stdout) > 500 else ''}\n```"
418
  right_panel = self.render_file_content(Path(filepath).name, stdout)
419
  else:
420
+ ai_response = f"❌ Could not determine sync parameters. Please specify: `share file.txt from vm-node-01 to hf-space-local`"
421
  right_panel = f"<div class='error'>File not found or not readable</div>"
422
  else:
423
  ai_response = f"❌ Error reading file: {result.get('error', 'Unknown error')}"
 
481
  # Also try to extract names in quotes or after common prepositions
482
  if not filename:
483
  for i, word in enumerate(words):
484
+ if word.lower() in ["nacc", "config", "node-config.yml", "src", "documents"]:
485
  filename = word
486
  break
487
 
 
539
 
540
  # Extract target nodes (simplified)
541
  target_nodes = []
542
+ if "hf-space-local" in message_lower:
543
+ target_nodes.append("hf-space-local")
544
  if "kali" in message_lower:
545
  target_nodes.append("kali-vm")
546
 
547
  if target_nodes:
548
  result = self.tool_sync_files(session.current_node, target_nodes)
549
  if "error" not in result:
550
+ ai_response = f"Perfect! Using **sync_files** tool.\n\nSyncing files from **{session.current_node}** to {', '.join(target_nodes)}..."
551
  right_panel = f"<div class='success'>Sync initiated to {len(target_nodes)} node(s)</div>"
552
  else:
553
  ai_response = f"Sync encountered an error: {result.get('error')}"
 
678
  html += f"""
679
  <div>πŸ’» <strong>CPU:</strong> {metrics.get('cpu_percent', 0):.1f}%</div>
680
  <div>πŸ’Ύ <strong>Memory:</strong> {metrics.get('memory_percent', 0):.1f}%</div>
681
+ <div> <strong>Disk:</strong> {metrics.get('disk_percent', 0):.1f}%</div>
682
  """
683
 
684
  html += """
 
873
  ["Navigate to file A and share the contents to me"],
874
  ["Can you show me the nodes of NACC?"],
875
  ["Add a print statement to the Python file"],
876
+ ["Transfer this file to my hf-space-local"]
877
  ],
878
  inputs=msg
879
  )
src/nacc_ui/professional_ui_v2.py CHANGED
@@ -577,7 +577,7 @@ def create_professional_ui_v2():
577
  """
578
  <div style="display: flex; justify-content: space-between; font-size: 0.8em; color: #64748b; margin-top: 5px; margin-bottom: 20px;">
579
  <span>⚠️ Blaxel Sandbox: 30-70s processing</span>
580
- <span>Context: macbook-local</span>
581
  </div>
582
  """
583
  )
 
577
  """
578
  <div style="display: flex; justify-content: space-between; font-size: 0.8em; color: #64748b; margin-top: 5px; margin-bottom: 20px;">
579
  <span>⚠️ Blaxel Sandbox: 30-70s processing</span>
580
+ <span>Context: hf-space-local</span>
581
  </div>
582
  """
583
  )