-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopulate_repository.py
81 lines (66 loc) · 2.24 KB
/
populate_repository.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from github_integration import GitHubIntegration
from pathlib import Path
def get_all_project_files():
"""Get all relevant project files."""
files = []
# Python files
python_files = [
'main.py', 'app.py', 'github_integration.py',
'test_github_integration.py'
]
# Agent files
agent_files = [
'agents/__init__.py', 'agents/base_agent.py',
'agents/project_manager.py', 'agents/developer.py',
'agents/tester.py', 'agents/devops.py',
'agents/business_analyst.py', 'agents/ux_designer.py'
]
# Template files
template_files = [
'templates/index.html', 'templates/agent_relationships.html',
'templates/github_init.html'
]
# Static files
static_files = [
'static/css/custom.css',
'static/js/main.js',
'static/js/agent_graph.js'
]
# Configuration files
config_files = [
'.replit', 'replit.nix', 'pyproject.toml', 'uv.lock'
]
all_files = python_files + agent_files + template_files + static_files + config_files
for file_path in all_files:
if Path(file_path).exists():
files.append({
'path': file_path,
'type': Path(file_path).suffix[1:] # Get file extension without dot
})
return files
def main():
"""Main function to populate the repository."""
github = GitHubIntegration()
repo_name = 'ai-team-simulation'
# Get all project files
files = get_all_project_files()
# Initialize repository
init_result = github.initialize_repository(repo_name)
if not init_result['success']:
print(f"Failed to initialize repository: {init_result['error']}")
return False
# Commit files
commit_result = github.commit_files(
repo_name=repo_name,
files=files,
commit_message="Initial commit: Add all project files"
)
if commit_result['success']:
print(f"Successfully populated repository: {init_result['repo_url']}")
print(f"Committed {len(files)} files")
return True
else:
print(f"Failed to commit files: {commit_result['error']}")
return False
if __name__ == '__main__':
main()