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 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-374%20passed-brightgreen" alt="Tests" />
17
- </p>
18
-
19
- ---
20
-
21
- ## What is Adelie?
22
-
23
- Adelie is an **autonomous AI loop system** that orchestrates multiple specialized AI agents to build, maintain, and evolve software projects — with minimal human intervention.
24
-
25
- Think of it as an AI team that continuously works on your project:
26
-
27
- | Agent | Role |
28
- |-------|------|
29
- | **Expert AI** | Makes strategic decisions, dispatches tasks, manages state |
30
- | **Writer AI** | Creates and maintains the Knowledge Base (documentation) |
31
- | **Coder AI** | Writes actual source code in a layered architecture |
32
- | **Reviewer AI** | Reviews code quality, feeds back to coders |
33
- | **Tester AI** | Runs tests, reports failures back for fixes |
34
- | **Runner AI** | Builds, deploys, and runs the project |
35
- | **Monitor AI** | Checks system health, triggers restarts |
36
- | **Analyst AI** | Provides project-level insights and analysis |
37
- | **Research AI** | Searches the web for external information |
38
- | **Scanner AI** | Scans existing codebases on first run |
39
-
40
- All agents communicate through a **file-based Knowledge Base** and are coordinated by the **Orchestrator** — an endless loop with a built-in state machine.
41
-
42
- ---
43
-
44
- ## Architecture
45
-
46
- ```
47
- ┌─────────────────────────────────────────────────────┐
48
- │ ORCHESTRATOR │
49
- │ │
50
- │ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
51
- │ │ Writer AI│───>│Expert AI │───>│ Coder Manager│ │
52
- │ └──────────┘ └──────────┘ └──────┬───────┘ │
53
- │ │ │ │ │
54
- │ v │ ┌──────┴──────┐ │
55
- │ ┌──────────┐ │ │ Layer 0-2 │ │
56
- │ │Knowledge │ │ │ Coders │ │
57
- │ │ Base │<────────┘ └──────┬──────┘ │
58
- │ └──────────┘ │ │
59
- │ v │
60
- │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐│
61
- │ │ Reviewer │ │ Tester │ │ Runner / Monitor ││
62
- │ │ AI │ │ AI │ │ AI ││
63
- │ └──────────┘ └──────────┘ └──────────────────┘│
64
- │ │
65
- │ ┌──────────────────────────────────────────────┐
66
- │ │ Loop Detector Scheduler Process Supv. │
67
- │ └──────────────────────────────────────────────┘
68
- └─────────────────────────────────────────────────────┘
69
- ```
70
-
71
- ---
72
-
73
- ## Project Lifecycle (Phases)
74
-
75
- Adelie evolves your project through 6 phases:
76
-
77
- ```
78
- INITIAL ──> MID ──> MID_1 ──> MID_2 ──> LATE ──> EVOLVE
79
- Planning Coding Testing Optimizing Maintaining Autonomous
80
- ```
81
-
82
- | Phase | Focus | Coder Layers |
83
- |-------|-------|-------------|
84
- | Initial | Documentation, architecture, roadmap | None |
85
- | Mid | Implementation, feature coding | Layer 0 (features) |
86
- | Mid-1 | Integration, testing, roadmap check | Layer 0-1 (+ connectors) |
87
- | Mid-2 | Stabilization, optimization, deployment | Layer 0-2 (+ infra) |
88
- | Late | Maintenance, new features | All layers |
89
- | Evolve | Autonomous evolution, self-improvement | All layers |
90
-
91
- Phase transitions are **gated** by quality metrics (KB file count, test pass rate, review scores) and confirmed by the Expert AI.
92
-
93
- ---
94
-
95
- ## Safety Harnesses
96
-
97
- Adelie includes multiple built-in safety mechanisms:
98
-
99
- | Harness | Purpose |
100
- |---------|---------|
101
- | **Loop Detector** | Detects 5 types of repetitive patterns with escalating interventions |
102
- | **Phase Gates** | Prevents premature transitions with quality thresholds |
103
- | **Context Budget** | Per-agent token budgets prevent unbounded prompt growth |
104
- | **Process Supervisor** | Timeout enforcement, orphan cleanup, concurrent limits |
105
- | **Reviewer Loop** | Code review → feedback → retry cycle (max 2 retries) |
106
- | **Tester Loop** | Test failure coder fix → re-test cycle (max 2 retries) |
107
- | **Expert Fallback** | JSON retry + regex extraction + safe fallback decision |
108
-
109
- ---
110
-
111
- ## Quick Start
112
-
113
- ### Prerequisites
114
-
115
- - **Python 3.10+**
116
- - **Node.js 16+** (for the CLI wrapper)
117
- - **Gemini API key** or **Ollama** running locally
118
-
119
- ### Installation
120
-
121
- ```bash
122
- # Install via npm (recommended)
123
- npm install -g adelie
124
-
125
- # Or install from source
126
- git clone https://github.com/kimhyunbin/Adelie.git
127
- cd Adelie
128
- npm install -g .
129
- ```
130
-
131
- ### Setup
132
-
133
- ```bash
134
- # Initialize a workspace in your project directory
135
- cd /path/to/your/project
136
- adelie init
137
-
138
- # Configure LLM provider
139
- adelie config --provider gemini --api-key YOUR_GEMINI_API_KEY
140
-
141
- # Or use Ollama (local, free)
142
- adelie config --provider ollama --model gemma3:12b
143
-
144
- # Set display language (ko or en)
145
- adelie config --lang en
146
- ```
147
-
148
- ### Run
149
-
150
- ```bash
151
- # Start the autonomous AI loop
152
- adelie run --goal "Build a REST API for task management"
153
-
154
- # Or run a single cycle
155
- adelie run once --goal "Analyze and document the codebase"
156
- ```
157
-
158
- ---
159
-
160
- ## CLI Reference
161
-
162
- ```
163
- Workspace
164
- adelie init [dir] Initialize workspace (default: current dir)
165
- adelie ws List all workspaces
166
- adelie ws remove <N> Remove workspace #N
167
-
168
- Run
169
- adelie run --goal "..." Start AI loop
170
- adelie run ws <N> Resume loop in workspace #N
171
- adelie run once --goal "..." Run exactly one cycle
172
-
173
- Configuration
174
- adelie config Show current config
175
- adelie config --provider ... Switch LLM provider (gemini/ollama)
176
- adelie config --model ... Set model name
177
- adelie config --interval N Set loop interval (seconds)
178
- adelie config --api-key KEY Set Gemini API key
179
- adelie config --lang ko|en Set display language
180
-
181
- Monitoring
182
- adelie status System health & provider status
183
- adelie inform Generate project status report
184
- adelie phase Show current project phase
185
- adelie phase set <phase> Set phase manually
186
-
187
- Knowledge Base
188
- adelie kb Show KB file counts per category
189
- adelie kb --clear-errors Clear error files
190
- adelie kb --reset Reset entire KB (destructive)
191
-
192
- Project Management
193
- adelie goal Show current project goal
194
- adelie goal set "..." Set project goal
195
- adelie feedback "message" Send feedback to the AI loop
196
- adelie research "topic" Search the web and save to KB
197
- adelie git Show git status & recent commits
198
- adelie metrics Show recent cycle metrics
199
-
200
- Ollama
201
- adelie ollama list List installed models
202
- adelie ollama pull <model> Download a model
203
- adelie ollama run [model] Interactive chat
204
-
205
- Telegram
206
- adelie telegram setup Setup bot token
207
- adelie telegram start Start Telegram bot
208
- ```
209
-
210
- ---
211
-
212
- ## Environment Variables
213
-
214
- All settings are stored in `.adelie/.env` (created by `adelie init`):
215
-
216
- | Variable | Default | Description |
217
- |----------|---------|-------------|
218
- | `LLM_PROVIDER` | `gemini` | `gemini` or `ollama` |
219
- | `GEMINI_API_KEY` | | Required for Gemini provider |
220
- | `GEMINI_MODEL` | `gemini-2.0-flash` | Gemini model name |
221
- | `OLLAMA_BASE_URL` | `http://localhost:11434` | Ollama server URL |
222
- | `OLLAMA_MODEL` | `llama3.2` | Ollama model name |
223
- | `FALLBACK_MODELS` | — | Comma-separated fallback chain (e.g. `gemini:gemini-2.5-flash,ollama:llama3.2`) |
224
- | `LOOP_INTERVAL_SECONDS` | `30` | Seconds between loop cycles |
225
- | `ADELIE_LANGUAGE` | `ko` | Display language (`ko` or `en`) |
226
-
227
- ---
228
-
229
- ## Knowledge Base Structure
230
-
231
- The KB uses 6 categories:
232
-
233
- ```
234
- .adelie/workspace/
235
- ├── skills/ # How-to guides, procedures, capabilities
236
- ├── dependencies/ # External APIs, libraries, services
237
- ├── errors/ # Known errors, root causes, recovery
238
- ├── logic/ # Decision patterns, planning docs
239
- ├── exports/ # Reports, roadmaps, outputs
240
- └── maintenance/ # System health, status updates
241
- ```
242
-
243
- All KB files are Markdown with tag-based and semantic (embedding) retrieval.
244
-
245
- ---
246
-
247
- ## Testing
248
-
249
- ```bash
250
- # Run all tests
251
- python -m pytest tests/ -v
252
-
253
- # Run specific test file
254
- python -m pytest tests/test_orchestrator.py -v
255
- ```
256
-
257
- Currently **374 tests** covering all agents, context engine, loop detection, scheduling, and more.
258
-
259
- ---
260
-
261
- ## Project Structure
262
-
263
- ```
264
- Adelie/
265
- ├── adelie/ # Core package
266
- │ ├── orchestrator.py # Main loop controller (state machine)
267
- │ ├── cli.py # CLI commands
268
- │ ├── config.py # Configuration & env loading
269
- │ ├── i18n.py # Internationalization (ko/en)
270
- │ ├── llm_client.py # LLM abstraction (Gemini + Ollama)
271
- │ ├── scheduler.py # Per-agent scheduling
272
- │ ├── phases.py # Project lifecycle phases
273
- │ ├── hooks.py # Event-driven plugin system
274
- │ ├── loop_detector.py # Stuck-loop detection
275
- │ ├── context_engine.py # Per-agent context assembly
276
- │ ├── context_compactor.py # Token budget enforcement
277
- │ ├── process_supervisor.py# Subprocess management
278
- │ ├── feedback_queue.py # User feedback injection
279
- │ ├── git_ops.py # Git auto-commit
280
- │ ├── web_search.py # Web search for Research AI
281
- │ ├── kb/ # Knowledge Base
282
- │ │ ├── retriever.py # Tag + semantic KB retrieval
283
- │ │ └── embedding_store.py
284
- │ ├── agents/ # AI agents
285
- │ │ ├── writer_ai.py # KB file generation
286
- │ │ ├── expert_ai.py # Decision-making
287
- │ │ ├── coder_ai.py # Code generation
288
- │ │ ├── coder_manager.py # Multi-layer coder orchestration
289
- │ │ ├── reviewer_ai.py # Code review
290
- │ │ ├── tester_ai.py # Test execution
291
- │ │ ├── runner_ai.py # Build & deploy
292
- │ │ ├── monitor_ai.py # Health checks
293
- │ │ ├── analyst_ai.py # Project analysis
294
- │ │ ├── research_ai.py # Web research
295
- │ │ ├── scanner_ai.py # Codebase scanning
296
- │ │ └── inform_ai.py # Status reports
297
- │ └── integrations/
298
- │ └── telegram_bot.py # Telegram integration
299
- ├── tests/ # 374 tests
300
- ├── bin/ # Node.js CLI wrapper
301
- ├── scripts/ # Install scripts
302
- ├── requirements.txt # Python dependencies
303
- └── package.json # npm package config
304
- ```
305
-
306
- ---
307
-
308
- ## How It Works
309
-
310
- Each orchestrator cycle runs these steps:
311
-
312
- 1. **Writer AI** creates/updates Knowledge Base files
313
- 2. **Expert AI** reads the KB and makes a structured decision (JSON)
314
- 3. **Research AI** searches the web if the Expert requested external info
315
- 4. **Coder Manager** dispatches code generation tasks by layer
316
- 5. **Reviewer AI** reviews the generated code; retries on failure
317
- 6. **Staging Project** promotes approved code to the project
318
- 7. **Tester AI** runs tests; retries on failure
319
- 8. **Runner AI** builds and deploys
320
- 9. **Monitor AI** checks health; restarts if needed
321
- 10. **Phase Gates** check if the project is ready for the next phase
322
-
323
- The loop runs continuously until shutdown, with the **Scheduler** controlling how often each agent runs and the **Loop Detector** intervening when the system gets stuck.
324
-
325
- ---
326
-
327
- ## License
328
-
329
- MIT see [LICENSE](./LICENSE) for details.
330
-
331
- ---
332
-
333
- <p align="center">
334
- Made with Adelie
335
- </p>
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>
@@ -14,7 +14,13 @@ Layout:
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- import readline # noqa: F401 — enables arrow-key editing in input()
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
- execSync(`"${pip}" install -r "${REQUIREMENTS}"`, { stdio: "inherit" });
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.0",
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/kimhyunbin/Adelie.git"
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/kimhyunbin/Adelie/issues"
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
- # ── 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 — installed on demand) ────────────────
16
- # playwright>=1.40.0
17
- beautifulsoup4>=4.12.0
18
-
19
- # ── Integrations (optional) ─────────────────────────────────────────────────
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
@@ -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 and installs requirements.
7
- */
8
-
9
- const { execSync } = require("child_process");
10
- const path = require("path");
11
- const fs = require("fs");
12
-
13
- const PKG_ROOT = path.resolve(__dirname, "..");
14
- const VENV_DIR = path.join(PKG_ROOT, ".venv");
15
- const REQUIREMENTS = path.join(PKG_ROOT, "requirements.txt");
16
- const IS_WIN = process.platform === "win32";
17
- const PYTHON_BIN = IS_WIN
18
- ? path.join(VENV_DIR, "Scripts", "python.exe")
19
- : path.join(VENV_DIR, "bin", "python");
20
-
21
- if (fs.existsSync(PYTHON_BIN)) {
22
- console.log("[adelie] Python environment already exists, skipping setup.");
23
- process.exit(0);
24
- }
25
-
26
- // Find system Python 3
27
- const candidates = IS_WIN ? ["python", "python3", "py"] : ["python3", "python"];
28
- let sysPython = null;
29
-
30
- for (const cmd of candidates) {
31
- try {
32
- const ver = execSync(`${cmd} --version 2>&1`, { encoding: "utf-8" }).trim();
33
- if (ver.includes("Python 3")) {
34
- sysPython = cmd;
35
- break;
36
- }
37
- } catch {}
38
- }
39
-
40
- if (!sysPython) {
41
- console.error("[adelie] ERROR: Python 3 is required but not found.");
42
- console.error(" Install it from: https://www.python.org/downloads/");
43
- console.error(" After installing Python 3, run: npm rebuild adelie");
44
- process.exit(1);
45
- }
46
-
47
- console.log(`[adelie] Creating Python venv with ${sysPython}...`);
48
-
49
- try {
50
- execSync(`${sysPython} -m venv "${VENV_DIR}"`, { stdio: "inherit" });
51
- const pip = IS_WIN
52
- ? path.join(VENV_DIR, "Scripts", "pip")
53
- : path.join(VENV_DIR, "bin", "pip");
54
- execSync(`"${pip}" install -q -r "${REQUIREMENTS}"`, { stdio: "inherit" });
55
- console.log("[adelie] Python environment ready.");
56
- } catch (err) {
57
- console.error(`[adelie] ERROR: Failed to set up Python environment.`);
58
- console.error(` ${err.message}`);
59
- console.error(" Try manually: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt");
60
- process.exit(1);
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
+ }