pocketcoder-a1 0.2.4__tar.gz → 0.2.5__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.
Files changed (28) hide show
  1. pocketcoder_a1-0.2.5/PKG-INFO +252 -0
  2. pocketcoder_a1-0.2.5/README.md +218 -0
  3. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/__init__.py +1 -1
  4. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/cli.py +11 -3
  5. pocketcoder_a1-0.2.5/pocketcoder_a1.egg-info/PKG-INFO +252 -0
  6. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pyproject.toml +1 -1
  7. pocketcoder_a1-0.2.4/PKG-INFO +0 -228
  8. pocketcoder_a1-0.2.4/README.md +0 -194
  9. pocketcoder_a1-0.2.4/pocketcoder_a1.egg-info/PKG-INFO +0 -228
  10. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/LICENSE +0 -0
  11. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/checkpoint.py +0 -0
  12. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/config.py +0 -0
  13. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/dashboard.py +0 -0
  14. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/loop.py +0 -0
  15. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tasks.py +0 -0
  16. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/__init__.py +0 -0
  17. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/analyzer.py +0 -0
  18. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/browser.py +0 -0
  19. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/report.py +0 -0
  20. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/runner.py +0 -0
  21. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/tester/scenarios.py +0 -0
  22. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/a1/validator.py +0 -0
  23. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pocketcoder_a1.egg-info/SOURCES.txt +0 -0
  24. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pocketcoder_a1.egg-info/dependency_links.txt +0 -0
  25. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pocketcoder_a1.egg-info/entry_points.txt +0 -0
  26. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pocketcoder_a1.egg-info/requires.txt +0 -0
  27. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/pocketcoder_a1.egg-info/top_level.txt +0 -0
  28. {pocketcoder_a1-0.2.4 → pocketcoder_a1-0.2.5}/setup.cfg +0 -0
