import os
import shutil
root_dir = "/Users/richard/projects/rust/agentic_ssh"
mcp_src = os.path.join(root_dir, "mcp-agent-install", "src")
target_agents_dir = os.path.join(root_dir, "src", "agents")
print("Re-creating src/agents directory...")
os.makedirs(target_agents_dir, exist_ok=True)
files = os.listdir(mcp_src)
for filename in files:
src_file = os.path.join(mcp_src, filename)
if os.path.isfile(src_file):
if filename == "lib.rs":
dest_file = os.path.join(target_agents_dir, "mod.rs")
print(f"Moving lib.rs to {dest_file}")
shutil.move(src_file, dest_file)
elif filename == "errors.rs":
dest_file = os.path.join(root_dir, "src", "errors.rs")
print(f"Moving errors.rs to {dest_file}")
shutil.move(src_file, dest_file)
else:
dest_file = os.path.join(target_agents_dir, filename)
print(f"Moving {filename} to {dest_file}")
shutil.move(src_file, dest_file)
print("Removing mcp-agent-install folder...")
shutil.rmtree(os.path.join(root_dir, "mcp-agent-install"), ignore_errors=True)
print("Done merging files back!")