Skip to content

Commit 2d29ffd

Browse files
committed
first commit
0 parents  commit 2d29ffd

58 files changed

Lines changed: 10499 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

6 KB
Binary file not shown.

.dockerignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Docker
6+
Dockerfile*
7+
docker-compose*
8+
.dockerignore
9+
10+
# Environment files
11+
.env
12+
.env.*
13+
!env.example
14+
15+
# Python
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
*.so
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
37+
# Virtual environments
38+
.ven
39+
env/
40+
ENV/
41+
42+
# IDE
43+
.vscode/
44+
.idea/
45+
*.swp
46+
*.swo
47+
*~
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db
52+
53+
# Logs
54+
*.log
55+
logs/
56+
57+
# Output directories (will be mounted as volumes)
58+
output/
59+
trajectories/
60+
61+
# Test data
62+
data/raw_test_repo/
63+
data/raw_test_repo_simple/
64+
65+
# Documentation build
66+
docs/_build/
67+
docs/.doctrees/
68+
69+
# Cache
70+
.cache/
71+
.pytest_cache/
72+
.mypy_cache/
73+
.coverage
74+
htmlcov/
75+
76+
# Temporary files
77+
*.tmp
78+
*.temp
79+
.tmp/
80+
.temp/

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
config/agent_config.yaml
2+
tool/add_header.sh
3+
4+
.venv
5+
__pycache__/
6+
*.egg-info
7+
*.ipynb
8+
output/
9+
data/
10+
src/output/
11+
repo_data/
12+
.env*
13+
*.env
14+
**/.env
15+
**/.env.*

DOCKER_README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# DeepwikiAgent Docker Setup
2+
3+
This document explains how to run DeepwikiAgent using Docker and Docker Compose.
4+
5+
## Quick Start
6+
7+
1. **Clone the repository** (if not already done):
8+
```bash
9+
git clone <repository-url>
10+
cd DeepwikiAgent
11+
```
12+
13+
2. **Set up environment variables**:
14+
```bash
15+
cp env.example .env
16+
# Edit .env file with your API keys
17+
```
18+
19+
3. **Create network**
20+
```bash
21+
docker network create deepwiki-agent-network
22+
```
23+
24+
3. **Start the services**:
25+
```bash
26+
docker-compose up -d
27+
```
28+
29+
4. **Access the application**:
30+
- Main web app: http://localhost:8000

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Use Python 3.11 slim image as base
2+
FROM python:3.12-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Install system dependencies
8+
RUN apt-get update && apt-get install -y \
9+
git \
10+
curl \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Copy requirements first for better caching
14+
COPY requirements.txt .
15+
16+
# Install Python dependencies
17+
RUN pip install --no-cache-dir -r requirements.txt
18+
19+
# Copy application code
20+
COPY . .
21+
22+
# Create output directories
23+
RUN mkdir -p output/cache output/temp output/docs output/dependency_graphs
24+
25+
# Set environment variables
26+
ENV PYTHONPATH=/app/src
27+
ENV PYTHONUNBUFFERED=1
28+
29+
# Expose port
30+
EXPOSE 8000
31+
32+
# Health check
33+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
34+
CMD curl -f http://localhost:8000/ || exit 1
35+
36+
# Default command
37+
CMD ["python", "run_web_app.py", "--host", "0.0.0.0", "--port", "8000"]

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
```bash
2+
python3.12 -m venv .venv
3+
source .venv/bin/activate
4+
pip install -r requirements.txt
5+
python run_web_app.py
6+
```
7+
8+
Check networking for Mermaid validator
9+
```python
10+
import mermaid as md
11+
12+
error_mermaid = """
13+
graph TB
14+
subgraph "Core Agent System"
15+
A[DefaultAgent] --> B[Agent Execution]
16+
B --> C[Step Processing]
17+
C --> D[Action Execution]
18+
end
19+
20+
subgraph "Hook System"
21+
E[CombinedAgentHook] --> F[Hook 1]
22+
E --> G[Hook 2]
23+
E --> H[Hook N]
24+
end
25+
26+
subgraph "Event Flow"
27+
I[on_init] --> J[on_run_start]
28+
J --> K[on_step_start]
29+
K --> L[on_actions_generated]
30+
L --> M[on_action_started]
31+
M --> N[on_action_executed]
32+
N --> O[on_step_done]
33+
O --> P{More Steps?}
34+
P -->|Yes| K
35+
P -->|No| Q[on_run_done]
36+
end
37+
38+
A -.-> E : uses hooks
39+
B -.-> I
40+
C -.-> K
41+
D -.-> M
42+
43+
style E fill:#e1f5fe
44+
style A fill:#f3e5f5
45+
"""
46+
47+
true_mermaid = """
48+
graph TB
49+
subgraph "CLI Configuration Module"
50+
A[Main CLI Entry Point<br/>sweagent.run.run.main] --> B[Command Router]
51+
C[BasicCLI Configuration System<br/>sweagent.run.common.BasicCLI] --> D[Config Validation]
52+
53+
B --> E[Execution Commands]
54+
B --> F[Analysis Commands]
55+
B --> G[Inspector Commands]
56+
57+
E --> H[Single Execution<br/>run]
58+
E --> I[Batch Execution<br/>run-batch]
59+
E --> J[Replay Execution<br/>run-replay]
60+
E --> K[Shell Execution<br/>shell]
61+
62+
F --> L[Merge Predictions<br/>merge-preds]
63+
F --> M[Extract Predictions<br/>extract-pred]
64+
F --> N[Compare Runs<br/>compare-runs]
65+
F --> O[Quick Stats<br/>quick-stats]
66+
F --> P[Remove Unfinished<br/>remove-unfinished]
67+
68+
G --> Q[Terminal Inspector<br/>inspect]
69+
G --> R[Web Inspector<br/>inspector]
70+
end
71+
72+
subgraph "External Dependencies"
73+
S[execution_engines.md]
74+
T[inspector_tools.md]
75+
U[analysis_utilities.md]
76+
end
77+
78+
H --> S
79+
I --> S
80+
J --> S
81+
K --> S
82+
Q --> T
83+
R --> T
84+
L --> U
85+
M --> U
86+
N --> U
87+
O --> U
88+
P --> U
89+
90+
style A fill:#e1f5fe
91+
style C fill:#e8f5e8
92+
style B fill:#fff3e0
93+
"""
94+
95+
render = md.Mermaid(error_mermaid)
96+
print(render.svg_response.text[:50])
97+
# => Parse error on line 26:\n... end A -.-> E : use
98+
99+
render = md.Mermaid(true_mermaid)
100+
print(render.svg_response.text[:50])
101+
# => <svg id="mermaid-svg" width="100%" xmlns="http://w
102+
```

docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: '3.8'
2+
3+
services:
4+
5+
# DeepwikiAgent Web Application
6+
deepwiki-agent:
7+
image: deepwiki-agent:0.0.1
8+
build:
9+
context: .
10+
dockerfile: Dockerfile
11+
container_name: deepwiki-agent
12+
ports:
13+
- "${APP_PORT:-8000}:8000"
14+
environment:
15+
- PYTHONPATH=/app/src
16+
- PYTHONUNBUFFERED=1
17+
env_file:
18+
- .env
19+
networks:
20+
- net
21+
volumes:
22+
# Persistent storage for cache and output
23+
- ./output:/app/output
24+
# Git credentials (if needed for private repos)
25+
- ~/.gitconfig:/root/.gitconfig:ro
26+
- ~/.ssh:/root/.ssh:ro
27+
restart: unless-stopped
28+
healthcheck:
29+
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
30+
interval: 30s
31+
timeout: 10s
32+
retries: 3
33+
start_period: 20s
34+
35+
networks:
36+
net:
37+
external: true
38+
name: deepwiki-agent-network

env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# DeepwikiAgent Environment Configuration
2+
# Copy this file to .env and fill in your API keys
3+
4+
# =============================================================================
5+
# LLM API Keys
6+
# =============================================================================
7+
8+
MAIN_MODEL = claude-sonnet-4
9+
FALLBACK_MODEL_1 = glm-4p5
10+
LLM_BASE_URL = http://litellm:4000/
11+
LLM_API_KEY = sk-1234
12+
13+
14+
# =============================================================================
15+
# Application Configuration
16+
# =============================================================================
17+
18+
# Port for the main web application
19+
APP_PORT=8000
20+

0 commit comments

Comments
 (0)