@@ -0,0 +1,252 @@
1
+ Metadata-Version: 2.1
2
+ Name: pocketcoder-a1
3
+ Version: 0.2.5
4
+ Summary: Autonomous Coding Agent — The Autonomous Gnome
5
+ Author-email: Dmitry Chashchin <chashchin.dmitry@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Chashchin-Dmitry/pocketcoder-a1
8
+ Project-URL: Repository, https://github.com/Chashchin-Dmitry/pocketcoder-a1
9
+ Keywords: ai,coding,agent,autonomous,claude,llm
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.0; extra == "dev"
27
+ Requires-Dist: ruff>=0.1; extra == "dev"
28
+ Provides-Extra: api
29
+ Requires-Dist: anthropic>=0.18; extra == "api"
30
+ Provides-Extra: ollama
31
+ Requires-Dist: ollama>=0.1; extra == "ollama"
32
+ Provides-Extra: test
33
+ Requires-Dist: playwright>=1.40; extra == "test"
34
+
35
+ # PocketCoder-A1
36
+
37
+ **Autonomous Coding Agent with Web Dashboard**
38
+
39
+ Write tasks before bed, press Start, wake up to results. A1 works autonomously — runs code, verifies output, takes the next task. Real-time dashboard shows everything.
40
+
41
+ 7086 lines of Python. Zero frameworks. 3 providers. Verification that catches a lying agent.
42
+
43
+ ![Dashboard](docs/images/dashboard.png)
44
+
45
+ ---
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install pocketcoder-a1
51
+ ```
52
+
53
+ Also need [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code):
54
+ ```bash
55
+ npm i -g @anthropic-ai/claude-code
56
+ ```
57
+
58
+ **Requirements:** Python 3.10+, Node.js 18+
59
+
60
+ Full step-by-step guide: **[GETTING_STARTED.md](GETTING_STARTED.md)**
61
+
62
+ ---
63
+
64
+ ## Quick Start
65
+
66
+ ```bash
67
+ # 1. Create venv
68
+ python3 -m venv .venv
69
+ source .venv/bin/activate
70
+
71
+ # 2. Install
72
+ pip install pocketcoder-a1
73
+
74
+ # 3. Init on your project
75
+ cd /path/to/your-project
76
+ pca init .
77
+
78
+ # 4. Add tasks
79
+ pca task add "Add /api/health endpoint"
80
+ pca task add "Write unit tests for auth"
81
+
82
+ # 5. Launch dashboard
83
+ pca ui
84
+ # Opens http://localhost:7331
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Dashboard
90
+
91
+ 8 pages, 24 API endpoints, everything in one Python file.
92
+
93
+ ### Live Agent Log
94
+
95
+ Watch what Claude does in real-time. Every file read, edit, bash command — with colored icons.
96
+
97
+ ![Live Log](docs/images/live_log.png)
98
+
99
+ ### Tasks with Drag-and-Drop
100
+
101
+ Cards with priorities, statuses, success criteria. Drag to reorder.
102
+
103
+ ![Tasks](docs/images/tasks.png)
104
+
105
+ ### AI Transform
106
+
107
+ Paste messy notes in free form. AI breaks them into structured tasks with descriptions and criteria.
108
+
109
+ ![Transform](docs/images/transform.png)
110
+
111
+ ### Completed
112
+
113
+ 5/5 tasks done. 12 sessions. 23 files modified. All verified.
114
+
115
+ ![Completed](docs/images/completed.png)
116
+
117
+ ### Light Theme
118
+
119
+ ![Light](docs/images/dashboard_light.png)
120
+
121
+ ---
122
+
123
+ ## How It Works
124
+
125
+ ```
126
+ You add tasks → Start Agent → Agent works autonomously
127
+
128
+ Takes next task
129
+
130
+ Writes code (Claude CLI subprocess)
131
+
132
+ Verifies result ← "Don't trust, verify"
133
+ (pytest, py_compile, files on disk)
134
+
135
+ PASS → next task FAIL → retry (max 5)
136
+
137
+ All done → COMPLETED
138
+ ```
139
+
140
+ ### Verification: "Don't Trust, Verify"
141
+
142
+ Agent says "COMPLETED"? We don't believe it. Three-tier check:
143
+
144
+ | Tier | Type | Checks |
145
+ |------|------|--------|
146
+ | 1 | **BLOCKING** | py_compile, pytest, files exist, success criteria |
147
+ | 2 | **WARNING** | ruff, build, git diff |
148
+ | 3 | **ANTI-LOOP** | baseline comparison, max 5 retries, force accept |
149
+
150
+ Caught the agent lying about completion with failing tests. This system prevents that.
151
+
152
+ ---
153
+
154
+ ## Providers
155
+
156
+ | Provider | Command | Requires |
157
+ |----------|---------|----------|
158
+ | **claude-max** | `pca start` | Claude Max subscription |
159
+ | **claude-api** | `pca start --provider claude-api` | Anthropic API key |
160
+ | **ollama** | `pca start --provider ollama` | Local Ollama server |
161
+
162
+ Configure in dashboard: **Settings** page.
163
+
164
+ ---
165
+
166
+ ## CLI Commands
167
+
168
+ | Command | What it does |
169
+ |---------|-------------|
170
+ | `pca init .` | Initialize project |
171
+ | `pca task add "..."` | Add task |
172
+ | `pca tasks` | Show all tasks |
173
+ | `pca start` | Start autonomous agent |
174
+ | `pca start --task task_001` | Work on single task |
175
+ | `pca status` | Current status |
176
+ | `pca validate` | Run validation checks |
177
+ | `pca ui` | Launch dashboard (:7331) |
178
+ | `pca config` | View settings |
179
+ | `pca config set provider ollama` | Change provider |
180
+ | `pca log` | Session history |
181
+ | `pca test` | Run E2E vision tests |
182
+
183
+ ---
184
+
185
+ ## Dashboard Pages
186
+
187
+ | Page | URL | What |
188
+ |------|-----|------|
189
+ | Dashboard | `/` | 6 metric cards, Start/Stop, live log, Quick Add |
190
+ | Tasks | `/tasks` | List + drag-and-drop + bulk add + AI Transform |
191
+ | Task Detail | `/task/{id}` | Full view + logs + Start/Stop/Delete |
192
+ | Sessions | `/sessions` | Session history with metrics |
193
+ | Activity Log | `/log` | Timeline of actions |
194
+ | Settings | `/settings` | Provider, API key, parameters |
195
+ | Commits | `/commits` | Git history |
196
+ | Transform | `/transform` | Free text → structured tasks via AI |
197
+
198
+ ### 6 Metric Cards
199
+
200
+ | Card | Example |
201
+ |------|---------|
202
+ | Tasks | `2/5 done` + progress bar |
203
+ | Session | `#3` + WORKING badge |
204
+ | Tokens | `12.4K in / 3.2K out` |
205
+ | Cost | `$0.08` |
206
+ | Duration | `48s` (live timer) |
207
+ | Files | `3 modified` |
208
+
209
+ ---
210
+
211
+ ## Project Structure
212
+
213
+ ```
214
+ a1/
215
+ ├── loop.py (1219) # Brain: subprocess → stream-json → verify
216
+ ├── dashboard.py (3491) # Web UI: 8 pages, 24 API, inline HTML/CSS/JS
217
+ ├── validator.py (361) # Eyes: syntax, tests, lint, build, criteria
218
+ ├── cli.py (387) # CLI: pca init/task/start/ui/test/config
219
+ ├── config.py (126) # Settings: CLI > env > config.json > defaults
220
+ ├── tasks.py (236) # Tasks: CRUD, priority, reorder, criteria
221
+ ├── checkpoint.py (173) # State: session, status, metrics, decisions
222
+ └── tester/ (1087) # Vision QA: Playwright + Claude Vision
223
+ ```
224
+
225
+ ---
226
+
227
+ ## API
228
+
229
+ Full REST API — 24 endpoints. Monitor from scripts:
230
+
231
+ ```bash
232
+ # Current status
233
+ curl http://localhost:7331/api/status | python -m json.tool
234
+
235
+ # Agent log
236
+ curl "http://localhost:7331/api/log?since=0" | python -m json.tool
237
+
238
+ # Add task
239
+ curl -X POST http://localhost:7331/add-task -d "task=Fix+the+bug&description=details"
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Links
245
+
246
+ - [Habr article (RU)](https://habr.com/ru/articles/991022/) — PocketCoder v1
247
+ - [Telegram](https://t.me/notes_from_cto)
248
+ - [BVMax](https://bvmax.ru/ai)
249
+
250
+ ## License
251
+
252
+ MIT
@@ -0,0 +1,218 @@
1
+ # PocketCoder-A1
2
+
3
+ **Autonomous Coding Agent with Web Dashboard**
4
+
5
+ Write tasks before bed, press Start, wake up to results. A1 works autonomously — runs code, verifies output, takes the next task. Real-time dashboard shows everything.
6
+
7
+ 7086 lines of Python. Zero frameworks. 3 providers. Verification that catches a lying agent.
8
+
9
+ ![Dashboard](docs/images/dashboard.png)
10
+
11
+ ---
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pip install pocketcoder-a1
17
+ ```
18
+
19
+ Also need [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code):
20
+ ```bash
21
+ npm i -g @anthropic-ai/claude-code
22
+ ```
23
+
24
+ **Requirements:** Python 3.10+, Node.js 18+
25
+
26
+ Full step-by-step guide: **[GETTING_STARTED.md](GETTING_STARTED.md)**
27
+
28
+ ---
29
+
30
+ ## Quick Start
31
+
32
+ ```bash
33
+ # 1. Create venv
34
+ python3 -m venv .venv
35
+ source .venv/bin/activate
36
+
37
+ # 2. Install
38
+ pip install pocketcoder-a1
39
+
40
+ # 3. Init on your project
41
+ cd /path/to/your-project
42
+ pca init .
43
+
44
+ # 4. Add tasks
45
+ pca task add "Add /api/health endpoint"
46
+ pca task add "Write unit tests for auth"
47
+
48
+ # 5. Launch dashboard
49
+ pca ui
50
+ # Opens http://localhost:7331
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Dashboard
56
+
57
+ 8 pages, 24 API endpoints, everything in one Python file.
58
+
59
+ ### Live Agent Log
60
+
61
+ Watch what Claude does in real-time. Every file read, edit, bash command — with colored icons.
62
+
63
+ ![Live Log](docs/images/live_log.png)
64
+
65
+ ### Tasks with Drag-and-Drop
66
+
67
+ Cards with priorities, statuses, success criteria. Drag to reorder.
68
+
69
+ ![Tasks](docs/images/tasks.png)
70
+
71
+ ### AI Transform
72
+
73
+ Paste messy notes in free form. AI breaks them into structured tasks with descriptions and criteria.
74
+
75
+ ![Transform](docs/images/transform.png)
76
+
77
+ ### Completed
78
+
79
+ 5/5 tasks done. 12 sessions. 23 files modified. All verified.
80
+
81
+ ![Completed](docs/images/completed.png)
82
+
83
+ ### Light Theme
84
+
85
+ ![Light](docs/images/dashboard_light.png)
86
+
87
+ ---
88
+
89
+ ## How It Works
90
+
91
+ ```
92
+ You add tasks → Start Agent → Agent works autonomously
93
+
94
+ Takes next task
95
+
96
+ Writes code (Claude CLI subprocess)
97
+
98
+ Verifies result ← "Don't trust, verify"
99
+ (pytest, py_compile, files on disk)
100
+
101
+ PASS → next task FAIL → retry (max 5)
102
+
103
+ All done → COMPLETED
104
+ ```
105
+
106
+ ### Verification: "Don't Trust, Verify"
107
+
108
+ Agent says "COMPLETED"? We don't believe it. Three-tier check:
109
+
110
+ | Tier | Type | Checks |
111
+ |------|------|--------|
112
+ | 1 | **BLOCKING** | py_compile, pytest, files exist, success criteria |
113
+ | 2 | **WARNING** | ruff, build, git diff |
114
+ | 3 | **ANTI-LOOP** | baseline comparison, max 5 retries, force accept |
115
+
116
+ Caught the agent lying about completion with failing tests. This system prevents that.
117
+
118
+ ---
119
+
120
+ ## Providers
121
+
122
+ | Provider | Command | Requires |
123
+ |----------|---------|----------|
124
+ | **claude-max** | `pca start` | Claude Max subscription |
125
+ | **claude-api** | `pca start --provider claude-api` | Anthropic API key |
126
+ | **ollama** | `pca start --provider ollama` | Local Ollama server |
127
+
128
+ Configure in dashboard: **Settings** page.
129
+
130
+ ---
131
+
132
+ ## CLI Commands
133
+
134
+ | Command | What it does |
135
+ |---------|-------------|
136
+ | `pca init .` | Initialize project |
137
+ | `pca task add "..."` | Add task |
138
+ | `pca tasks` | Show all tasks |
139
+ | `pca start` | Start autonomous agent |
140
+ | `pca start --task task_001` | Work on single task |
141
+ | `pca status` | Current status |
142
+ | `pca validate` | Run validation checks |
143
+ | `pca ui` | Launch dashboard (:7331) |
144
+ | `pca config` | View settings |
145
+ | `pca config set provider ollama` | Change provider |
146
+ | `pca log` | Session history |
147
+ | `pca test` | Run E2E vision tests |
148
+
149
+ ---
150
+
151
+ ## Dashboard Pages
152
+
153
+ | Page | URL | What |
154
+ |------|-----|------|
155
+ | Dashboard | `/` | 6 metric cards, Start/Stop, live log, Quick Add |
156
+ | Tasks | `/tasks` | List + drag-and-drop + bulk add + AI Transform |
157
+ | Task Detail | `/task/{id}` | Full view + logs + Start/Stop/Delete |
158
+ | Sessions | `/sessions` | Session history with metrics |
159
+ | Activity Log | `/log` | Timeline of actions |
160
+ | Settings | `/settings` | Provider, API key, parameters |
161
+ | Commits | `/commits` | Git history |
162
+ | Transform | `/transform` | Free text → structured tasks via AI |
163
+
164
+ ### 6 Metric Cards
165
+
166
+ | Card | Example |
167
+ |------|---------|
168
+ | Tasks | `2/5 done` + progress bar |
169
+ | Session | `#3` + WORKING badge |
170
+ | Tokens | `12.4K in / 3.2K out` |
171
+ | Cost | `$0.08` |
172
+ | Duration | `48s` (live timer) |
173
+ | Files | `3 modified` |
174
+
175
+ ---
176
+
177
+ ## Project Structure
178
+
179
+ ```
180
+ a1/
181
+ ├── loop.py (1219) # Brain: subprocess → stream-json → verify
182
+ ├── dashboard.py (3491) # Web UI: 8 pages, 24 API, inline HTML/CSS/JS
183
+ ├── validator.py (361) # Eyes: syntax, tests, lint, build, criteria
184
+ ├── cli.py (387) # CLI: pca init/task/start/ui/test/config
185
+ ├── config.py (126) # Settings: CLI > env > config.json > defaults
186
+ ├── tasks.py (236) # Tasks: CRUD, priority, reorder, criteria
187
+ ├── checkpoint.py (173) # State: session, status, metrics, decisions
188
+ └── tester/ (1087) # Vision QA: Playwright + Claude Vision
189
+ ```
190
+
191
+ ---
192
+
193
+ ## API
194
+
195
+ Full REST API — 24 endpoints. Monitor from scripts:
196
+
197
+ ```bash
198
+ # Current status
199
+ curl http://localhost:7331/api/status | python -m json.tool
200
+
201
+ # Agent log
202
+ curl "http://localhost:7331/api/log?since=0" | python -m json.tool
203
+
204
+ # Add task
205
+ curl -X POST http://localhost:7331/add-task -d "task=Fix+the+bug&description=details"
206
+ ```
207
+
208
+ ---
209
+
210
+ ## Links
211
+
212
+ - [Habr article (RU)](https://habr.com/ru/articles/991022/) — PocketCoder v1
213
+ - [Telegram](https://t.me/notes_from_cto)
214
+ - [BVMax](https://bvmax.ru/ai)
215
+
216
+ ## License
217
+
218
+ MIT
@@ -2,5 +2,5 @@
2
2
  PocketCoder-A1: Autonomous Coding Agent
3
3
  """
4
4
 
5
- __version__ = "0.2.4"
5
+ __version__ = "0.2.5"
6
6
  __codename__ = "Autonomous Gnome"
@@ -30,9 +30,17 @@ def cmd_init(args):
30
30
  (a1_dir / "sessions").mkdir(exist_ok=True)
31
31
  (a1_dir / "checkpoints").mkdir(exist_ok=True)
32
32
 
33
- # Инициализируем менеджеры
34
- CheckpointManager(project_dir)
35
- TaskManager(project_dir)
33
+ # Инициализируем менеджеры и записываем файлы на диск
34
+ cm = CheckpointManager(project_dir)
35
+ initial_checkpoint = cm.load()
36
+ cm.save(initial_checkpoint)
37
+
38
+ tm = TaskManager(project_dir)
39
+ tm._save_data(tm._load_data())
40
+
41
+ cfg = Config(project_dir)
42
+ if not cfg.path.exists():
43
+ cfg.save()
36
44
 
37
45
  print(f"[OK] A1 initialized in {project_dir}")
38
46
  print(f" Created: {a1_dir}")