alfie-cli 0.0.1__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.
- alfie_cli-0.0.1/.gitignore +21 -0
- alfie_cli-0.0.1/LICENSE +21 -0
- alfie_cli-0.0.1/PKG-INFO +440 -0
- alfie_cli-0.0.1/README.md +408 -0
- alfie_cli-0.0.1/demo/hello.txt +0 -0
- alfie_cli-0.0.1/demo/readme.md +0 -0
- alfie_cli-0.0.1/demo/world.txt +0 -0
- alfie_cli-0.0.1/docs/01_CONCEPT.md +146 -0
- alfie_cli-0.0.1/docs/02_ARCHITECTURE.md +462 -0
- alfie_cli-0.0.1/docs/03_BUILD_PLAN.md +318 -0
- alfie_cli-0.0.1/pyproject.toml +57 -0
- alfie_cli-0.0.1/src/alfie/__init__.py +3 -0
- alfie_cli-0.0.1/src/alfie/cli.py +704 -0
- alfie_cli-0.0.1/src/alfie/config.py +104 -0
- alfie_cli-0.0.1/src/alfie/events/__init__.py +1 -0
- alfie_cli-0.0.1/src/alfie/events/bus.py +50 -0
- alfie_cli-0.0.1/src/alfie/memory/__init__.py +5 -0
- alfie_cli-0.0.1/src/alfie/memory/prompts.py +50 -0
- alfie_cli-0.0.1/src/alfie/memory/store.py +144 -0
- alfie_cli-0.0.1/src/alfie/models.py +170 -0
- alfie_cli-0.0.1/src/alfie/planner/__init__.py +17 -0
- alfie_cli-0.0.1/src/alfie/planner/base.py +118 -0
- alfie_cli-0.0.1/src/alfie/planner/client.py +130 -0
- alfie_cli-0.0.1/src/alfie/planner/planner.py +212 -0
- alfie_cli-0.0.1/src/alfie/safety/__init__.py +1 -0
- alfie_cli-0.0.1/src/alfie/safety/guard.py +60 -0
- alfie_cli-0.0.1/src/alfie/scheduler/__init__.py +9 -0
- alfie_cli-0.0.1/src/alfie/scheduler/dag.py +535 -0
- alfie_cli-0.0.1/src/alfie/tmux/__init__.py +1 -0
- alfie_cli-0.0.1/src/alfie/tmux/pane.py +72 -0
- alfie_cli-0.0.1/src/alfie/tmux/session.py +108 -0
- alfie_cli-0.0.1/src/alfie/tools/__init__.py +1 -0
- alfie_cli-0.0.1/src/alfie/tools/base.py +31 -0
- alfie_cli-0.0.1/src/alfie/watcher/__init__.py +10 -0
- alfie_cli-0.0.1/src/alfie/watcher/engine.py +393 -0
- alfie_cli-0.0.1/test_project/greeting.txt +1 -0
- alfie_cli-0.0.1/test_project/info.txt +1 -0
- alfie_cli-0.0.1/test_project/notes.md +1 -0
- alfie_cli-0.0.1/tests/conftest.py +22 -0
- alfie_cli-0.0.1/tests/fixtures/diamond_plan.json +29 -0
- alfie_cli-0.0.1/tests/fixtures/fail_plan.json +25 -0
- alfie_cli-0.0.1/tests/fixtures/simple_plan.json +17 -0
- alfie_cli-0.0.1/tests/test_cli_run.py +77 -0
- alfie_cli-0.0.1/tests/test_config.py +18 -0
- alfie_cli-0.0.1/tests/test_events.py +38 -0
- alfie_cli-0.0.1/tests/test_memory.py +170 -0
- alfie_cli-0.0.1/tests/test_models.py +75 -0
- alfie_cli-0.0.1/tests/test_planner.py +373 -0
- alfie_cli-0.0.1/tests/test_safety.py +81 -0
- alfie_cli-0.0.1/tests/test_scheduler.py +639 -0
- alfie_cli-0.0.1/tests/test_watcher.py +460 -0
alfie_cli-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 P-Typed Research Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
alfie_cli-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alfie-cli
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Artificial Lifeform Intelligent Entity — terminal-native AI agent orchestrator
|
|
5
|
+
Author: P-Typed Research Labs
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent,ai,automation,cli,orchestrator,tmux
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Classifier: Topic :: System :: Systems Administration
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: aiosqlite>=0.19.0
|
|
20
|
+
Requires-Dist: libtmux>=0.31.0
|
|
21
|
+
Requires-Dist: openai>=1.0.0
|
|
22
|
+
Requires-Dist: pydantic>=2.0.0
|
|
23
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
24
|
+
Requires-Dist: rich>=13.0.0
|
|
25
|
+
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
|
|
26
|
+
Requires-Dist: typer>=0.9.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
|
|
35
|
+
# 🤖 ALFIE CLI
|
|
36
|
+
|
|
37
|
+
**Artificial Lifeform Intelligent Entity**
|
|
38
|
+
|
|
39
|
+
*A terminal-native AI agent orchestrator that plans, executes, monitors, and self-heals shell-level tasks using LLM reasoning.*
|
|
40
|
+
|
|
41
|
+
[](https://pypi.org/project/alfie-cli/)
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
[](LICENSE)
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## What is ALFIE?
|
|
50
|
+
|
|
51
|
+
ALFIE bridges the gap between **AI that talks** and **AI that works**. Instead of just generating code or giving advice, ALFIE takes control of your terminal — planning multi-step shell workflows as directed acyclic graphs (DAGs), executing them with real process management, monitoring output in real time, and recovering from failures automatically.
|
|
52
|
+
|
|
53
|
+
**Give it an intent in plain English — it breaks it into tasks, orders them by dependencies, runs them in parallel where possible, and reports back.**
|
|
54
|
+
|
|
55
|
+
### Key Features
|
|
56
|
+
|
|
57
|
+
- **Natural Language → Execution Plans** — Describe what you want; ALFIE's LLM planner generates a fully structured DAG of shell commands
|
|
58
|
+
- **DAG Scheduler** — Topological sorting, dependency tracking, parallel execution across a pane pool
|
|
59
|
+
- **Multi-Model Support** — Works with OpenAI, Anthropic, and Google models via the Vercel AI Gateway
|
|
60
|
+
- **Interactive Chat** — Multi-turn REPL with conversation memory and auto-execution of detected plans
|
|
61
|
+
- **Watcher Engine** — Real-time pane monitoring with state classification (idle / running / error / stuck / interactive)
|
|
62
|
+
- **Safety Guard** — Command blocklist, confirmation prompts for destructive operations, configurable safety policies
|
|
63
|
+
- **OS-Aware** — Detects Windows/Linux/macOS and generates platform-appropriate commands (PowerShell on Windows, bash on *nix)
|
|
64
|
+
- **Session Memory** — Persistent conversation history with per-session storage, trimming, and recall
|
|
65
|
+
- **Dry Run Mode** — Validate and safety-check plans without executing anything
|
|
66
|
+
- **Rich Terminal UI** — Beautiful tables, panels, spinners, and live-updating displays via Rich
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install alfie-cli
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or install from source:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git clone https://github.com/p-typed/alfie-cli.git
|
|
80
|
+
cd alfie-cli
|
|
81
|
+
pip install -e ".[dev]"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Requirements
|
|
85
|
+
|
|
86
|
+
- **Python 3.11+**
|
|
87
|
+
- An API key for the [Vercel AI Gateway](https://sdk.vercel.ai/) (supports OpenAI, Anthropic, Google models)
|
|
88
|
+
|
|
89
|
+
### Configuration
|
|
90
|
+
|
|
91
|
+
Set your API key as an environment variable:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# PowerShell (Windows)
|
|
95
|
+
$env:AI_GATEWAY_API_KEY = "your-api-key"
|
|
96
|
+
|
|
97
|
+
# Bash / Zsh (Linux / macOS)
|
|
98
|
+
export AI_GATEWAY_API_KEY="your-api-key"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or create a `.env` file in your project root:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
AI_GATEWAY_API_KEY=your-api-key
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Check ALFIE is installed
|
|
113
|
+
alfie version
|
|
114
|
+
|
|
115
|
+
# Verify system requirements
|
|
116
|
+
alfie doctor
|
|
117
|
+
|
|
118
|
+
# Run a task from natural language
|
|
119
|
+
alfie run "create a hello.txt file that says hello world"
|
|
120
|
+
|
|
121
|
+
# Run a multi-step task
|
|
122
|
+
alfie run "find all python files, count lines of code, and write a summary to report.txt"
|
|
123
|
+
|
|
124
|
+
# Use a specific model
|
|
125
|
+
alfie run "list system info" --model anthropic/claude-sonnet-4-20250514
|
|
126
|
+
|
|
127
|
+
# Dry-run to validate without executing
|
|
128
|
+
alfie run "delete temp files" --dry-run
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Commands
|
|
134
|
+
|
|
135
|
+
### `alfie run`
|
|
136
|
+
|
|
137
|
+
Execute a task from natural language or a JSON plan file.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Natural language intent
|
|
141
|
+
alfie run "install dependencies and run tests"
|
|
142
|
+
|
|
143
|
+
# From a saved plan file
|
|
144
|
+
alfie run "deploy" --plan ./my-plan.json
|
|
145
|
+
|
|
146
|
+
# Dry-run mode — validate safety without executing
|
|
147
|
+
alfie run "rm -rf /tmp/old" --dry-run
|
|
148
|
+
|
|
149
|
+
# Specify a model
|
|
150
|
+
alfie run "gather system specs" --model google/gemini-2.5-flash
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**How it works:**
|
|
154
|
+
1. Your intent is sent to the LLM planner
|
|
155
|
+
2. The planner returns a structured DAG of tasks with dependencies
|
|
156
|
+
3. The DAG scheduler topologically sorts tasks and executes them layer by layer
|
|
157
|
+
4. Results are displayed in a rich summary table
|
|
158
|
+
|
|
159
|
+
### `alfie chat`
|
|
160
|
+
|
|
161
|
+
Interactive multi-turn conversation with auto-execution of plans.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Start a new chat session
|
|
165
|
+
alfie chat
|
|
166
|
+
|
|
167
|
+
# Resume a previous session
|
|
168
|
+
alfie chat --session abc123
|
|
169
|
+
|
|
170
|
+
# Use a different model
|
|
171
|
+
alfie chat --model anthropic/claude-sonnet-4-20250514
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Chat commands:**
|
|
175
|
+
| Command | Description |
|
|
176
|
+
|----------|--------------------------------|
|
|
177
|
+
| `/clear` | Clear conversation history |
|
|
178
|
+
| `/info` | Show session info |
|
|
179
|
+
| `/exit` | Quit (or press Ctrl+C) |
|
|
180
|
+
|
|
181
|
+
When you ask ALFIE to *do* something in chat, it automatically generates and executes a plan — no extra confirmation needed.
|
|
182
|
+
|
|
183
|
+
### `alfie memory`
|
|
184
|
+
|
|
185
|
+
Manage conversation memory across sessions.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# List all saved sessions
|
|
189
|
+
alfie memory list
|
|
190
|
+
|
|
191
|
+
# Show a specific session
|
|
192
|
+
alfie memory show <session-id>
|
|
193
|
+
|
|
194
|
+
# Delete a session
|
|
195
|
+
alfie memory delete <session-id>
|
|
196
|
+
|
|
197
|
+
# Clear all sessions
|
|
198
|
+
alfie memory clear
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### `alfie watch`
|
|
202
|
+
|
|
203
|
+
Monitor a running tmux session in real time.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Watch a tmux session
|
|
207
|
+
alfie watch my-session
|
|
208
|
+
|
|
209
|
+
# Custom poll interval and timeout
|
|
210
|
+
alfie watch my-session --poll 5 --timeout 600
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### `alfie doctor`
|
|
214
|
+
|
|
215
|
+
Check system requirements and configuration.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
alfie doctor
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Shows status of Python version, tmux availability, API key configuration, and more.
|
|
222
|
+
|
|
223
|
+
### `alfie config`
|
|
224
|
+
|
|
225
|
+
Display the current configuration as JSON.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
alfie config
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Other Commands
|
|
232
|
+
|
|
233
|
+
| Command | Description |
|
|
234
|
+
|------------------|------------------------------------------|
|
|
235
|
+
| `alfie version` | Show ALFIE version |
|
|
236
|
+
| `alfie status` | Check status of current session |
|
|
237
|
+
| `alfie kill` | Emergency stop — kill all running tasks |
|
|
238
|
+
| `alfie history` | Show past sessions |
|
|
239
|
+
| `alfie logs` | Tail audit log |
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Supported Models
|
|
244
|
+
|
|
245
|
+
ALFIE works with any model available through the Vercel AI Gateway. Tested models include:
|
|
246
|
+
|
|
247
|
+
| Provider | Model | Flag |
|
|
248
|
+
|------------|---------------------------------|------------------------------------------|
|
|
249
|
+
| OpenAI | GPT-4o Mini *(default)* | `--model gpt-4o-mini` |
|
|
250
|
+
| OpenAI | GPT-4o | `--model gpt-4o` |
|
|
251
|
+
| Anthropic | Claude Sonnet 4 | `--model anthropic/claude-sonnet-4-20250514` |
|
|
252
|
+
| Google | Gemini 2.5 Pro | `--model google/gemini-2.5-pro` |
|
|
253
|
+
| Google | Gemini 2.5 Flash | `--model google/gemini-2.5-flash` |
|
|
254
|
+
| Google | Gemini 2.0 Flash | `--model google/gemini-2.0-flash` |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Python API
|
|
259
|
+
|
|
260
|
+
ALFIE can be used as a library in your own Python code:
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
from alfie.planner import Planner
|
|
264
|
+
from alfie.scheduler.dag import TaskScheduler, PanePool, topological_sort
|
|
265
|
+
from alfie.models import Plan
|
|
266
|
+
|
|
267
|
+
# Generate a plan from natural language
|
|
268
|
+
planner = Planner(model="gpt-4o-mini")
|
|
269
|
+
plan = planner.generate("install numpy and run a quick benchmark")
|
|
270
|
+
|
|
271
|
+
# Inspect the plan
|
|
272
|
+
for task in plan.tasks:
|
|
273
|
+
print(f"{task.id}: {task.cmd} (depends on: {task.depends_on})")
|
|
274
|
+
|
|
275
|
+
# Use the DAG scheduler
|
|
276
|
+
layers = topological_sort(plan.tasks)
|
|
277
|
+
print(f"Execution will proceed in {len(layers)} layers")
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Async Support
|
|
281
|
+
|
|
282
|
+
```python
|
|
283
|
+
import asyncio
|
|
284
|
+
from alfie.planner import Planner
|
|
285
|
+
|
|
286
|
+
async def main():
|
|
287
|
+
planner = Planner(model="gpt-4o-mini")
|
|
288
|
+
plan = await planner.agenerate("check disk usage and memory stats")
|
|
289
|
+
for task in plan.tasks:
|
|
290
|
+
print(f"{task.id}: {task.cmd}")
|
|
291
|
+
|
|
292
|
+
asyncio.run(main())
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Memory Store
|
|
296
|
+
|
|
297
|
+
```python
|
|
298
|
+
from alfie.memory.store import MemoryStore
|
|
299
|
+
|
|
300
|
+
# Create or resume a session
|
|
301
|
+
mem = MemoryStore(session_id="my-session")
|
|
302
|
+
mem.add("user", "Hello ALFIE")
|
|
303
|
+
mem.add("assistant", "Hello! How can I help?")
|
|
304
|
+
|
|
305
|
+
# Get messages for LLM context
|
|
306
|
+
messages = mem.get_context_messages(system_prompt="You are ALFIE.")
|
|
307
|
+
|
|
308
|
+
# List all sessions
|
|
309
|
+
for session in mem.list_sessions():
|
|
310
|
+
print(session)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Architecture
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
alfie/
|
|
319
|
+
├── cli.py # Typer CLI — all user-facing commands
|
|
320
|
+
├── config.py # Pydantic configuration (TOML-backed)
|
|
321
|
+
├── models.py # Domain models — Task, Plan, Session, etc.
|
|
322
|
+
├── planner/
|
|
323
|
+
│ ├── base.py # System prompt + JSON schema for structured output
|
|
324
|
+
│ ├── client.py # OpenAI SDK wrapper → Vercel AI Gateway
|
|
325
|
+
│ └── planner.py # LLM planning engine with retry + DAG validation
|
|
326
|
+
├── scheduler/
|
|
327
|
+
│ └── dag.py # Topological sort, PanePool, TaskScheduler
|
|
328
|
+
├── watcher/
|
|
329
|
+
│ └── engine.py # Real-time pane monitoring + state classification
|
|
330
|
+
├── memory/
|
|
331
|
+
│ ├── store.py # JSON-backed conversation persistence
|
|
332
|
+
│ └── prompts.py # Chat system prompt (OS-aware)
|
|
333
|
+
├── events/
|
|
334
|
+
│ └── bus.py # Pub/sub event bus
|
|
335
|
+
├── safety/
|
|
336
|
+
│ └── guard.py # Command validation + blocklist
|
|
337
|
+
└── tmux/
|
|
338
|
+
└── session.py # tmux session/pane wrappers
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Execution Flow
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
User Intent (natural language)
|
|
345
|
+
│
|
|
346
|
+
▼
|
|
347
|
+
┌─────────────┐
|
|
348
|
+
│ LLM Planner │ ← Vercel AI Gateway (OpenAI / Anthropic / Google)
|
|
349
|
+
└──────┬──────┘
|
|
350
|
+
│ structured JSON plan (DAG)
|
|
351
|
+
▼
|
|
352
|
+
┌─────────────┐
|
|
353
|
+
│ Safety Guard │ ← blocklist check, confirmation prompts
|
|
354
|
+
└──────┬──────┘
|
|
355
|
+
│
|
|
356
|
+
▼
|
|
357
|
+
┌──────────────┐
|
|
358
|
+
│ DAG Scheduler │ ← topological sort → layer-by-layer execution
|
|
359
|
+
└──────┬───────┘
|
|
360
|
+
│ parallel task dispatch
|
|
361
|
+
▼
|
|
362
|
+
┌──────────────┐
|
|
363
|
+
│ Executor │ ← subprocess (PowerShell on Windows, bash on *nix)
|
|
364
|
+
└──────┬───────┘
|
|
365
|
+
│ stdout/stderr
|
|
366
|
+
▼
|
|
367
|
+
┌──────────────┐
|
|
368
|
+
│ Watcher │ ← state classification, timeout detection, recovery
|
|
369
|
+
└──────────────┘
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Development
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Clone the repo
|
|
378
|
+
git clone https://github.com/p-typed/alfie-cli.git
|
|
379
|
+
cd alfie-cli
|
|
380
|
+
|
|
381
|
+
# Create a virtual environment
|
|
382
|
+
python -m venv venv
|
|
383
|
+
venv\Scripts\activate # Windows
|
|
384
|
+
# source venv/bin/activate # Linux/macOS
|
|
385
|
+
|
|
386
|
+
# Install in development mode
|
|
387
|
+
pip install -e ".[dev]"
|
|
388
|
+
|
|
389
|
+
# Run tests
|
|
390
|
+
pytest
|
|
391
|
+
|
|
392
|
+
# Lint
|
|
393
|
+
ruff check src/ tests/
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Running Tests
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
# Run all 172 tests
|
|
400
|
+
pytest
|
|
401
|
+
|
|
402
|
+
# Run with verbose output
|
|
403
|
+
pytest -v
|
|
404
|
+
|
|
405
|
+
# Run a specific test file
|
|
406
|
+
pytest tests/test_scheduler.py
|
|
407
|
+
|
|
408
|
+
# Run a specific test
|
|
409
|
+
pytest tests/test_planner.py -k "test_generate_simple"
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## Roadmap
|
|
415
|
+
|
|
416
|
+
- [x] **Phase 0** — Foundation (CLI, config, models, events, safety)
|
|
417
|
+
- [x] **Phase 1** — Watcher Engine (real-time pane monitoring)
|
|
418
|
+
- [x] **Phase 2** — DAG Scheduler (topological sort, parallel execution)
|
|
419
|
+
- [x] **Phase 3** — LLM Planner (Vercel AI Gateway integration)
|
|
420
|
+
- [x] **Memory & Chat** — Persistent conversations + interactive REPL
|
|
421
|
+
- [ ] **Phase 4** — Real tmux executor (full process management)
|
|
422
|
+
- [ ] **Phase 5** — Persistent storage (aiosqlite session history)
|
|
423
|
+
- [ ] **Phase 6** — Re-planning (automatic failure recovery via LLM)
|
|
424
|
+
- [ ] **Phase 7** — Polish (documentation, packaging, CI/CD)
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## License
|
|
429
|
+
|
|
430
|
+
MIT — see [LICENSE](LICENSE).
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
<div align="center">
|
|
435
|
+
|
|
436
|
+
**Built by [P-Typed Research Labs](https://github.com/p-typed)**
|
|
437
|
+
|
|
438
|
+
*ALFIE doesn't just plan — it executes.*
|
|
439
|
+
|
|
440
|
+
</div>
|