polycoding 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: polycoding
3
+ Version: 0.1.0
4
+ Summary: Coding agent that lives in your project management tool
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.13
7
+ Requires-Dist: alive-progress==3.3.0
8
+ Requires-Dist: celery>=5.4.0
9
+ Requires-Dist: click>=8.0.0
10
+ Requires-Dist: crewai-tools>=0.76.0
11
+ Requires-Dist: crewai[litellm]>=1.10.0b1
12
+ Requires-Dist: fastapi>=0.115.0
13
+ Requires-Dist: flower>=2.0.1
14
+ Requires-Dist: gitpython>=3.1.0
15
+ Requires-Dist: httpx>=0.27.0
16
+ Requires-Dist: langchain-core>=1.2.19
17
+ Requires-Dist: ollama>=0.6.1
18
+ Requires-Dist: pathspec>=0.12.0
19
+ Requires-Dist: psycopg2-binary>=2.9.9
20
+ Requires-Dist: pydantic-settings>=2.0.0
21
+ Requires-Dist: pygithub>=2.8.1
22
+ Requires-Dist: pygls>=1.3.0
23
+ Requires-Dist: pyjwt[crypto]>=2.9.0
24
+ Requires-Dist: pyright>=1.1.408
25
+ Requires-Dist: python-dotenv>=1.0.0
26
+ Requires-Dist: python-socketio>=5.16.1
27
+ Requires-Dist: redis>=5.2.0
28
+ Requires-Dist: rich>=14.3.3
29
+ Requires-Dist: sqlalchemy>=2.0.0
30
+ Requires-Dist: sqlmodel>=0.0.22
31
+ Requires-Dist: tqdm>=4.67.3
32
+ Requires-Dist: tree-sitter-go>=0.23.0
33
+ Requires-Dist: tree-sitter-javascript>=0.23.0
34
+ Requires-Dist: tree-sitter-python>=0.23.0
35
+ Requires-Dist: tree-sitter-rust>=0.23.0
36
+ Requires-Dist: tree-sitter-typescript>=0.23.0
37
+ Requires-Dist: tree-sitter>=0.23.0
38
+ Requires-Dist: ty>=0.0.21
39
+ Requires-Dist: typer>=0.23.1
40
+ Requires-Dist: uvicorn[standard]>=0.32.0
41
+ Description-Content-Type: text/markdown
42
+
43
+ # Polycode 🚀
44
+
45
+ Multi-agent software development automation using CrewAI with GitHub App integration for webhook-driven workflows.
46
+
47
+ ## Overview
48
+
49
+ Polycode automates software development tasks using AI-powered multi-agent workflows built with CrewAI. It integrates as a GitHub App to provide seamless automation across multiple repositories.
50
+
51
+ **Key Features:**
52
+
53
+ - **Multi-agent workflows** with CrewAI framework
54
+ - **GitHub App integration** for multi-repo automation
55
+ - **Webhook-driven automation** triggered by labels
56
+ - **Push to external repos** via GitHub App tokens
57
+ - **Label-to-flow mapping** (e.g., `ralph` → `ralph_flow`)
58
+
59
+ ### Available Workflows
60
+
61
+ - **Ralph Flow** (`ralph`): Fast iterative implementation with automated verification
62
+ - **Feature Development Flow** (`feature-dev`): Comprehensive feature implementation with planning, testing, and review
63
+
64
+ ## Ralph Flow
65
+
66
+ The Ralph Flow is an iterative development workflow that implements changes with built-in verification loops. It's designed for fast, reliable code changes with automatic quality checks.
67
+
68
+ ### How It Works
69
+
70
+ 1. **Setup** - Initialize worktree and pick up the issue
71
+ 2. **Plan** - Decompose the task into ordered user stories
72
+ 3. **Ralph Loop** - Iterative implementation with verification:
73
+ - Implement the current story
74
+ - Run tests to verify changes
75
+ - If tests fail, retry with error context (max 3 iterations)
76
+ - If tests pass, commit the story and move to next
77
+ 4. **Verify Build** - Final build and test verification
78
+ 5. **Push & PR** - Push changes and create pull request
79
+
80
+ ### Ralph Loop Control Flow
81
+
82
+ The loop uses a router-based mechanism with status outputs:
83
+
84
+ - **`retry`** → Continue loop with error context included
85
+ - **`story_done`** → Commit current story, proceed to next
86
+ - **`done`** → All stories complete, run final verification
87
+
88
+ Key safety features:
89
+
90
+ - **Per-Story Commits**: Each story is committed immediately upon completion
91
+ - **Safety Brake**: Maximum 3 iterations per story prevents runaway processes
92
+ - **Error Context**: Agent receives previous errors for smarter retries
93
+
94
+ ### Tools Available to Ralph Agents
95
+
96
+ - **FileReadTool** - Read file contents
97
+ - **FileWriterTool** - Write/modify files
98
+ - **DirectoryReadTool** - Explore directory structure
99
+ - **ExecTool** - Execute shell commands (build, test, lint)
100
+ - **AgentsMDLoaderTool** - Load AGENTS.md context files
101
+
102
+ ## Feature Development Flow
103
+
104
+ A comprehensive workflow for larger feature implementations:
105
+
106
+ 1. **Plan** - Decompose task into ordered user stories
107
+ 2. **Implement** - Implement each story with tests
108
+ 3. **Push** - Push changes to repository
109
+ 4. **Create PR** - Create pull request
110
+ 5. **Review** - Code review with feedback
111
+
112
+ ## Project Structure
113
+
114
+ ```
115
+ polycode/
116
+ ├── src/
117
+ │ ├── ralph/ # Ralph Loop workflow
118
+ │ │ ├── crews/
119
+ │ │ │ ├── plan_crew/ # Planning crew
120
+ │ │ │ └── ralph_crew/ # Implementation crew
121
+ │ │ └── __init__.py # Ralph flow definition
122
+ │ ├── feature_dev/ # Feature development workflow
123
+ │ │ └── crews/
124
+ │ │ ├── plan_crew/
125
+ │ │ ├── implement_crew/
126
+ │ │ ├── verify_crew/
127
+ │ │ ├── test_crew/
128
+ │ │ └── review_crew/
129
+ │ ├── github_app/ # GitHub App integration
130
+ │ ├── project_manager/ # Project management utilities
131
+ │ ├── celery_tasks/ # Async task processing
132
+ │ ├── persistence/ # Database layer
133
+ │ ├── tools/ # Custom CrewAI tools
134
+ │ └── flowbase.py # Base flow classes
135
+ ├── tests/ # Test files
136
+ └── pyproject.toml # Project configuration
137
+ ```
138
+
139
+ ## Installation
140
+
141
+ ### Prerequisites
142
+
143
+ - Python 3.13 or higher
144
+ - `uv` package manager
145
+
146
+ ### Setup
147
+
148
+ ```bash
149
+ # Install dependencies
150
+ uv sync
151
+
152
+ # Configure environment
153
+ cp .env.example .env
154
+ # Edit .env with your credentials
155
+ ```
156
+
157
+ Required environment variables:
158
+
159
+ - `GITHUB_TOKEN` - GitHub personal access token
160
+ - `DATABASE_URL` - PostgreSQL connection string
161
+ - `REDIS_HOST` / `REDIS_PORT` - Redis configuration
162
+ - `OPENAI_API_KEY` - OpenAI API key
163
+
164
+ ## Usage
165
+
166
+ ### Running Flows
167
+
168
+ ```bash
169
+ # Run Ralph flow example
170
+ uv run ralph
171
+
172
+ # Run feature development example
173
+ uv run example
174
+ ```
175
+
176
+ ### GitHub App Integration
177
+
178
+ Polycode includes GitHub App support for webhook-driven automation:
179
+
180
+ 1. **Create GitHub App** at <https://github.com/settings/apps/new>
181
+ 2. **Configure permissions**: Issues, Projects, Contents, Pull requests (Read & Write)
182
+ 3. **Set webhook URL** and secret
183
+ 4. **Generate private key** and add to `.env`
184
+ 5. **Install app** on target repositories
185
+ 6. **Create label mappings** to trigger flows
186
+
187
+ ### Label-to-Flow Mapping
188
+
189
+ ```bash
190
+ # Map "ralph" label to ralph flow
191
+ curl -X POST http://localhost:8000/mappings \
192
+ -H "Content-Type: application/json" \
193
+ -d '{
194
+ "installation_id": 12345,
195
+ "label_name": "ralph",
196
+ "flow_name": "ralph_flow"
197
+ }'
198
+ ```
199
+
200
+ ## Development
201
+
202
+ ### Commands
203
+
204
+ ```bash
205
+ uv sync # Install dependencies
206
+ uv run ruff check . # Lint
207
+ uv run ruff format . # Format
208
+ uv run pytest # Run tests
209
+ uv run pyright # Type check
210
+ ```
211
+
212
+ ### Code Style
213
+
214
+ - Line length: 79 characters
215
+ - Use modern Python 3.10+ type annotations
216
+ - See `src/AGENTS.md` for complete guidelines
217
+
218
+ ## Resources
219
+
220
+ - [CrewAI Documentation](https://docs.crewai.com/)
221
+ - [GitHub Apps Docs](https://docs.github.com/en/apps)
222
+
223
+ ## License
224
+
225
+ MIT [LICENSE](./LICENSE)
@@ -0,0 +1,41 @@
1
+ cli/__init__.py,sha256=WbkPuGbTRtPCddA5SNXfDrI1qFZuReWz3UjeBOkWfY8,1432
2
+ cli/db.py,sha256=xT_TMMTMRRcpeAPa9e4zuJhB0q0XHYi_lRn8mmlSZ9Y,1898
3
+ cli/flow.py,sha256=kwkNri_un8TAnOOlo903_usVt8TJyDZ50tBdR6vve_0,6348
4
+ cli/main.py,sha256=27CVtngZK3uGkEgRJAiyYtCHDT1iW3xu-1hSGOXZxhM,1383
5
+ cli/project.py,sha256=7-SlPJXRJa9jrJNTOZJOvbAXkp-LM4oZH0trhDEMTdI,5115
6
+ cli/server.py,sha256=CnSbRGkpOYh-2XuqHojvONvFnsdGqrOqoBAOPmuPKqY,3949
7
+ cli/utils.py,sha256=MZDJ_GpRdwoezQbgUse3ELsOWPEcr_ql6ksgpU56gF8,1572
8
+ cli/worker.py,sha256=p8FB43s5qs8zU5ZytrSSjD3NychWadt2Au_kbM9r-nQ,3964
9
+ github_app/__init__.py,sha256=JQbrBpJnm6DdVpLZ6MAY6uGXT0PW7aoUhNhf8D8rmu8,402
10
+ github_app/app.py,sha256=4T5cV-NNpePmZEcO_hCdlAPDpk8Y7v25p2wX8QJIkL4,6617
11
+ github_app/auth.py,sha256=emXMCiU22L6azA7AK1k2qCGfesrfSqkWll6qPqOTMdQ,4417
12
+ github_app/config.py,sha256=RUlH2wA87sEWTVZjXRYNrhO51UrUJL987a2T2UUR5oY,1116
13
+ github_app/installation_manager.py,sha256=97bOOzOXL8G-oA6J1UBAhGaQPqxnzBdJstO6JyVrODg,6829
14
+ github_app/label_mapper.py,sha256=FBaCS_7EmxDjzBc3hJStJ6qyux8g8ApZiGAe79kQfcw,3835
15
+ github_app/models.py,sha256=Tp1zw9_ZB_Xcu4aKJ63SMcr595I0Hpp6gtKIRHaWtts,5208
16
+ github_app/webhook_handler.py,sha256=cS6G1_PsnbteIXMlYptmM0ztEIXxPNvLHsgP9RGs6DU,8521
17
+ persistence/__init__.py,sha256=452FrNX7B1GYXxgo5R4K1ybUF1TsbKxSYKTD4xn93XA,126
18
+ persistence/config.py,sha256=isXOAlaSzMiRSzhKl86vehFS14QKAfD1M5WGVVhQ4W4,330
19
+ persistence/postgres.py,sha256=LNSnIkkzem5TRAmuM9yV5on2Ai0pik_g1I1s8c-S1R4,11756
20
+ persistence/registry.py,sha256=gV6Z8F2wAUmcszOCF0IlhBqtm_Vj7nD3B9OAqlRuK8U,3646
21
+ persistence/tasks.py,sha256=APLJsBlP5ghPFz7V7w5QkL5XhTqK-2suN73CTMiUSVE,6004
22
+ project_manager/README.md,sha256=e5udBtRStqDQ3Aq3k9DpOGoPguQOjkI1TuvSqPaj7YQ,16644
23
+ project_manager/__init__.py,sha256=bRsp6ncHWzz2LGQbQeNcS9ShnSnxGEBFp5o-lxfTMmw,682
24
+ project_manager/base.py,sha256=We4KCRdGDZ7E4J__Eqqo_SyQEyrlindPS7jDA0XcwWs,5203
25
+ project_manager/config.py,sha256=Kji1JtRJoNs-GX7HTBUOZa--OhMJqpIY90Y6fPOFtiI,1038
26
+ project_manager/flow_runner.py,sha256=YYC-wN1Gqh2TLo9T8CWxl69AhizeO1jfB0j7MY4NpRM,5620
27
+ project_manager/git_utils.py,sha256=CSqMopjVpJNq0RGWdmxkOuMCT8HnCK0VoaDU7XZj0jc,772
28
+ project_manager/github.py,sha256=OUEqSVkVA0gSOwHSUiNzjiZ7o2a5p_7CSn2xaU-6iss,12413
29
+ project_manager/github_conversation.py,sha256=I4EXtYflTA_cODgzczoNq6EEKSI4HlHb0GLciiygUW8,4834
30
+ project_manager/github_projects_client.py,sha256=2uw3NX3EjNkK81_NIzwIwqHg7EQLVQ_jyLcScTkc7gE,10115
31
+ project_manager/hooks.py,sha256=KRRAo-d4GHLMX_zu9Yq1MYvR_l7IqSlx6gUAvZZ7Jro,13255
32
+ project_manager/module.py,sha256=wWRXvJT60kEymIW3nHeo2PTCHRtwaRbJqcwRfa7DHZQ,2242
33
+ project_manager/types.py,sha256=xWESlIhFcDBjIcChXgftdpEDfrlktPh-glcuM_k0zEw,1998
34
+ project_manager/conversation/__init__.py,sha256=Ji3Ppww80tbcC_nKfTm8IjbKFlezzEsx3a-j2vGJlis,391
35
+ project_manager/conversation/flow.py,sha256=qlNLcDKppoE7av5qhtuLQHL27OdscJikSMiVay0PE40,8514
36
+ project_manager/conversation/types.py,sha256=gkD6aO1JJuclvkbNSOIfhtf6wAYragF6OLPYh5XJMgo,2164
37
+ polycoding-0.1.0.dist-info/METADATA,sha256=17MeyQPNYTgQGKeA_fEyxKDXM87qhvYfMkFSB0nc1Fk,6927
38
+ polycoding-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
39
+ polycoding-0.1.0.dist-info/entry_points.txt,sha256=-1r49Dppa8rFqKqEWj9nS0x44wzMzAjwr1htd478C1A,66
40
+ polycoding-0.1.0.dist-info/licenses/LICENSE,sha256=d-kk7WiJFLP7jYZo-MemeVYOWwK-N_5YBZeijVntY2o,1065
41
+ polycoding-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ example = ralph:example
3
+ polycode = cli.main:app
@@ -0,0 +1,20 @@
1
+ Copyright 2026, ChainSquad GmbH
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
20
+