sourcebot 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sourcebot-0.1.0/.gitignore +40 -0
- sourcebot-0.1.0/PKG-INFO +318 -0
- sourcebot-0.1.0/README.md +286 -0
- sourcebot-0.1.0/pyproject.toml +58 -0
- sourcebot-0.1.0/requirements.txt +10 -0
- sourcebot-0.1.0/setup.cfg +4 -0
- sourcebot-0.1.0/src/sourcebot/__init__.py +9 -0
- sourcebot-0.1.0/src/sourcebot/__main__.py +17 -0
- sourcebot-0.1.0/src/sourcebot/bus/__init__.py +4 -0
- sourcebot-0.1.0/src/sourcebot/bus/channel_adapter.py +21 -0
- sourcebot-0.1.0/src/sourcebot/bus/event_bus.py +15 -0
- sourcebot-0.1.0/src/sourcebot/bus/message_models.py +33 -0
- sourcebot-0.1.0/src/sourcebot/bus/outbound_dispatcher.py +15 -0
- sourcebot-0.1.0/src/sourcebot/bus/session_manager.py +20 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/core/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/core/command_line.py +26 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/init_commands/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/init_commands/init_global_config.py +30 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/init_commands/init_workspace_config.py +18 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/run_commands/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/run_commands/command_line_tool.py +345 -0
- sourcebot-0.1.0/src/sourcebot/cli/commands/run_commands/safe_runner.py +47 -0
- sourcebot-0.1.0/src/sourcebot/cli/main.py +28 -0
- sourcebot-0.1.0/src/sourcebot/config/__init__.py +15 -0
- sourcebot-0.1.0/src/sourcebot/config/base.py +13 -0
- sourcebot-0.1.0/src/sourcebot/config/config_manager.py +367 -0
- sourcebot-0.1.0/src/sourcebot/config/exceptions.py +4 -0
- sourcebot-0.1.0/src/sourcebot/config/global_config.py +55 -0
- sourcebot-0.1.0/src/sourcebot/config/provider_config.py +62 -0
- sourcebot-0.1.0/src/sourcebot/config/workspace_config.py +106 -0
- sourcebot-0.1.0/src/sourcebot/context/__init__.py +5 -0
- sourcebot-0.1.0/src/sourcebot/context/context_builder.py +78 -0
- sourcebot-0.1.0/src/sourcebot/context/identity.py +19 -0
- sourcebot-0.1.0/src/sourcebot/context/message_builder.py +154 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/__init__.py +7 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill.py +11 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill_context.py +10 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill_loader.py +57 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill_metadata.py +27 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill_requirements.py +25 -0
- sourcebot-0.1.0/src/sourcebot/context/skill/skill_summary.py +31 -0
- sourcebot-0.1.0/src/sourcebot/conversation/__init__.py +2 -0
- sourcebot-0.1.0/src/sourcebot/conversation/service.py +191 -0
- sourcebot-0.1.0/src/sourcebot/docker_sandbox/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/docker_sandbox/docker_sandbox.py +113 -0
- sourcebot-0.1.0/src/sourcebot/llm/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/llm/anthropic/__init__.py +2 -0
- sourcebot-0.1.0/src/sourcebot/llm/anthropic/adapter.py +30 -0
- sourcebot-0.1.0/src/sourcebot/llm/anthropic/anthropic_llm_client.py +38 -0
- sourcebot-0.1.0/src/sourcebot/llm/anthropic/converter.py +59 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/adapter.py +16 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/client.py +16 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/delta.py +12 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/message.py +53 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/message_converter.py +33 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/response.py +30 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/tool.py +7 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/tool_converter.py +30 -0
- sourcebot-0.1.0/src/sourcebot/llm/core/tool_delta_aggregator.py +38 -0
- sourcebot-0.1.0/src/sourcebot/llm/llm_client_factory.py +13 -0
- sourcebot-0.1.0/src/sourcebot/llm/openai/__init__.py +2 -0
- sourcebot-0.1.0/src/sourcebot/llm/openai/adapter.py +27 -0
- sourcebot-0.1.0/src/sourcebot/llm/openai/converter.py +53 -0
- sourcebot-0.1.0/src/sourcebot/llm/openai/openai_llm_client.py +47 -0
- sourcebot-0.1.0/src/sourcebot/logging/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/logging/setup.py +33 -0
- sourcebot-0.1.0/src/sourcebot/memory/__init__.py +5 -0
- sourcebot-0.1.0/src/sourcebot/memory/file_store.py +23 -0
- sourcebot-0.1.0/src/sourcebot/memory/llm_consolidator.py +79 -0
- sourcebot-0.1.0/src/sourcebot/memory/service.py +116 -0
- sourcebot-0.1.0/src/sourcebot/memory/window_policy.py +36 -0
- sourcebot-0.1.0/src/sourcebot/prompt/__init__.py +4 -0
- sourcebot-0.1.0/src/sourcebot/prompt/deeomposer_prompt.py +420 -0
- sourcebot-0.1.0/src/sourcebot/prompt/identity_prompt.py +98 -0
- sourcebot-0.1.0/src/sourcebot/prompt/subagent_prompt.py +25 -0
- sourcebot-0.1.0/src/sourcebot/runtime/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/runtime/agent/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/runtime/agent/agent.py +130 -0
- sourcebot-0.1.0/src/sourcebot/runtime/agent/agent_factory.py +83 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/planner/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/planner/dag_planner.py +26 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/planner/execution_scheduler.py +35 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/planner/parallelism_optimizer.py +44 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/planner/task_decomposer.py +37 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/dag_scheduler.py +319 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/retry_policy.py +27 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/run_store.py +58 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/state_store.py +40 -0
- sourcebot-0.1.0/src/sourcebot/runtime/dag/scheduler/task_graph.py +29 -0
- sourcebot-0.1.0/src/sourcebot/runtime/init_system.py +182 -0
- sourcebot-0.1.0/src/sourcebot/runtime/tool_executor.py +30 -0
- sourcebot-0.1.0/src/sourcebot/security/policy.py +23 -0
- sourcebot-0.1.0/src/sourcebot/session/__init__.py +4 -0
- sourcebot-0.1.0/src/sourcebot/session/jsonl_repository.py +142 -0
- sourcebot-0.1.0/src/sourcebot/session/repository.py +19 -0
- sourcebot-0.1.0/src/sourcebot/session/service.py +44 -0
- sourcebot-0.1.0/src/sourcebot/session/session.py +53 -0
- sourcebot-0.1.0/src/sourcebot/storage/__init__.py +3 -0
- sourcebot-0.1.0/src/sourcebot/storage/rules_loader.py +72 -0
- sourcebot-0.1.0/src/sourcebot/storage/skill_storage.py +51 -0
- sourcebot-0.1.0/src/sourcebot/tools/__init__.py +7 -0
- sourcebot-0.1.0/src/sourcebot/tools/base.py +182 -0
- sourcebot-0.1.0/src/sourcebot/tools/registry.py +81 -0
- sourcebot-0.1.0/src/sourcebot/tools/rule_detail.py +70 -0
- sourcebot-0.1.0/src/sourcebot/tools/rule_list.py +57 -0
- sourcebot-0.1.0/src/sourcebot/tools/shell.py +93 -0
- sourcebot-0.1.0/src/sourcebot/tools/skill_detail.py +61 -0
- sourcebot-0.1.0/src/sourcebot/tools/skill_list.py +68 -0
- sourcebot-0.1.0/src/sourcebot/utils/__init__.py +2 -0
- sourcebot-0.1.0/src/sourcebot/utils/output.py +79 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/PKG-INFO +318 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/SOURCES.txt +115 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/dependency_links.txt +1 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/entry_points.txt +2 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/requires.txt +16 -0
- sourcebot-0.1.0/src/sourcebot.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.coverage
|
|
9
|
+
htmlcov/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
*.egg
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
|
|
15
|
+
# 日志文件
|
|
16
|
+
*.log
|
|
17
|
+
sourcebot.log
|
|
18
|
+
|
|
19
|
+
# 工作区数据(根据你的需求决定是否忽略)
|
|
20
|
+
workspace/
|
|
21
|
+
src/workspace/
|
|
22
|
+
src/sourcebot/workspace/
|
|
23
|
+
document/进度/
|
|
24
|
+
|
|
25
|
+
# IDE
|
|
26
|
+
.vscode/
|
|
27
|
+
.idea/
|
|
28
|
+
*.swp
|
|
29
|
+
*.swo
|
|
30
|
+
*~
|
|
31
|
+
|
|
32
|
+
# 系统文件
|
|
33
|
+
.DS_Store
|
|
34
|
+
Thumbs.db
|
|
35
|
+
|
|
36
|
+
# 虚拟环境
|
|
37
|
+
venv/
|
|
38
|
+
env/
|
|
39
|
+
.env
|
|
40
|
+
.venv
|
sourcebot-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sourcebot
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: An experimental autonomous coding agent framework with DAG execution, tool use, and CLI interface.
|
|
5
|
+
Author: DavidVi2Bot
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/DavidVi2Bot/sourcebot
|
|
8
|
+
Project-URL: Repository, https://github.com/DavidVi2Bot/sourcebot
|
|
9
|
+
Project-URL: Issues, https://github.com/DavidVi2Bot/sourcebot/issues
|
|
10
|
+
Keywords: ai,agent,llm,automation,devin
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: cmd2>=2.4.0
|
|
18
|
+
Requires-Dist: docker>=6.0.0
|
|
19
|
+
Requires-Dist: pydantic>=2.0
|
|
20
|
+
Requires-Dist: PyYAML>=6.0
|
|
21
|
+
Requires-Dist: rich>=13.0
|
|
22
|
+
Requires-Dist: typer>=0.9.0
|
|
23
|
+
Requires-Dist: openai>=1.0.0
|
|
24
|
+
Requires-Dist: loguru>=0.7.0
|
|
25
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
26
|
+
Requires-Dist: networkx>=3.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
30
|
+
Requires-Dist: black; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
|
|
33
|
+
# 🚀 SourceBot
|
|
34
|
+
|
|
35
|
+
> ⚡ A Devin-style autonomous coding agent framework
|
|
36
|
+
> Plan → Execute → Iterate with DAG-based workflows
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
## ⚡ TL;DR
|
|
40
|
+
|
|
41
|
+
SourceBot is an autonomous agent runtime that:
|
|
42
|
+
|
|
43
|
+
- Plans tasks as a DAG
|
|
44
|
+
- Executes them with tools + LLMs
|
|
45
|
+
- Maintains memory and state
|
|
46
|
+
- Supports retry, resume, and parallel execution
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🔥 Why SourceBot?
|
|
51
|
+
|
|
52
|
+
Most AI tools today are **chat-based**.
|
|
53
|
+
|
|
54
|
+
SourceBot is different.
|
|
55
|
+
|
|
56
|
+
It is built to **plan, execute, and iterate** — like a real developer.
|
|
57
|
+
|
|
58
|
+
* 🧠 Plans tasks using a DAG (not linear prompts)
|
|
59
|
+
* 🔧 Uses tools (shell, skills, APIs)
|
|
60
|
+
* 🔁 Retries, resumes, and replays execution
|
|
61
|
+
* 💾 Maintains memory across steps
|
|
62
|
+
* 🐳 Runs safely in sandboxed environments
|
|
63
|
+
|
|
64
|
+
> This is not a chatbot.
|
|
65
|
+
> This is an **agent runtime**.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 🎬 Demo
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
sourcebot init
|
|
73
|
+
sourcebot init_workspace
|
|
74
|
+
sourcebot cli
|
|
75
|
+
```
|
|
76
|
+
> ⚡ Example: Build a Python HTTP server autonomously
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
> ⚡ Demo is shortened for clarity
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🧠 What Makes It Different
|
|
85
|
+
|
|
86
|
+
### 🔀 DAG-Based Execution (Core Innovation)
|
|
87
|
+
|
|
88
|
+
Unlike traditional agents:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Prompt → LLM → Response
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
SourceBot:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
Task
|
|
98
|
+
↓
|
|
99
|
+
Decomposition
|
|
100
|
+
↓
|
|
101
|
+
DAG Graph
|
|
102
|
+
↓
|
|
103
|
+
Parallel Execution
|
|
104
|
+
↓
|
|
105
|
+
Tool + LLM Calls
|
|
106
|
+
↓
|
|
107
|
+
State + Memory Update
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
✅ Parallelizable
|
|
111
|
+
✅ Retryable
|
|
112
|
+
✅ Resumable
|
|
113
|
+
✅ Observable
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🧩 Core Features
|
|
118
|
+
|
|
119
|
+
### 🧠 Agent Runtime
|
|
120
|
+
|
|
121
|
+
* Modular architecture
|
|
122
|
+
* Identity + context system
|
|
123
|
+
* Multi-provider LLM abstraction
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### 🔀 DAG Execution Engine
|
|
128
|
+
|
|
129
|
+
* Task decomposition
|
|
130
|
+
* Parallel scheduling
|
|
131
|
+
* Retry policies
|
|
132
|
+
* Run state persistence
|
|
133
|
+
* Partial replay
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### 🛠 Tool System
|
|
138
|
+
|
|
139
|
+
* Tool registry
|
|
140
|
+
* Shell execution
|
|
141
|
+
* Skill-based extensions
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### 💾 Memory System
|
|
146
|
+
|
|
147
|
+
* Sliding window memory
|
|
148
|
+
* LLM-based summarization
|
|
149
|
+
* Persistent storage
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### 💬 CLI Interface
|
|
154
|
+
|
|
155
|
+
* Interactive agent shell
|
|
156
|
+
* Safe runner
|
|
157
|
+
* Workspace bootstrap
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### 🐳 Sandbox Execution
|
|
162
|
+
|
|
163
|
+
* Docker isolation
|
|
164
|
+
* Safe tool execution
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 🏗 Architecture
|
|
169
|
+
|
|
170
|
+
### 🔷 High-Level Architecture
|
|
171
|
+
|
|
172
|
+
```mermaid
|
|
173
|
+
graph TD
|
|
174
|
+
U[User] --> CLI[CLI Interface]
|
|
175
|
+
CLI --> AR[Agent Runtime]
|
|
176
|
+
AR --> DP[DAG Planner]
|
|
177
|
+
DP --> TG[Task Graph]
|
|
178
|
+
TG --> DS[DAG Scheduler]
|
|
179
|
+
DS --> TE[Tool Executor]
|
|
180
|
+
DS --> LLM[LLM Clients]
|
|
181
|
+
TE --> SB[Docker Sandbox]
|
|
182
|
+
LLM --> MEM[Memory System]
|
|
183
|
+
SB --> MEM
|
|
184
|
+
MEM --> OUT[Output]
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### 🔷 Execution Flow
|
|
190
|
+
|
|
191
|
+
```mermaid
|
|
192
|
+
graph LR
|
|
193
|
+
A[User Task] --> B[Task Decomposition]
|
|
194
|
+
B --> C[DAG Generation]
|
|
195
|
+
C --> D[Parallel Execution]
|
|
196
|
+
D --> E[Tool Calls / LLM]
|
|
197
|
+
E --> F[State Update]
|
|
198
|
+
F --> G[Final Result]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 📁 Project Structure
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
sourcebot/
|
|
207
|
+
├── bus/ # Event system
|
|
208
|
+
├── cli/ # CLI interface
|
|
209
|
+
├── config/ # Config system
|
|
210
|
+
├── context/ # Context + skills
|
|
211
|
+
├── conversation/ # Conversation layer
|
|
212
|
+
├── docker_sandbox/ # Execution isolation
|
|
213
|
+
├── llm/ # LLM abstraction
|
|
214
|
+
├── memory/ # Memory system
|
|
215
|
+
├── runtime/ # Agent + DAG engine
|
|
216
|
+
├── tools/ # Tooling system
|
|
217
|
+
├── session/ # Persistence
|
|
218
|
+
└── utils/ # Utilities
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🚀 Installation
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
git clone https://github.com/DavidVi2Bot/sourcebot.git
|
|
227
|
+
cd sourcebot
|
|
228
|
+
pip install -e .
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 🧪 Development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
pip install -r requirements-dev.txt
|
|
237
|
+
pytest
|
|
238
|
+
black .
|
|
239
|
+
ruff check .
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 🛣 Roadmap
|
|
245
|
+
|
|
246
|
+
### 🧱 Core
|
|
247
|
+
|
|
248
|
+
* [x] DAG execution engine
|
|
249
|
+
* [x] Tool system
|
|
250
|
+
* [x] CLI runtime
|
|
251
|
+
* [x] Memory system
|
|
252
|
+
|
|
253
|
+
### 🚧 Next
|
|
254
|
+
|
|
255
|
+
* [ ] Web UI (IDE-like)
|
|
256
|
+
* [ ] Multi-agent collaboration
|
|
257
|
+
* [ ] Plugin / marketplace system
|
|
258
|
+
* [ ] Long-term memory (vector DB)
|
|
259
|
+
* [ ] Remote execution / cloud runtime
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🧠 Vision
|
|
264
|
+
|
|
265
|
+
SourceBot aims to become a **general-purpose autonomous agent framework**:
|
|
266
|
+
|
|
267
|
+
* 🧑💻 Coding agents (Devin-style)
|
|
268
|
+
* ⚙️ DevOps automation
|
|
269
|
+
* 🔬 Research agents
|
|
270
|
+
* 🔄 Workflow orchestration
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## ⚠️ Status
|
|
275
|
+
|
|
276
|
+
> 🚧 Alpha — rapidly evolving
|
|
277
|
+
|
|
278
|
+
Expect breaking changes and fast iteration.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 🤝 Contributing
|
|
283
|
+
|
|
284
|
+
We welcome contributions!
|
|
285
|
+
|
|
286
|
+
* Bug reports
|
|
287
|
+
* Feature ideas
|
|
288
|
+
* Tools / skills
|
|
289
|
+
* Documentation improvements
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## ⭐ Star History
|
|
294
|
+
|
|
295
|
+
If this project interests you, give it a ⭐ — it helps a lot!
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 📄 License
|
|
300
|
+
|
|
301
|
+
MIT License
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 🚀 Hacker News Title Ideas
|
|
306
|
+
|
|
307
|
+
* Show HN: SourceBot – A DAG-based autonomous coding agent framework
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 💥 Final Thought
|
|
313
|
+
|
|
314
|
+
> Chatbots answer.
|
|
315
|
+
>
|
|
316
|
+
> Agents act.
|
|
317
|
+
>
|
|
318
|
+
> **SourceBot executes.**
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# 🚀 SourceBot
|
|
2
|
+
|
|
3
|
+
> ⚡ A Devin-style autonomous coding agent framework
|
|
4
|
+
> Plan → Execute → Iterate with DAG-based workflows
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
## ⚡ TL;DR
|
|
8
|
+
|
|
9
|
+
SourceBot is an autonomous agent runtime that:
|
|
10
|
+
|
|
11
|
+
- Plans tasks as a DAG
|
|
12
|
+
- Executes them with tools + LLMs
|
|
13
|
+
- Maintains memory and state
|
|
14
|
+
- Supports retry, resume, and parallel execution
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🔥 Why SourceBot?
|
|
19
|
+
|
|
20
|
+
Most AI tools today are **chat-based**.
|
|
21
|
+
|
|
22
|
+
SourceBot is different.
|
|
23
|
+
|
|
24
|
+
It is built to **plan, execute, and iterate** — like a real developer.
|
|
25
|
+
|
|
26
|
+
* 🧠 Plans tasks using a DAG (not linear prompts)
|
|
27
|
+
* 🔧 Uses tools (shell, skills, APIs)
|
|
28
|
+
* 🔁 Retries, resumes, and replays execution
|
|
29
|
+
* 💾 Maintains memory across steps
|
|
30
|
+
* 🐳 Runs safely in sandboxed environments
|
|
31
|
+
|
|
32
|
+
> This is not a chatbot.
|
|
33
|
+
> This is an **agent runtime**.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 🎬 Demo
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sourcebot init
|
|
41
|
+
sourcebot init_workspace
|
|
42
|
+
sourcebot cli
|
|
43
|
+
```
|
|
44
|
+
> ⚡ Example: Build a Python HTTP server autonomously
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
> ⚡ Demo is shortened for clarity
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 🧠 What Makes It Different
|
|
53
|
+
|
|
54
|
+
### 🔀 DAG-Based Execution (Core Innovation)
|
|
55
|
+
|
|
56
|
+
Unlike traditional agents:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
Prompt → LLM → Response
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
SourceBot:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
Task
|
|
66
|
+
↓
|
|
67
|
+
Decomposition
|
|
68
|
+
↓
|
|
69
|
+
DAG Graph
|
|
70
|
+
↓
|
|
71
|
+
Parallel Execution
|
|
72
|
+
↓
|
|
73
|
+
Tool + LLM Calls
|
|
74
|
+
↓
|
|
75
|
+
State + Memory Update
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
✅ Parallelizable
|
|
79
|
+
✅ Retryable
|
|
80
|
+
✅ Resumable
|
|
81
|
+
✅ Observable
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🧩 Core Features
|
|
86
|
+
|
|
87
|
+
### 🧠 Agent Runtime
|
|
88
|
+
|
|
89
|
+
* Modular architecture
|
|
90
|
+
* Identity + context system
|
|
91
|
+
* Multi-provider LLM abstraction
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 🔀 DAG Execution Engine
|
|
96
|
+
|
|
97
|
+
* Task decomposition
|
|
98
|
+
* Parallel scheduling
|
|
99
|
+
* Retry policies
|
|
100
|
+
* Run state persistence
|
|
101
|
+
* Partial replay
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### 🛠 Tool System
|
|
106
|
+
|
|
107
|
+
* Tool registry
|
|
108
|
+
* Shell execution
|
|
109
|
+
* Skill-based extensions
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### 💾 Memory System
|
|
114
|
+
|
|
115
|
+
* Sliding window memory
|
|
116
|
+
* LLM-based summarization
|
|
117
|
+
* Persistent storage
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### 💬 CLI Interface
|
|
122
|
+
|
|
123
|
+
* Interactive agent shell
|
|
124
|
+
* Safe runner
|
|
125
|
+
* Workspace bootstrap
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### 🐳 Sandbox Execution
|
|
130
|
+
|
|
131
|
+
* Docker isolation
|
|
132
|
+
* Safe tool execution
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🏗 Architecture
|
|
137
|
+
|
|
138
|
+
### 🔷 High-Level Architecture
|
|
139
|
+
|
|
140
|
+
```mermaid
|
|
141
|
+
graph TD
|
|
142
|
+
U[User] --> CLI[CLI Interface]
|
|
143
|
+
CLI --> AR[Agent Runtime]
|
|
144
|
+
AR --> DP[DAG Planner]
|
|
145
|
+
DP --> TG[Task Graph]
|
|
146
|
+
TG --> DS[DAG Scheduler]
|
|
147
|
+
DS --> TE[Tool Executor]
|
|
148
|
+
DS --> LLM[LLM Clients]
|
|
149
|
+
TE --> SB[Docker Sandbox]
|
|
150
|
+
LLM --> MEM[Memory System]
|
|
151
|
+
SB --> MEM
|
|
152
|
+
MEM --> OUT[Output]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### 🔷 Execution Flow
|
|
158
|
+
|
|
159
|
+
```mermaid
|
|
160
|
+
graph LR
|
|
161
|
+
A[User Task] --> B[Task Decomposition]
|
|
162
|
+
B --> C[DAG Generation]
|
|
163
|
+
C --> D[Parallel Execution]
|
|
164
|
+
D --> E[Tool Calls / LLM]
|
|
165
|
+
E --> F[State Update]
|
|
166
|
+
F --> G[Final Result]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 📁 Project Structure
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
sourcebot/
|
|
175
|
+
├── bus/ # Event system
|
|
176
|
+
├── cli/ # CLI interface
|
|
177
|
+
├── config/ # Config system
|
|
178
|
+
├── context/ # Context + skills
|
|
179
|
+
├── conversation/ # Conversation layer
|
|
180
|
+
├── docker_sandbox/ # Execution isolation
|
|
181
|
+
├── llm/ # LLM abstraction
|
|
182
|
+
├── memory/ # Memory system
|
|
183
|
+
├── runtime/ # Agent + DAG engine
|
|
184
|
+
├── tools/ # Tooling system
|
|
185
|
+
├── session/ # Persistence
|
|
186
|
+
└── utils/ # Utilities
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 🚀 Installation
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
git clone https://github.com/DavidVi2Bot/sourcebot.git
|
|
195
|
+
cd sourcebot
|
|
196
|
+
pip install -e .
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 🧪 Development
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pip install -r requirements-dev.txt
|
|
205
|
+
pytest
|
|
206
|
+
black .
|
|
207
|
+
ruff check .
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 🛣 Roadmap
|
|
213
|
+
|
|
214
|
+
### 🧱 Core
|
|
215
|
+
|
|
216
|
+
* [x] DAG execution engine
|
|
217
|
+
* [x] Tool system
|
|
218
|
+
* [x] CLI runtime
|
|
219
|
+
* [x] Memory system
|
|
220
|
+
|
|
221
|
+
### 🚧 Next
|
|
222
|
+
|
|
223
|
+
* [ ] Web UI (IDE-like)
|
|
224
|
+
* [ ] Multi-agent collaboration
|
|
225
|
+
* [ ] Plugin / marketplace system
|
|
226
|
+
* [ ] Long-term memory (vector DB)
|
|
227
|
+
* [ ] Remote execution / cloud runtime
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 🧠 Vision
|
|
232
|
+
|
|
233
|
+
SourceBot aims to become a **general-purpose autonomous agent framework**:
|
|
234
|
+
|
|
235
|
+
* 🧑💻 Coding agents (Devin-style)
|
|
236
|
+
* ⚙️ DevOps automation
|
|
237
|
+
* 🔬 Research agents
|
|
238
|
+
* 🔄 Workflow orchestration
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## ⚠️ Status
|
|
243
|
+
|
|
244
|
+
> 🚧 Alpha — rapidly evolving
|
|
245
|
+
|
|
246
|
+
Expect breaking changes and fast iteration.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 🤝 Contributing
|
|
251
|
+
|
|
252
|
+
We welcome contributions!
|
|
253
|
+
|
|
254
|
+
* Bug reports
|
|
255
|
+
* Feature ideas
|
|
256
|
+
* Tools / skills
|
|
257
|
+
* Documentation improvements
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## ⭐ Star History
|
|
262
|
+
|
|
263
|
+
If this project interests you, give it a ⭐ — it helps a lot!
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 📄 License
|
|
268
|
+
|
|
269
|
+
MIT License
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 🚀 Hacker News Title Ideas
|
|
274
|
+
|
|
275
|
+
* Show HN: SourceBot – A DAG-based autonomous coding agent framework
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 💥 Final Thought
|
|
281
|
+
|
|
282
|
+
> Chatbots answer.
|
|
283
|
+
>
|
|
284
|
+
> Agents act.
|
|
285
|
+
>
|
|
286
|
+
> **SourceBot executes.**
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sourcebot"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "An experimental autonomous coding agent framework with DAG execution, tool use, and CLI interface."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
authors = [
|
|
12
|
+
{name="DavidVi2Bot"}
|
|
13
|
+
]
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
|
|
16
|
+
keywords = ["ai", "agent", "llm", "automation", "devin"]
|
|
17
|
+
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
dependencies = [
|
|
26
|
+
"cmd2>=2.4.0",
|
|
27
|
+
"docker>=6.0.0",
|
|
28
|
+
"pydantic>=2.0",
|
|
29
|
+
"PyYAML>=6.0",
|
|
30
|
+
"rich>=13.0",
|
|
31
|
+
"typer>=0.9.0",
|
|
32
|
+
"openai>=1.0.0",
|
|
33
|
+
"loguru>=0.7.0",
|
|
34
|
+
"python-dotenv>=1.0.0",
|
|
35
|
+
"networkx>=3.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
sourcebot = "sourcebot.__main__:main"
|
|
40
|
+
|
|
41
|
+
[tool.setuptools]
|
|
42
|
+
package-dir = {"" = "src"}
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
dev = [
|
|
49
|
+
"pytest",
|
|
50
|
+
"pytest-asyncio",
|
|
51
|
+
"black",
|
|
52
|
+
"ruff",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
Homepage = "https://github.com/DavidVi2Bot/sourcebot"
|
|
57
|
+
Repository = "https://github.com/DavidVi2Bot/sourcebot"
|
|
58
|
+
Issues = "https://github.com/DavidVi2Bot/sourcebot/issues"
|