adelie-ai 0.1.0 → 0.1.2
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.
- package/README.md +413 -335
- package/adelie/interactive.py +7 -1
- package/bin/adelie.js +3 -1
- package/package.json +3 -4
- package/requirements.txt +20 -20
- package/scripts/postinstall.js +150 -61
package/README.md
CHANGED
|
@@ -1,335 +1,413 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="docs/adelie_logo.jpeg" alt="Adelie Logo" width="200" />
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">Adelie</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<strong>Self-Communicating Autonomous AI Loop System</strong><br/>
|
|
9
|
-
An AI orchestrator that plans, codes, reviews, tests, deploys, and evolves — autonomously.
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<p align="center">
|
|
13
|
-
<img src="https://img.shields.io/badge/python-3.10+-blue?logo=python" alt="Python 3.10+" />
|
|
14
|
-
<img src="https://img.shields.io/badge/LLM-Gemini%20%7C%20Ollama-orange" alt="LLM Support" />
|
|
15
|
-
<img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License" />
|
|
16
|
-
<img src="https://img.shields.io/badge/tests-
|
|
17
|
-
</p>
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
adelie
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
adelie goal
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
adelie
|
|
197
|
-
adelie
|
|
198
|
-
adelie
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
adelie
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
adelie
|
|
207
|
-
adelie
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/adelie_logo.jpeg" alt="Adelie Logo" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Adelie</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Self-Communicating Autonomous AI Loop System</strong><br/>
|
|
9
|
+
An AI orchestrator that plans, codes, reviews, tests, deploys, and evolves — autonomously.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://img.shields.io/badge/python-3.10+-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python 3.10+" />
|
|
14
|
+
<img src="https://img.shields.io/badge/LLM-Gemini%20%7C%20Ollama-orange?style=for-the-badge" alt="LLM Support" />
|
|
15
|
+
<img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="MIT License" />
|
|
16
|
+
<img src="https://img.shields.io/badge/tests-183%20passed-brightgreen?style=for-the-badge" alt="Tests" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="#-quick-start">Quick Start</a> ·
|
|
21
|
+
<a href="#-architecture">Architecture</a> ·
|
|
22
|
+
<a href="#-features">Features</a> ·
|
|
23
|
+
<a href="#-cli-reference">CLI</a> ·
|
|
24
|
+
<a href="#-testing">Testing</a> ·
|
|
25
|
+
<a href="#-license">License</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🤔 What is Adelie?
|
|
31
|
+
|
|
32
|
+
Adelie is an **autonomous AI loop system** that orchestrates 10 specialized AI agents to build, maintain, and evolve software projects — with minimal human intervention.
|
|
33
|
+
|
|
34
|
+
Think of it as a full AI development team running 24/7:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
🧠 Expert AI → Strategic decisions & task dispatch
|
|
38
|
+
✍️ Writer AI → Knowledge Base documentation
|
|
39
|
+
💻 Coder AI → Code generation (3-layer architecture)
|
|
40
|
+
🔍 Reviewer AI → Code quality review & feedback
|
|
41
|
+
🧪 Tester AI → Test execution & failure reporting
|
|
42
|
+
🚀 Runner AI → Build & deployment
|
|
43
|
+
📡 Monitor AI → System health monitoring
|
|
44
|
+
📊 Analyst AI → Project insights & analysis
|
|
45
|
+
🔎 Research AI → Web search for external info
|
|
46
|
+
🔬 Scanner AI → Codebase scanning on first run
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
All agents communicate through a **file-based Knowledge Base** and are coordinated by the **Orchestrator** — an endless loop with a built-in state machine.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ✨ Features
|
|
54
|
+
|
|
55
|
+
### 🎯 Core
|
|
56
|
+
|
|
57
|
+
- **10 Specialized Agents** — Each with a focused role, scheduled independently
|
|
58
|
+
- **6-Phase Project Lifecycle** — `INITIAL → MID → MID_1 → MID_2 → LATE → EVOLVE`
|
|
59
|
+
- **Layered Code Generation** — Layer 0 (features) → Layer 1 (connectors) → Layer 2 (infra)
|
|
60
|
+
- **Knowledge Base** — Tag-based & semantic retrieval across 6 categories
|
|
61
|
+
- **Multi-LLM** — Gemini + Ollama with automatic fallback chains
|
|
62
|
+
|
|
63
|
+
### 🛡️ Safety
|
|
64
|
+
|
|
65
|
+
- **Loop Detector** — 5 stuck-pattern types with escalating interventions
|
|
66
|
+
- **Phase Gates** — Quality-metric thresholds (KB count, test rate, review scores)
|
|
67
|
+
- **Context Budget** — Per-agent token limits prevent unbounded growth
|
|
68
|
+
- **Process Supervisor** — Timeout enforcement, orphan cleanup, concurrency limits
|
|
69
|
+
|
|
70
|
+
### 🔌 Extensibility (New in Phase 2-3)
|
|
71
|
+
|
|
72
|
+
| Feature | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| 💾 **Checkpoint System** | Auto-snapshot before file promotion, instant rollback |
|
|
75
|
+
| 🐳 **Docker Sandboxing** | Configurable workspace access, network isolation, security blocklist |
|
|
76
|
+
| 🌐 **REST Gateway** | HTTP API: `/api/status`, `/api/tools`, `/api/control` |
|
|
77
|
+
| 🧩 **Skill Registry** | Install/update/uninstall skills from Git or local dirs |
|
|
78
|
+
| 📡 **Multichannel** | `ChannelProvider` ABC — Discord, Slack, and custom channels |
|
|
79
|
+
| 🤝 **A2A Protocol** | Agent-to-Agent HTTP API for external agent integration |
|
|
80
|
+
| 🔧 **MCP Support** | Model Context Protocol for external tool ecosystems |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🏗️ Architecture
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
88
|
+
│ ORCHESTRATOR │
|
|
89
|
+
│ │
|
|
90
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
|
|
91
|
+
│ │ Writer AI│───>│Expert AI │───>│ Coder Manager│ │
|
|
92
|
+
│ └──────────┘ └──────────┘ └──────┬───────┘ │
|
|
93
|
+
│ │ │ │ │
|
|
94
|
+
│ v │ ┌──────┴──────┐ │
|
|
95
|
+
│ ┌──────────┐ │ │ Layer 0-2 │ │
|
|
96
|
+
│ │Knowledge │ │ │ Coders │ │
|
|
97
|
+
│ │ Base │<────────┘ └──────┬──────┘ │
|
|
98
|
+
│ └──────────┘ │ │
|
|
99
|
+
│ v │
|
|
100
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
|
|
101
|
+
│ │ Reviewer │ │ Tester │ │ Runner / Monitor │ │
|
|
102
|
+
│ │ AI │ │ AI │ │ AI │ │
|
|
103
|
+
│ └──────────┘ └──────────┘ └──────────────────┘ │
|
|
104
|
+
│ │
|
|
105
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
106
|
+
│ │ Loop Detector │ Scheduler │ Process Supervisor │ │
|
|
107
|
+
│ ├─────────────────────────────────────────────────────────┤ │
|
|
108
|
+
│ │ Checkpoint │ Sandbox │ Gateway │ A2A │ Channels │ │
|
|
109
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
110
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 🔄 Project Lifecycle
|
|
116
|
+
|
|
117
|
+
Adelie evolves your project through **6 phases**, each gated by quality metrics:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
INITIAL ──> MID ──> MID_1 ──> MID_2 ──> LATE ──> EVOLVE
|
|
121
|
+
Planning Code Test Optimize Maintain Autonomous
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
| Phase | Focus | Coder Layers |
|
|
125
|
+
|-------|-------|-------------|
|
|
126
|
+
| Initial | Documentation, architecture, roadmap | — |
|
|
127
|
+
| Mid | Implementation, feature coding | Layer 0 |
|
|
128
|
+
| Mid-1 | Integration, testing | Layer 0-1 |
|
|
129
|
+
| Mid-2 | Stabilization, optimization | Layer 0-2 |
|
|
130
|
+
| Late | Maintenance, new features | All |
|
|
131
|
+
| Evolve | Self-improvement | All |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 🚀 Quick Start
|
|
136
|
+
|
|
137
|
+
### Prerequisites
|
|
138
|
+
|
|
139
|
+
- **Python 3.10+**
|
|
140
|
+
- **Node.js 16+** (for CLI wrapper)
|
|
141
|
+
- **Gemini API key** or **Ollama** running locally
|
|
142
|
+
|
|
143
|
+
### Installation
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Install via npm (recommended)
|
|
147
|
+
npm install -g adelie-ai
|
|
148
|
+
|
|
149
|
+
# Or install from source
|
|
150
|
+
git clone https://github.com/kimhyunbin/Adelie.git
|
|
151
|
+
cd Adelie
|
|
152
|
+
pip install -r requirements.txt
|
|
153
|
+
npm install -g .
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Setup
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Initialize workspace
|
|
160
|
+
cd /path/to/your/project
|
|
161
|
+
adelie init
|
|
162
|
+
|
|
163
|
+
# Configure LLM provider
|
|
164
|
+
adelie config --provider gemini --api-key YOUR_GEMINI_API_KEY
|
|
165
|
+
|
|
166
|
+
# Or use Ollama (local, free)
|
|
167
|
+
adelie config --provider ollama --model gemma3:12b
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Run
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Start the autonomous AI loop
|
|
174
|
+
adelie run --goal "Build a REST API for task management"
|
|
175
|
+
|
|
176
|
+
# Single cycle
|
|
177
|
+
adelie run once --goal "Analyze and document the codebase"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 💻 CLI Reference
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Workspace
|
|
186
|
+
adelie init [dir] Initialize workspace
|
|
187
|
+
adelie ws List all workspaces
|
|
188
|
+
adelie ws remove <N> Remove workspace #N
|
|
189
|
+
|
|
190
|
+
Run
|
|
191
|
+
adelie run --goal "..." Start AI loop
|
|
192
|
+
adelie run ws <N> Resume loop in workspace #N
|
|
193
|
+
adelie run once --goal "..." Run one cycle
|
|
194
|
+
|
|
195
|
+
Configuration
|
|
196
|
+
adelie config Show current config
|
|
197
|
+
adelie config --provider ... Switch LLM (gemini/ollama)
|
|
198
|
+
adelie config --model ... Set model name
|
|
199
|
+
adelie config --interval N Loop interval (seconds)
|
|
200
|
+
adelie config --api-key KEY Set Gemini API key
|
|
201
|
+
adelie config --lang ko|en Display language
|
|
202
|
+
|
|
203
|
+
Monitoring
|
|
204
|
+
adelie status System health
|
|
205
|
+
adelie inform Project status report
|
|
206
|
+
adelie phase Show phase
|
|
207
|
+
adelie phase set <phase> Set phase manually
|
|
208
|
+
adelie metrics Cycle metrics
|
|
209
|
+
|
|
210
|
+
Knowledge Base
|
|
211
|
+
adelie kb KB file counts
|
|
212
|
+
adelie kb --clear-errors Clear error files
|
|
213
|
+
adelie kb --reset Reset KB (destructive)
|
|
214
|
+
|
|
215
|
+
Project
|
|
216
|
+
adelie goal Show project goal
|
|
217
|
+
adelie goal set "..." Set project goal
|
|
218
|
+
adelie feedback "message" Send feedback to AI loop
|
|
219
|
+
adelie research "topic" Web search → KB
|
|
220
|
+
adelie git Git status & recent commits
|
|
221
|
+
|
|
222
|
+
Ollama
|
|
223
|
+
adelie ollama list List models
|
|
224
|
+
adelie ollama pull <model> Download model
|
|
225
|
+
adelie ollama run [model] Interactive chat
|
|
226
|
+
|
|
227
|
+
Telegram
|
|
228
|
+
adelie telegram setup Setup bot token
|
|
229
|
+
adelie telegram start Start Telegram bot
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 🔧 Configuration
|
|
235
|
+
|
|
236
|
+
### Environment Variables
|
|
237
|
+
|
|
238
|
+
All settings stored in `.adelie/.env`:
|
|
239
|
+
|
|
240
|
+
| Variable | Default | Description |
|
|
241
|
+
|----------|---------|-------------|
|
|
242
|
+
| `LLM_PROVIDER` | `gemini` | `gemini` or `ollama` |
|
|
243
|
+
| `GEMINI_API_KEY` | — | Required for Gemini |
|
|
244
|
+
| `GEMINI_MODEL` | `gemini-2.0-flash` | Gemini model |
|
|
245
|
+
| `OLLAMA_BASE_URL` | `http://localhost:11434` | Ollama URL |
|
|
246
|
+
| `OLLAMA_MODEL` | `llama3.2` | Ollama model |
|
|
247
|
+
| `FALLBACK_MODELS` | — | Fallback chain (e.g. `gemini:flash,ollama:llama3.2`) |
|
|
248
|
+
| `LOOP_INTERVAL_SECONDS` | `30` | Loop interval |
|
|
249
|
+
| `ADELIE_LANGUAGE` | `ko` | Display language |
|
|
250
|
+
|
|
251
|
+
### Docker Sandbox Config
|
|
252
|
+
|
|
253
|
+
Optional `.adelie/sandbox.json`:
|
|
254
|
+
|
|
255
|
+
```json
|
|
256
|
+
{
|
|
257
|
+
"docker": {
|
|
258
|
+
"image": "adelie-sandbox:latest",
|
|
259
|
+
"workspaceAccess": "rw",
|
|
260
|
+
"network": "none",
|
|
261
|
+
"memoryLimit": "512m",
|
|
262
|
+
"cpuLimit": 1.0,
|
|
263
|
+
"readOnlyRoot": false
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Skills
|
|
269
|
+
|
|
270
|
+
Place skills in `.adelie/skills/<name>/SKILL.md`:
|
|
271
|
+
|
|
272
|
+
```yaml
|
|
273
|
+
---
|
|
274
|
+
name: react-specialist
|
|
275
|
+
description: React/TypeScript best practices
|
|
276
|
+
agents: [coder, reviewer]
|
|
277
|
+
trigger: auto
|
|
278
|
+
---
|
|
279
|
+
# Instructions
|
|
280
|
+
Use functional components...
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 🧪 Testing
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Run all tests
|
|
289
|
+
python -m pytest tests/ -v
|
|
290
|
+
|
|
291
|
+
# Specific modules
|
|
292
|
+
python -m pytest tests/test_checkpoint.py -v
|
|
293
|
+
python -m pytest tests/test_gateway.py -v
|
|
294
|
+
python -m pytest tests/test_a2a.py -v
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**183 tests** across 8 test suites:
|
|
298
|
+
|
|
299
|
+
| Suite | Tests | Coverage |
|
|
300
|
+
|-------|-------|----------|
|
|
301
|
+
| MCP Client | 35 | MCP server connection, tool discovery |
|
|
302
|
+
| Tool Registry | 20 | Tool registration, categories, user tools |
|
|
303
|
+
| Checkpoint | 16 | Create, restore, prune, metadata |
|
|
304
|
+
| Docker Sandbox | 26 | Config, bind safety, Docker wrapping |
|
|
305
|
+
| Gateway API | 18 | REST endpoints, auth, CORS |
|
|
306
|
+
| Skill Registry | 19 | Install, uninstall, manifest, helpers |
|
|
307
|
+
| Multichannel | 24 | Providers, router, broadcast, events |
|
|
308
|
+
| A2A Protocol | 25 | Task lifecycle, persistence, HTTP API |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 📁 Project Structure
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
Adelie/
|
|
316
|
+
├── adelie/ # Core package
|
|
317
|
+
│ ├── orchestrator.py # Main loop controller (state machine)
|
|
318
|
+
│ ├── cli.py # CLI commands
|
|
319
|
+
│ ├── config.py # Configuration & env loading
|
|
320
|
+
│ ├── llm_client.py # LLM abstraction (Gemini + Ollama)
|
|
321
|
+
│ ├── checkpoint.py # 💾 Checkpoint system
|
|
322
|
+
│ ├── sandbox.py # 🐳 Docker/Seatbelt sandboxing
|
|
323
|
+
│ ├── gateway.py # 🌐 REST API gateway
|
|
324
|
+
│ ├── skill_manager.py # 🧩 Skill loading & registry
|
|
325
|
+
│ ├── scheduler.py # Per-agent scheduling
|
|
326
|
+
│ ├── phases.py # Project lifecycle phases
|
|
327
|
+
│ ├── hooks.py # Event-driven plugin system
|
|
328
|
+
│ ├── loop_detector.py # Stuck-loop detection
|
|
329
|
+
│ ├── context_engine.py # Per-agent context assembly
|
|
330
|
+
│ ├── process_supervisor.py # Subprocess management
|
|
331
|
+
│ ├── feedback_queue.py # User feedback injection
|
|
332
|
+
│ ├── channels/ # 📡 Multichannel abstraction
|
|
333
|
+
│ │ ├── base.py # ChannelProvider ABC
|
|
334
|
+
│ │ ├── discord.py # Discord integration
|
|
335
|
+
│ │ ├── slack.py # Slack integration
|
|
336
|
+
│ │ └── router.py # Multi-channel routing
|
|
337
|
+
│ ├── a2a/ # 🤝 Agent-to-Agent protocol
|
|
338
|
+
│ │ ├── types.py # Task/Event types
|
|
339
|
+
│ │ ├── server.py # A2A HTTP server
|
|
340
|
+
│ │ └── persistence.py # Task persistence
|
|
341
|
+
│ ├── agents/ # AI agents (10 specialized)
|
|
342
|
+
│ │ ├── expert_ai.py
|
|
343
|
+
│ │ ├── writer_ai.py
|
|
344
|
+
│ │ ├── coder_ai.py
|
|
345
|
+
│ │ ├── reviewer_ai.py
|
|
346
|
+
│ │ ├── tester_ai.py
|
|
347
|
+
│ │ ├── runner_ai.py
|
|
348
|
+
│ │ ├── monitor_ai.py
|
|
349
|
+
│ │ ├── analyst_ai.py
|
|
350
|
+
│ │ ├── research_ai.py
|
|
351
|
+
│ │ └── scanner_ai.py
|
|
352
|
+
│ └── kb/ # Knowledge Base
|
|
353
|
+
│ ├── retriever.py
|
|
354
|
+
│ └── embedding_store.py
|
|
355
|
+
├── tests/ # 183 tests
|
|
356
|
+
├── bin/ # Node.js CLI wrapper
|
|
357
|
+
├── requirements.txt # Python dependencies
|
|
358
|
+
└── package.json # npm config
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## ⚙️ How It Works
|
|
364
|
+
|
|
365
|
+
Each orchestrator cycle runs these steps:
|
|
366
|
+
|
|
367
|
+
1. **Writer AI** creates/updates Knowledge Base files
|
|
368
|
+
2. **Expert AI** reads KB and makes structured decisions (JSON)
|
|
369
|
+
3. **Research AI** searches the web if requested
|
|
370
|
+
4. **Coder Manager** dispatches code generation by layer
|
|
371
|
+
5. **Reviewer AI** reviews code; retries on failure
|
|
372
|
+
6. **💾 Checkpoint** snapshots current files before promotion
|
|
373
|
+
7. **Staging → Project** promotes approved code
|
|
374
|
+
8. **Tester AI** runs tests; retries on failure
|
|
375
|
+
9. **Runner AI** builds and deploys
|
|
376
|
+
10. **Monitor AI** checks health; restarts if needed
|
|
377
|
+
11. **Phase Gates** evaluate readiness for next phase
|
|
378
|
+
|
|
379
|
+
The loop runs continuously with the **Scheduler** controlling agent frequency and the **Loop Detector** intervening when the system gets stuck.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## 🗺️ Roadmap
|
|
384
|
+
|
|
385
|
+
- [x] **Phase 1** — MCP Server Integration
|
|
386
|
+
- [x] **Phase 2** — Checkpoint System, Docker Sandboxing, REST Gateway
|
|
387
|
+
- [x] **Phase 3** — Skill Registry, Multichannel, A2A Protocol
|
|
388
|
+
- [ ] **Phase 4** — VS Code Extension, Web Dashboard, Plugin Marketplace
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## 🤝 Contributing
|
|
393
|
+
|
|
394
|
+
Contributions are welcome! Please feel free to submit Pull Requests.
|
|
395
|
+
|
|
396
|
+
1. Fork the repository
|
|
397
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
398
|
+
3. Run tests (`python -m pytest tests/ -v`)
|
|
399
|
+
4. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
400
|
+
5. Push to the branch (`git push origin feature/amazing-feature`)
|
|
401
|
+
6. Open a Pull Request
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## 📄 License
|
|
406
|
+
|
|
407
|
+
MIT — see [LICENSE](./LICENSE) for details.
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
<p align="center">
|
|
412
|
+
<sub>Built with 🐧 Adelie — the penguin that codes</sub>
|
|
413
|
+
</p>
|
package/adelie/interactive.py
CHANGED
|
@@ -14,7 +14,13 @@ Layout:
|
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
try:
|
|
18
|
+
import readline # noqa: F401 — enables arrow-key editing in input()
|
|
19
|
+
except ImportError:
|
|
20
|
+
try:
|
|
21
|
+
import pyreadline3 # noqa: F401 — Windows alternative
|
|
22
|
+
except ImportError:
|
|
23
|
+
pass # arrow-key editing won't work, but no crash
|
|
18
24
|
import shutil
|
|
19
25
|
import signal
|
|
20
26
|
import sys
|
package/bin/adelie.js
CHANGED
|
@@ -53,7 +53,9 @@ function ensureVenv() {
|
|
|
53
53
|
const pip = IS_WIN
|
|
54
54
|
? path.join(VENV_DIR, "Scripts", "pip")
|
|
55
55
|
: path.join(VENV_DIR, "bin", "pip");
|
|
56
|
-
|
|
56
|
+
const pipEnv = { ...process.env };
|
|
57
|
+
if (IS_WIN) pipEnv.PYTHONUTF8 = "1";
|
|
58
|
+
execSync(`"${pip}" install -r "${REQUIREMENTS}"`, { stdio: "inherit", env: pipEnv });
|
|
57
59
|
console.log("[adelie] Python environment ready.");
|
|
58
60
|
} catch (err) {
|
|
59
61
|
console.error(`[adelie] ERROR: Failed to set up Python environment: ${err.message}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adelie-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Adelie — Self-Communicating Autonomous AI Loop CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"adelie": "bin/adelie.js"
|
|
@@ -30,11 +30,10 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/
|
|
33
|
+
"url": "git+https://github.com/Ade1ie/adelie.git"
|
|
34
34
|
},
|
|
35
|
-
"homepage": "https://github.com/kimhyunbin/Adelie",
|
|
36
35
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/
|
|
36
|
+
"url": "https://github.com/Ade1ie/adelie/issues"
|
|
38
37
|
},
|
|
39
38
|
"engines": {
|
|
40
39
|
"node": ">=16.0.0"
|
package/requirements.txt
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
#
|
|
2
|
-
rich>=13.0.0
|
|
3
|
-
python-dotenv>=1.0.0
|
|
4
|
-
requests>=2.28.0
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
google-genai>=1.0.0
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
# mcp>=1.0.0 # Optional: install for SSE transport support
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
PyPDF2>=3.0.0
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
# playwright>=1.40.0
|
|
17
|
-
beautifulsoup4>=4.12.0
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
# python-telegram-bot>=20.0
|
|
1
|
+
# Core (required)
|
|
2
|
+
rich>=13.0.0
|
|
3
|
+
python-dotenv>=1.0.0
|
|
4
|
+
requests>=2.28.0
|
|
5
|
+
|
|
6
|
+
# LLM Providers
|
|
7
|
+
google-genai>=1.0.0
|
|
8
|
+
|
|
9
|
+
# MCP (Model Context Protocol)
|
|
10
|
+
# mcp>=1.0.0 # Optional: install for SSE transport support
|
|
11
|
+
|
|
12
|
+
# Spec Loader (PDF support)
|
|
13
|
+
PyPDF2>=3.0.0
|
|
14
|
+
|
|
15
|
+
# Browser Search Fallback (optional)
|
|
16
|
+
# playwright>=1.40.0
|
|
17
|
+
beautifulsoup4>=4.12.0
|
|
18
|
+
|
|
19
|
+
# Integrations (optional)
|
|
20
|
+
# python-telegram-bot>=20.0
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,61 +1,150 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* scripts/postinstall.js — Runs after npm install
|
|
5
|
-
*
|
|
6
|
-
* Creates a Python virtual environment
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
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
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* scripts/postinstall.js — Runs after npm install
|
|
5
|
+
*
|
|
6
|
+
* Creates a Python virtual environment, installs requirements,
|
|
7
|
+
* and shows a welcome screen with initial setup guide.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { execSync } = require("child_process");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
|
|
14
|
+
const PKG_ROOT = path.resolve(__dirname, "..");
|
|
15
|
+
const VENV_DIR = path.join(PKG_ROOT, ".venv");
|
|
16
|
+
const REQUIREMENTS = path.join(PKG_ROOT, "requirements.txt");
|
|
17
|
+
const IS_WIN = process.platform === "win32";
|
|
18
|
+
const PYTHON_BIN = IS_WIN
|
|
19
|
+
? path.join(VENV_DIR, "Scripts", "python.exe")
|
|
20
|
+
: path.join(VENV_DIR, "bin", "python");
|
|
21
|
+
|
|
22
|
+
// ── Color helpers ────────────────────────────────────────────────────────────
|
|
23
|
+
const c = {
|
|
24
|
+
reset: "\x1b[0m",
|
|
25
|
+
bold: "\x1b[1m",
|
|
26
|
+
dim: "\x1b[2m",
|
|
27
|
+
italic: "\x1b[3m",
|
|
28
|
+
underline:"\x1b[4m",
|
|
29
|
+
cyan: "\x1b[36m",
|
|
30
|
+
green: "\x1b[32m",
|
|
31
|
+
yellow: "\x1b[33m",
|
|
32
|
+
blue: "\x1b[34m",
|
|
33
|
+
magenta: "\x1b[35m",
|
|
34
|
+
white: "\x1b[97m",
|
|
35
|
+
gray: "\x1b[90m",
|
|
36
|
+
bgBlue: "\x1b[44m",
|
|
37
|
+
bgMagenta:"\x1b[45m",
|
|
38
|
+
bgCyan: "\x1b[46m",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function showWelcome() {
|
|
42
|
+
const banner = `
|
|
43
|
+
${c.cyan}${c.bold}
|
|
44
|
+
___ __ ___
|
|
45
|
+
/ | ____/ /__ / (_)__
|
|
46
|
+
/ /| |/ __ / _ \\/ / / _ \\
|
|
47
|
+
/ ___ / /_/ / __/ / / __/
|
|
48
|
+
/_/ |_\\__,_/\\___/_/_/\\___/
|
|
49
|
+
${c.reset}
|
|
50
|
+
${c.bold}${c.white} Self-Communicating Autonomous AI Loop System${c.reset}
|
|
51
|
+
${c.dim}${c.cyan} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${c.reset}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const info = `
|
|
55
|
+
${c.green}${c.bold}✔ Installation complete!${c.reset}
|
|
56
|
+
|
|
57
|
+
${c.bold}${c.white}🚀 Quick Start${c.reset}
|
|
58
|
+
${c.gray}─────────────────────────────────────────${c.reset}
|
|
59
|
+
|
|
60
|
+
${c.yellow}${c.bold}1.${c.reset} ${c.white}Initialize a workspace${c.reset}
|
|
61
|
+
${c.cyan}$ ${c.bold}adelie init${c.reset}
|
|
62
|
+
|
|
63
|
+
${c.yellow}${c.bold}2.${c.reset} ${c.white}Configure your LLM provider${c.reset}
|
|
64
|
+
${c.cyan}$ ${c.bold}adelie config --provider gemini --api-key YOUR_KEY${c.reset}
|
|
65
|
+
${c.dim}or for local Ollama:${c.reset}
|
|
66
|
+
${c.cyan}$ ${c.bold}adelie config --provider ollama --model gemma3:12b${c.reset}
|
|
67
|
+
|
|
68
|
+
${c.yellow}${c.bold}3.${c.reset} ${c.white}Start the autonomous AI loop${c.reset}
|
|
69
|
+
${c.cyan}$ ${c.bold}adelie run --goal "Build a REST API"${c.reset}
|
|
70
|
+
|
|
71
|
+
${c.gray}─────────────────────────────────────────${c.reset}
|
|
72
|
+
|
|
73
|
+
${c.bold}${c.white}📖 Useful Commands${c.reset}
|
|
74
|
+
${c.dim} adelie status${c.reset} ${c.gray}— System health check${c.reset}
|
|
75
|
+
${c.dim} adelie phase${c.reset} ${c.gray}— Current project phase${c.reset}
|
|
76
|
+
${c.dim} adelie kb${c.reset} ${c.gray}— Knowledge Base summary${c.reset}
|
|
77
|
+
${c.dim} adelie --help${c.reset} ${c.gray}— Full command reference${c.reset}
|
|
78
|
+
|
|
79
|
+
${c.gray}─────────────────────────────────────────${c.reset}
|
|
80
|
+
${c.magenta}${c.bold}♥${c.reset} ${c.dim}GitHub: ${c.underline}https://github.com/Ade1ie/adelie${c.reset}
|
|
81
|
+
${c.blue}${c.bold}★${c.reset} ${c.dim}npm: ${c.underline}https://www.npmjs.com/package/adelie-ai${c.reset}
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
console.log(banner);
|
|
85
|
+
console.log(info);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ── Python setup ─────────────────────────────────────────────────────────────
|
|
89
|
+
|
|
90
|
+
if (fs.existsSync(PYTHON_BIN)) {
|
|
91
|
+
showWelcome();
|
|
92
|
+
process.exit(0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Find system Python 3
|
|
96
|
+
const candidates = IS_WIN ? ["python", "python3", "py"] : ["python3", "python"];
|
|
97
|
+
let sysPython = null;
|
|
98
|
+
|
|
99
|
+
for (const cmd of candidates) {
|
|
100
|
+
try {
|
|
101
|
+
const ver = execSync(`${cmd} --version 2>&1`, { encoding: "utf-8" }).trim();
|
|
102
|
+
if (ver.includes("Python 3")) {
|
|
103
|
+
sysPython = cmd;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
} catch {}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!sysPython) {
|
|
110
|
+
console.error(`\n ${c.yellow}${c.bold}⚠ Python 3 is required but not found.${c.reset}`);
|
|
111
|
+
console.error(` ${c.dim}Install it from: ${c.underline}https://www.python.org/downloads/${c.reset}`);
|
|
112
|
+
console.error(` ${c.dim}After installing, run: ${c.cyan}npm rebuild adelie-ai${c.reset}\n`);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.log(`\n ${c.cyan}${c.bold}⏳ Setting up Python environment...${c.reset}`);
|
|
117
|
+
console.log(` ${c.dim}Using: ${sysPython}${c.reset}\n`);
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
execSync(`${sysPython} -m venv "${VENV_DIR}"`, { stdio: "inherit" });
|
|
121
|
+
|
|
122
|
+
const pip = IS_WIN
|
|
123
|
+
? path.join(VENV_DIR, "Scripts", "pip")
|
|
124
|
+
: path.join(VENV_DIR, "bin", "pip");
|
|
125
|
+
|
|
126
|
+
// Use --encoding utf-8 via env to avoid cp949 issues on Windows
|
|
127
|
+
const pipEnv = { ...process.env };
|
|
128
|
+
if (IS_WIN) {
|
|
129
|
+
pipEnv.PYTHONUTF8 = "1";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
execSync(`"${pip}" install -q -r "${REQUIREMENTS}"`, {
|
|
133
|
+
stdio: "inherit",
|
|
134
|
+
env: pipEnv,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
console.log(` ${c.green}${c.bold}✔ Python environment ready.${c.reset}\n`);
|
|
138
|
+
showWelcome();
|
|
139
|
+
} catch (err) {
|
|
140
|
+
console.error(`\n ${c.yellow}${c.bold}⚠ Failed to set up Python environment.${c.reset}`);
|
|
141
|
+
console.error(` ${c.dim}${err.message}${c.reset}`);
|
|
142
|
+
console.error(` ${c.dim}Try manually:${c.reset}`);
|
|
143
|
+
if (IS_WIN) {
|
|
144
|
+
console.error(` ${c.cyan}python -m venv .venv && .venv\\Scripts\\pip install -r requirements.txt${c.reset}`);
|
|
145
|
+
} else {
|
|
146
|
+
console.error(` ${c.cyan}python3 -m venv .venv && .venv/bin/pip install -r requirements.txt${c.reset}`);
|
|
147
|
+
}
|
|
148
|
+
console.error("");
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|