codetether 1.2.2__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.
Files changed (66) hide show
  1. a2a_server/__init__.py +29 -0
  2. a2a_server/a2a_agent_card.py +365 -0
  3. a2a_server/a2a_errors.py +1133 -0
  4. a2a_server/a2a_executor.py +926 -0
  5. a2a_server/a2a_router.py +1033 -0
  6. a2a_server/a2a_types.py +344 -0
  7. a2a_server/agent_card.py +408 -0
  8. a2a_server/agents_server.py +271 -0
  9. a2a_server/auth_api.py +349 -0
  10. a2a_server/billing_api.py +638 -0
  11. a2a_server/billing_service.py +712 -0
  12. a2a_server/billing_webhooks.py +501 -0
  13. a2a_server/config.py +96 -0
  14. a2a_server/database.py +2165 -0
  15. a2a_server/email_inbound.py +398 -0
  16. a2a_server/email_notifications.py +486 -0
  17. a2a_server/enhanced_agents.py +919 -0
  18. a2a_server/enhanced_server.py +160 -0
  19. a2a_server/hosted_worker.py +1049 -0
  20. a2a_server/integrated_agents_server.py +347 -0
  21. a2a_server/keycloak_auth.py +750 -0
  22. a2a_server/livekit_bridge.py +439 -0
  23. a2a_server/marketing_tools.py +1364 -0
  24. a2a_server/mcp_client.py +196 -0
  25. a2a_server/mcp_http_server.py +2256 -0
  26. a2a_server/mcp_server.py +191 -0
  27. a2a_server/message_broker.py +725 -0
  28. a2a_server/mock_mcp.py +273 -0
  29. a2a_server/models.py +494 -0
  30. a2a_server/monitor_api.py +5904 -0
  31. a2a_server/opencode_bridge.py +1594 -0
  32. a2a_server/redis_task_manager.py +518 -0
  33. a2a_server/server.py +726 -0
  34. a2a_server/task_manager.py +668 -0
  35. a2a_server/task_queue.py +742 -0
  36. a2a_server/tenant_api.py +333 -0
  37. a2a_server/tenant_middleware.py +219 -0
  38. a2a_server/tenant_service.py +760 -0
  39. a2a_server/user_auth.py +721 -0
  40. a2a_server/vault_client.py +576 -0
  41. a2a_server/worker_sse.py +873 -0
  42. agent_worker/__init__.py +8 -0
  43. agent_worker/worker.py +4877 -0
  44. codetether/__init__.py +10 -0
  45. codetether/__main__.py +4 -0
  46. codetether/cli.py +112 -0
  47. codetether/worker_cli.py +57 -0
  48. codetether-1.2.2.dist-info/METADATA +570 -0
  49. codetether-1.2.2.dist-info/RECORD +66 -0
  50. codetether-1.2.2.dist-info/WHEEL +5 -0
  51. codetether-1.2.2.dist-info/entry_points.txt +4 -0
  52. codetether-1.2.2.dist-info/licenses/LICENSE +202 -0
  53. codetether-1.2.2.dist-info/top_level.txt +5 -0
  54. codetether_voice_agent/__init__.py +6 -0
  55. codetether_voice_agent/agent.py +445 -0
  56. codetether_voice_agent/codetether_mcp.py +345 -0
  57. codetether_voice_agent/config.py +16 -0
  58. codetether_voice_agent/functiongemma_caller.py +380 -0
  59. codetether_voice_agent/session_playback.py +247 -0
  60. codetether_voice_agent/tools/__init__.py +21 -0
  61. codetether_voice_agent/tools/definitions.py +135 -0
  62. codetether_voice_agent/tools/handlers.py +380 -0
  63. run_server.py +314 -0
  64. ui/monitor-tailwind.html +1790 -0
  65. ui/monitor.html +1775 -0
  66. ui/monitor.js +2662 -0
@@ -0,0 +1,570 @@
1
+ Metadata-Version: 2.4
2
+ Name: codetether
3
+ Version: 1.2.2
4
+ Summary: CodeTether: A2A Protocol v0.3 compliant agent orchestration platform with MCP + OpenCode integration
5
+ Home-page: https://github.com/rileyseaburg/codetether
6
+ Author: CodeTether Contributors
7
+ Author-email:
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: fastapi>=0.104.0
19
+ Requires-Dist: uvicorn>=0.24.0
20
+ Requires-Dist: pydantic>=2.0.0
21
+ Requires-Dist: httpx>=0.25.0
22
+ Requires-Dist: aiohttp>=3.9.0
23
+ Requires-Dist: redis>=5.0.0
24
+ Requires-Dist: mcp>=1.0.0
25
+ Requires-Dist: livekit>=0.15.0
26
+ Requires-Dist: livekit-api>=1.0.0
27
+ Requires-Dist: a2a-sdk[http-server]>=0.3.22
28
+ Provides-Extra: test
29
+ Requires-Dist: pytest>=7.4.0; extra == "test"
30
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
31
+ Requires-Dist: pytest-cov>=4.1.0; extra == "test"
32
+ Provides-Extra: dev
33
+ Requires-Dist: black>=23.0.0; extra == "dev"
34
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.6.0; extra == "dev"
36
+ Dynamic: author
37
+ Dynamic: classifier
38
+ Dynamic: description
39
+ Dynamic: description-content-type
40
+ Dynamic: home-page
41
+ Dynamic: license-file
42
+ Dynamic: provides-extra
43
+ Dynamic: requires-dist
44
+ Dynamic: requires-python
45
+ Dynamic: summary
46
+
47
+ <div align="center">
48
+
49
+ # πŸ”— CodeTether
50
+
51
+ ### **Turn AI Agents into Production Systems**
52
+
53
+ [![PyPI version](https://img.shields.io/pypi/v/codetether.svg)](https://pypi.org/project/codetether/)
54
+ [![PyPI downloads](https://img.shields.io/pypi/dm/codetether.svg)](https://pypi.org/project/codetether/)
55
+ [![A2A Protocol](https://img.shields.io/badge/A2A_Protocol-v0.3-green.svg)](https://a2a-protocol.org)
56
+ [![Production Ready](https://img.shields.io/badge/status-production--ready-brightgreen.svg)](https://api.codetether.run)
57
+ [![Apache License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
58
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
59
+ [![Docker](https://img.shields.io/badge/docker-ready-2496ED.svg)](https://www.docker.com/)
60
+ [![Kubernetes](https://img.shields.io/badge/kubernetes-ready-326CE5.svg)](https://kubernetes.io/)
61
+
62
+ **The open-source platform for building, deploying, and orchestrating AI agent systems at scale.**
63
+
64
+ **πŸŽ‰ v1.2.0 Production Release** - Battle-tested and running in production at [api.codetether.run](https://api.codetether.run)
65
+
66
+ [πŸš€ Quick Start](#-quick-start) β€’ [πŸ“– Documentation](https://docs.codetether.run) β€’ [πŸ’¬ Discord](https://discord.gg/codetether) β€’ [🐦 Twitter](https://twitter.com/codetether)
67
+
68
+ ---
69
+
70
+ </div>
71
+
72
+ ## 🎯 What is CodeTether?
73
+
74
+ CodeTether is a **production-ready Agent-to-Agent (A2A) platform** that is **officially A2A Protocol v0.3 compliant**. Build AI agent systems that actually work in the real worldβ€”connect any LLM to any tool, orchestrate complex multi-agent workflows, and deploy with confidence. Our implementation uses the official `a2a-sdk` from Google, ensuring full interoperability with any A2A-compliant client or agent.
75
+
76
+ ```
77
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
78
+ β”‚ CodeTether β”‚
79
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
80
+ β”‚ β”‚ Claude β”‚ β”‚ GPT-4 β”‚ β”‚ Gemini β”‚ LLMs β”‚
81
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚
82
+ β”‚ β”‚ β”‚ β”‚ β”‚
83
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
84
+ β”‚ β–Ό β”‚
85
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
86
+ β”‚ β”‚ A2A Protocol v0.3 Layer β”‚ β”‚
87
+ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
88
+ β”‚ β”‚ β”‚ /.well-known/ β”‚ β”‚ /a2a/jsonrpcβ”‚ β”‚ /a2a/rest/* β”‚ β”‚ β”‚
89
+ β”‚ β”‚ β”‚ agent-card.json β”‚ β”‚ (RPC) β”‚ β”‚ (REST API) β”‚ β”‚ β”‚
90
+ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
91
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
92
+ β”‚ β”‚ β”‚
93
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
94
+ β”‚ β”‚ Message Broker β”‚ Standard Communication β”‚
95
+ β”‚ β”‚ (Redis/Memory) β”‚ β”‚
96
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
97
+ β”‚ β”‚ β”‚
98
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
99
+ β”‚ β–Ό β–Ό β–Ό β”‚
100
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
101
+ β”‚ β”‚ OpenCode β”‚ β”‚ MCP Tools β”‚ β”‚ Your APIs β”‚ Actions β”‚
102
+ β”‚ β”‚ (Coding) β”‚ β”‚ (100+) β”‚ β”‚ β”‚ β”‚
103
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
104
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
105
+ ```
106
+
107
+ ## ✨ Why CodeTether?
108
+
109
+ <table>
110
+ <tr>
111
+ <td width="50%">
112
+
113
+ ### πŸ€– **Multi-Agent Orchestration**
114
+ Build systems where agents collaborate, delegate tasks, and share contextβ€”all through the standardized A2A protocol.
115
+
116
+ ### πŸ› οΈ **MCP Tool Integration**
117
+ Connect to 100+ tools via Model Context Protocol. File systems, databases, APIs, and more.
118
+
119
+ ### πŸ’» **AI Coding at Scale**
120
+ Deploy AI coding agents across your infrastructure using our maintained OpenCode fork. Automated code generation, refactoring, and testing.
121
+
122
+ ### πŸ“§ **Email Reply to Continue Tasks**
123
+ Workers send email notifications when tasks complete. **Reply directly to the email** to continue the conversationβ€”the agent picks up right where it left off. No dashboard needed.
124
+
125
+ </td>
126
+ <td width="50%">
127
+
128
+ ### 🎀 **Voice Agent**
129
+ Real-time voice interactions with AI agents through LiveKit integration. Multi-model support and session playback.
130
+
131
+ ### πŸ“‘ **Real-Time Streaming**
132
+ Watch agents think in real-time. SSE streaming for instant feedback and human intervention.
133
+
134
+ ### πŸš€ **Production Ready**
135
+ Connect workers to `https://api.codetether.run` for live task execution. Helm charts and horizontal scaling included.
136
+
137
+ ### πŸ” **Enterprise Ready**
138
+ Keycloak SSO, RBAC, audit logs, and network policies. Security that enterprises demand.
139
+
140
+ ### ☸️ **Deploy Anywhere**
141
+ Helm charts, horizontal scaling, blue-green deployments. Production from day one on any cloud or on-premise infrastructure.
142
+
143
+ </td>
144
+ </tr>
145
+ </table>
146
+
147
+ ## πŸ”— A2A Protocol Compliance
148
+
149
+ CodeTether implements the **A2A Protocol v0.3** specification using the official `a2a-sdk` from Google, ensuring full interoperability with any A2A-compliant client or agent.
150
+
151
+ ### Standard Endpoints
152
+
153
+ | Endpoint | Description |
154
+ |----------|-------------|
155
+ | `/.well-known/agent-card.json` | Agent capability discovery and metadata |
156
+ | `/a2a/jsonrpc` | JSON-RPC 2.0 endpoint for A2A protocol messages |
157
+ | `/a2a/rest/*` | RESTful API endpoints for task and agent management |
158
+
159
+ ### Interoperability
160
+
161
+ - **Any A2A Client**: Connect using standard A2A protocol clients from any language or platform
162
+ - **Agent Discovery**: Automatic capability discovery via well-known endpoint
163
+ - **Cross-Platform**: Seamlessly communicate with other A2A-compliant agents
164
+ - **SDK Support**: Built on Google's official `a2a-sdk` for guaranteed compatibility
165
+
166
+ ```bash
167
+ # Discover agent capabilities
168
+ curl https://api.codetether.run/.well-known/agent-card.json
169
+
170
+ # Send A2A message via JSON-RPC
171
+ curl -X POST https://api.codetether.run/a2a/jsonrpc \
172
+ -H "Content-Type: application/json" \
173
+ -d '{"jsonrpc": "2.0", "method": "message/send", "params": {...}, "id": 1}'
174
+ ```
175
+
176
+ ## πŸš€ Quick Start
177
+
178
+ ### Install from PyPI
179
+
180
+ ```bash
181
+ pip install codetether
182
+ ```
183
+
184
+ ### Or Install from Source
185
+
186
+ ```bash
187
+ git clone https://github.com/rileyseaburg/codetether.git
188
+ cd A2A-Server-MCP && pip install -e .
189
+
190
+ # For production (PostgreSQL persistence):
191
+ export DATABASE_URL=postgresql://user:password@host:5432/a2a_server
192
+
193
+ # Start the server (defaults to `run`)
194
+ codetether --port 8000
195
+ ```
196
+
197
+ ### Docker
198
+
199
+ ```bash
200
+ docker run -p 8000:8000 registry.quantum-forge.net/library/a2a-server-mcp:latest
201
+ ```
202
+
203
+ ### Kubernetes (Production)
204
+
205
+ ```bash
206
+ helm install codetether oci://registry.quantum-forge.net/library/a2a-server \
207
+ --namespace codetether --create-namespace
208
+ ```
209
+
210
+ ### Distributed Workers (Scale Anywhere)
211
+
212
+ Run agents on any machine with the CodeTether Worker:
213
+
214
+ ```bash
215
+ git clone https://github.com/rileyseaburg/codetether.git
216
+ cd codetether && sudo ./agent_worker/install.sh
217
+ ```
218
+
219
+ Learn more in the [Distributed Workers Guide](https://docs.codetether.run/features/distributed-workers/).
220
+
221
+ ### πŸš€ Production Worker Setup
222
+
223
+ To connect a local worker to the production CodeTether service:
224
+
225
+ 1. **Install the worker**:
226
+ ```bash
227
+ sudo ./agent_worker/install.sh
228
+ ```
229
+
230
+ 2. **Configure for production**:
231
+ Edit `/etc/a2a-worker/env`:
232
+ ```bash
233
+ A2A_SERVER_URL=https://api.codetether.run
234
+ ```
235
+
236
+ 3. **Authenticate models**:
237
+ Ensure your models are authenticated in `~/.local/share/opencode/auth.json`. The worker will only register models it has credentials for.
238
+
239
+ 4. **Restart the service**:
240
+ ```bash
241
+ sudo systemctl restart a2a-agent-worker
242
+ ```
243
+ ```
244
+ # Or use the makefile shortcut:
245
+ make local-worker-restart
246
+ ```
247
+
248
+ **How it works:**
249
+ - Worker discovers local OpenCode sessions from `~/.local/share/opencode/storage/`
250
+ - Worker syncs sessions to PostgreSQL via `/v1/opencode/codebases/{id}/sessions/sync`
251
+ - Worker syncs session messages via `/v1/opencode/codebases/{id}/sessions/{id}/messages/sync`
252
+ - Monitor UI and production API read sessions from PostgreSQL
253
+ - Use `make local-worker-restart` to restart the worker service
254
+
255
+ **That's it.** Your agent platform is running at `http://localhost:8000`
256
+
257
+ ## 🎬 See It In Action
258
+
259
+ ### Talk to Your Agents
260
+
261
+ ```bash
262
+ curl -X POST http://localhost:8000/ \
263
+ -H "Content-Type: application/json" \
264
+ -d '{
265
+ "jsonrpc": "2.0",
266
+ "method": "message/send",
267
+ "params": {"message": {"parts": [{"type": "text", "content": "Calculate 25 * 4"}]}}
268
+ }'
269
+ ```
270
+
271
+ ### Deploy AI Coding Agents
272
+
273
+ ```bash
274
+ # Register a codebase
275
+ curl -X POST http://localhost:8000/v1/opencode/codebases \
276
+ -H "Content-Type: application/json" \
277
+ -d '{"name": "my-app", "path": "/home/user/my-app"}'
278
+
279
+ # Trigger an agent task
280
+ curl -X POST http://localhost:8000/v1/opencode/codebases/{id}/trigger \
281
+ -d '{"prompt": "Add unit tests for the auth module", "agent": "build"}'
282
+ ```
283
+
284
+ ### Stream Real-Time Output
285
+
286
+ ```bash
287
+ curl http://localhost:8000/v1/opencode/codebases/{id}/events
288
+ ```
289
+
290
+ ### πŸ“§ Email Reply to Continue Tasks
291
+
292
+ When a task completes, workers send you an email. **Just reply to continue the conversation**β€”no dashboard, no CLI, just email.
293
+
294
+ ```
295
+ From: noreply@codetether.run
296
+ To: you@example.com
297
+ Subject: [A2A] Task completed: Add unit tests
298
+ Reply-To: task+sess_abc123@inbound.codetether.run
299
+
300
+ βœ“ COMPLETED
301
+
302
+ Your task "Add unit tests" finished successfully.
303
+ Reply to this email to continue the conversation.
304
+
305
+ ---
306
+ You: "Great, now add integration tests too"
307
+ β†’ Agent picks up and continues working
308
+ ```
309
+
310
+ **How it works:**
311
+ 1. Worker completes task β†’ sends email with special `reply-to` address
312
+ 2. You reply to the email with follow-up instructions
313
+ 3. SendGrid forwards your reply to CodeTether
314
+ 4. Server creates a continuation task with your message
315
+ 5. Worker resumes the same session and keeps working
316
+
317
+ **Zero friction.** Check your email, reply, done.
318
+
319
+ ## πŸ—οΈ Architecture
320
+
321
+ CodeTether is built on **five core pillars**:
322
+
323
+ | Component | Purpose | Technology |
324
+ |-----------|---------|------------|
325
+ | **A2A Protocol Server** | Agent communication & orchestration | Python, FastAPI, Redis |
326
+ | **Distributed Workers** | Scale agent execution across machines | Python, Redis, Systemd/K8s |
327
+ | **MCP Integration** | Tool access & resource management | Model Context Protocol |
328
+ | **PostgreSQL Database** | Durable storage for sessions, codebases, tasks | PostgreSQL, asyncpg |
329
+ | **OpenCode Bridge** | AI-powered code generation | Local OpenCode fork, Claude/GPT-4 |
330
+
331
+ ### Platform Components
332
+
333
+ ```
334
+ codetether/
335
+ β”œβ”€β”€ 🌐 API Server # A2A protocol + REST APIs
336
+ β”œβ”€β”€ πŸ–₯️ Monitor UI # Real-time agent dashboard
337
+ β”œβ”€β”€ πŸ‘· [Agent Workers](https://docs.codetether.run/features/distributed-workers/) # Distributed task execution
338
+ β”œβ”€β”€ πŸ€– OpenCode Fork # Maintained AI coding agent
339
+ β”œβ”€β”€ πŸ“š Documentation # MkDocs Material site
340
+ └── 🏠 Marketing Site # Next.js landing page
341
+ ```
342
+
343
+ **Data Flow:**
344
+ ```
345
+ OpenCode Storage (local) β†’ Worker β†’ PostgreSQL β†’ Bridge/API β†’ Monitor UI
346
+ ```
347
+
348
+ Workers sync sessions from local OpenCode storage to PostgreSQL. The OpenCode bridge and Monitor UI read from PostgreSQL, providing a consistent view across server replicas and restarts.
349
+
350
+ ## πŸ“¦ What's Included
351
+
352
+ ### Core Platform
353
+ - βœ… Full A2A Protocol implementation
354
+ - βœ… MCP tool integration
355
+ - βœ… Redis message broker
356
+ - βœ… PostgreSQL durable storage (sessions, codebases, tasks)
357
+ - βœ… SSE real-time streaming
358
+ - βœ… Worker sync to PostgreSQL from OpenCode storage
359
+
360
+ ### Enterprise Features
361
+ - βœ… Keycloak SSO integration
362
+ - βœ… Role-based access control
363
+ - βœ… Audit logging
364
+ - βœ… Network policies
365
+
366
+ ### DevOps Ready
367
+ - βœ… Unified Helm chart (server + marketing + docs)
368
+ - βœ… Blue-green deployments
369
+ - βœ… Horizontal pod autoscaling
370
+ - βœ… Health checks & metrics
371
+
372
+ ### Developer Experience
373
+ - βœ… Real-time Monitor UI
374
+ - βœ… Swift iOS/macOS app
375
+ - βœ… CLI tools
376
+ - βœ… Comprehensive API docs
377
+ - βœ… Voice agent with LiveKit
378
+ - βœ… Marketing coordinator for task orchestration
379
+ - βœ… Worker SSE push notifications
380
+ - βœ… 27 marketing MCP tools (creative, campaigns, analytics)
381
+ - βœ… **Email reply continuation** - reply to task emails to keep working
382
+
383
+ ## πŸ› οΈ Deployment Options
384
+
385
+ | Environment | Command | Description |
386
+ |-------------|---------|-------------|
387
+ | **Local** | `python run_server.py` or `make run` | Development mode |
388
+ | **Production** | `DATABASE_URL=... make k8s-prod` | Full PostgreSQL persistence |
389
+ | **Docker** | `docker-compose up` | Single container |
390
+ | **Kubernetes** | `make k8s-prod` | Full production stack |
391
+
392
+ ### Production Deployment
393
+
394
+ ```bash
395
+ # Build and deploy everything
396
+ make k8s-prod
397
+
398
+ # This builds & deploys:
399
+ # βœ… API Server (api.codetether.run)
400
+ # βœ… Marketing Site (codetether.run)
401
+ # βœ… Documentation (docs.codetether.run)
402
+ # βœ… Redis cluster
403
+ ```
404
+
405
+ ## πŸ”§ Environment Variables
406
+
407
+ | Variable | Description | Default | Required |
408
+ |----------|-------------|---------|------------|
409
+ | `DATABASE_URL` | PostgreSQL connection string | `postgresql://user:pass@host:5432/db` | Yes (production) |
410
+ | `A2A_REDIS_URL` | Redis URL for message broker | `redis://localhost:6379` | No |
411
+ | `A2A_AUTH_TOKENS` | Comma-separated auth tokens (format: `name:token,name2:token2`) | `""` | No |
412
+ | `OPENCODE_HOST` | Host where OpenCode API is running (container→host) | `localhost` | No |
413
+ | `OPENCODE_PORT` | Default OpenCode server port | `9777` | No |
414
+ | `A2A_SERVER_URL` | Production server URL (for workers) | `http://localhost:8000` | No |
415
+
416
+ **Setting DATABASE_URL:**
417
+ ```bash
418
+ # Local development (with PostgreSQL):
419
+ export DATABASE_URL=postgresql://a2a:a2a_password@localhost:5432/a2a_server
420
+
421
+ # Production:
422
+ export DATABASE_URL=postgresql://user:password@prod-db:5432/a2a_server
423
+ ```
424
+
425
+ ## πŸ› Troubleshooting
426
+
427
+ ### Sessions Not Appearing in UI?
428
+
429
+ If you don't see sessions in the production API for a codebase (like "spotlessbinco"):
430
+
431
+ 1. **Check worker is running:**
432
+ ```bash
433
+ sudo systemctl status a2a-agent-worker
434
+ ```
435
+
436
+ 2. **Check worker logs for sync errors:**
437
+ ```bash
438
+ sudo journalctl -fu a2a-agent-worker | grep -i "session\|sync"
439
+ ```
440
+
441
+ 3. **Verify sessions are in PostgreSQL:**
442
+ ```bash
443
+ # Via API:
444
+ curl http://localhost:8000/v1/opencode/database/sessions
445
+
446
+ # Or via psql:
447
+ psql -d a2a_server -c "SELECT id, codebase_id, title FROM sessions ORDER BY updated_at DESC LIMIT 10;"
448
+ ```
449
+
450
+ 4. **Restart worker to force re-sync:**
451
+ ```bash
452
+ make local-worker-restart
453
+ ```
454
+
455
+ **How it works:**
456
+ - Workers read local OpenCode storage from `~/.local/share/opencode/`
457
+ - Workers POST sessions to `/v1/opencode/codebases/{id}/sessions/sync`
458
+ - Server persists to PostgreSQL via `db_upsert_session()`
459
+ - Monitor UI reads from PostgreSQL via `db_list_sessions()`
460
+ - No SQLite involved! All data goes through PostgreSQL
461
+
462
+ ### Worker Not Connecting?
463
+
464
+ 1. **Check `DATABASE_URL` in worker env:**
465
+ ```bash
466
+ cat /etc/a2a-worker/env
467
+ # Should contain: DATABASE_URL=postgresql://...
468
+ ```
469
+
470
+ 2. **Check network connectivity:**
471
+ ```bash
472
+ curl -v https://api.codetether.run/v1/health
473
+ ```
474
+
475
+ 3. **Verify worker is registered:**
476
+ ```bash
477
+ curl http://localhost:8000/v1/opencode/database/workers
478
+ ```
479
+
480
+ For more troubleshooting, see [docs.codetether.run/troubleshooting](https://docs.codetether.run/troubleshooting/)
481
+
482
+ ### Production Deployment
483
+
484
+ ## πŸ”Œ Integrations
485
+
486
+ <table>
487
+ <tr>
488
+ <td align="center"><strong>LLMs</strong></td>
489
+ <td align="center"><strong>Tools</strong></td>
490
+ <td align="center"><strong>Infrastructure</strong></td>
491
+ </tr>
492
+ <tr>
493
+ <td>
494
+
495
+ - Claude (Anthropic)
496
+ - GPT-4 (OpenAI)
497
+ - Gemini (Google)
498
+ - DeepSeek
499
+ - Grok (xAI)
500
+
501
+ </td>
502
+ <td>
503
+
504
+ - File systems
505
+ - Databases
506
+ - Git repositories
507
+ - REST APIs
508
+ - Custom MCP servers
509
+
510
+ </td>
511
+ <td>
512
+
513
+ - Kubernetes
514
+ - Docker
515
+ - Redis
516
+ - Keycloak
517
+ - Any cloud
518
+
519
+ </td>
520
+ </tr>
521
+ </table>
522
+
523
+ ## πŸ“š Documentation
524
+
525
+ | Resource | Link |
526
+ |----------|------|
527
+ | πŸ“– **Full Documentation** | [docs.codetether.run](https://docs.codetether.run) |
528
+ | πŸš€ **Quick Start Guide** | [Getting Started](https://docs.codetether.run/getting-started/quickstart/) |
529
+ | πŸ”§ **API Reference** | [API Docs](https://docs.codetether.run/api/overview/) |
530
+ | πŸ‘· **Agent Worker Guide** | [Agent Worker](https://docs.codetether.run/features/agent-worker/) |
531
+ | 🎀 **Voice Agent** | [Voice Agent](https://docs.codetether.run/features/voice-agent/) |
532
+ | πŸ“Š **Marketing Tools** | [Marketing Tools](https://docs.codetether.run/features/marketing-tools/) |
533
+ | πŸ€– **Marketing Coordinator** | [Marketing Coordinator](https://docs.codetether.run/features/marketing-coordinator/) |
534
+ | πŸ”” **Worker SSE** | [Worker SSE](https://docs.codetether.run/features/worker-sse/) |
535
+ | ☸️ **Kubernetes Deployment** | [Helm Charts](https://docs.codetether.run/deployment/helm/) |
536
+ | πŸ” **Authentication** | [Keycloak Setup](https://docs.codetether.run/auth/keycloak/) |
537
+
538
+ For detailed technical documentation, see [DEVELOPMENT.md](DEVELOPMENT.md).
539
+
540
+ ## 🀝 Contributing
541
+
542
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
543
+
544
+ ```bash
545
+ # Setup development environment
546
+ git clone https://github.com/rileyseaburg/codetether.git
547
+ cd A2A-Server-MCP
548
+ python -m venv venv && source venv/bin/activate
549
+ pip install -r requirements.txt -r requirements-test.txt
550
+
551
+ # Run tests
552
+ pytest tests/
553
+
554
+ # Start development server (Python + Next.js)
555
+ make dev
556
+ ```
557
+
558
+ ## πŸ“„ License
559
+
560
+ Apache License 2.0 - See [LICENSE](LICENSE) for details.
561
+
562
+ ---
563
+
564
+ <div align="center">
565
+
566
+ **Built with ❀️ by the CodeTether Team**
567
+
568
+ [Website](https://codetether.run) β€’ [Documentation](https://docs.codetether.run) β€’ [GitHub](https://github.com/rileyseaburg/codetether)
569
+
570
+ </div>
@@ -0,0 +1,66 @@
1
+ run_server.py,sha256=Qxe_IcU_rD0p7V5wUywLS1uX5dU85NxEfXMdoI3L6y0,12068
2
+ a2a_server/__init__.py,sha256=xy2HuLvJ6m1reFERnjZa6gI9G402dW8cfPD2lV7K9fY,770
3
+ a2a_server/a2a_agent_card.py,sha256=NSZLLGvr8nzj37hkpaBIFae5e4WXtGNI-4jjVpGWu7E,13543
4
+ a2a_server/a2a_errors.py,sha256=sHQnajRGvI-N2HbNcJ-41Yzg4Ms8-9t_sjeYCshuW-4,31537
5
+ a2a_server/a2a_executor.py,sha256=HjS9vpHbLqYdRN6blOpwtLjvNxyvpJ1W945S5Fk5-VY,29903
6
+ a2a_server/a2a_router.py,sha256=piHAEt41K6dANa3WIYEWxlBBdlHR3rwteALjcbLzR28,32243
7
+ a2a_server/a2a_types.py,sha256=Bi-bWS3TKgFh5JLZ_4Gh87qaadCLm4VkMqVZmq4CYfs,9822
8
+ a2a_server/agent_card.py,sha256=FHBa8Oq7wM3GHKnQIBnD6qZv2l5VDcaHOy5dvYj1YHs,13302
9
+ a2a_server/agents_server.py,sha256=3XD0z2s6Bc-kj8g-V1D0LZGcuzRpkMShSC3JbusPaGo,8463
10
+ a2a_server/auth_api.py,sha256=cGbqFIo10XCVHbqTitHhOkLh9X7XeuPf4RItvGykE3E,10004
11
+ a2a_server/billing_api.py,sha256=wJCfm_xdVLhIfRjwe-ibfrwHNwFAHwZT2_KsIHUlQGo,21088
12
+ a2a_server/billing_service.py,sha256=qK7OQWrzlmlAd2lLDk22LRJwk2tR8dB09di5AzXjXGo,24100
13
+ a2a_server/billing_webhooks.py,sha256=9J5D0WgUUj3YhM-kNzEZn679SJFQV9ItYfnl6ODbXH0,15863
14
+ a2a_server/config.py,sha256=mEjTBTNe3AhGuke-u31-W5qEMAhIknBODNMX88wZv3g,2912
15
+ a2a_server/database.py,sha256=u3vvFN4yQL_DYlPcI37dX3DcSgB-lVrxtgrOWvKb_O4,68316
16
+ a2a_server/email_inbound.py,sha256=AjJchALV2-NPfKA9hMPQ8kRbRFpusMdS5i3565_antk,12174
17
+ a2a_server/email_notifications.py,sha256=gGzMkOGDjqLweO_Kkw2keDmMB1Av2uDdp0kzXlM207k,17431
18
+ a2a_server/enhanced_agents.py,sha256=jLNPcMXJb5POs4w7SSK9nr2ScxsoUGGWbimJ-FNUyo0,36918
19
+ a2a_server/enhanced_server.py,sha256=hxLGlXP8rtUNmf3g7h1FCymyZgFpZdgH6awrhQ_G3HE,5814
20
+ a2a_server/hosted_worker.py,sha256=AosnzkAn79QRC2WLl9q9T7P4jRXxklDZZJbLYlhZfLI,36651
21
+ a2a_server/integrated_agents_server.py,sha256=tVRBicVtFfMNPGffwqQ5fogFK8j9bNCGn0vbj9Uo6Ng,11553
22
+ a2a_server/keycloak_auth.py,sha256=9sdRoXUgiSSSXKI9RYCB0eEZFzIaEvQ4xO8WdRnesKs,26543
23
+ a2a_server/livekit_bridge.py,sha256=IlFniUURNEGevTe2HcYtG5M9Nm9O-VzGfG9-15BN5lk,15089
24
+ a2a_server/marketing_tools.py,sha256=l3iBVLLPldrK_J8F82ZDaBVqqirhQsuwDBFmUquiN9E,44469
25
+ a2a_server/mcp_client.py,sha256=8MXLkmOzK0LRj2FUJIfx-8ffhLDlq-b0uLcG6_Z3Igg,6851
26
+ a2a_server/mcp_http_server.py,sha256=E9OfvQbXUbV-GEG9BOyV6lKC-HdfYncdPN_GNGn6QUI,89847
27
+ a2a_server/mcp_server.py,sha256=vcR5CDXBcpptgzQJwhK8cJO-aj0rK8U04TDOrs0qiLk,7227
28
+ a2a_server/message_broker.py,sha256=KwwIaYPoImRAnlxGH9XcyO4oRk9Q3n6WALCRuqy3uyg,26498
29
+ a2a_server/mock_mcp.py,sha256=bnqdEpV8emXc4hfeFle9OHkWbmIJOKftSbHRDegks1g,9662
30
+ a2a_server/models.py,sha256=YxJrQ-Sr7YtMXR8_DRpUR3a0EFp04BpqJxh7EJYzr0Y,16087
31
+ a2a_server/monitor_api.py,sha256=_SH_zQ4cDDKjIf8K8RCa2meXXWvf1fsouNu9hAQp5sk,201709
32
+ a2a_server/opencode_bridge.py,sha256=7LZ6VP_kM-9346HUU-NU6r-mWPJeWWNbXM5vSpjybBA,56998
33
+ a2a_server/redis_task_manager.py,sha256=LEjhhZrNXU3AX-3WdSwxn5Mn73ZhqT6SwPqt4gI7UkA,17578
34
+ a2a_server/server.py,sha256=hoGkUoZ6Htld4y7oQHrLTze6U-rbIFnmH7A64rgj-r0,25894
35
+ a2a_server/task_manager.py,sha256=JX3x_N9no2ezKfBunWL4evIWG6xLR6fXf_4xktEvORo,22921
36
+ a2a_server/task_queue.py,sha256=YQbp1ZdinfmVY0pRzbCnxARcLPawI5cjGJuCdQ49AJs,28035
37
+ a2a_server/tenant_api.py,sha256=EtvI0du0Nc-mmo1mI31cAtBcmHY-vTJpFRlsoJ-LmTA,9704
38
+ a2a_server/tenant_middleware.py,sha256=Swu_Ie3MtrxQQGIW3Gx4ExXYkvuigBzXt2KwRrrUJoY,6511
39
+ a2a_server/tenant_service.py,sha256=bUmXYmIol19MTZ8mZZ4vEjti8Sq6W_1EOugnCEfKXTc,26149
40
+ a2a_server/user_auth.py,sha256=vC5Hc_IoxPqa_PGzI1xqFrKsShcpSdhMNx1oypXArBA,20873
41
+ a2a_server/vault_client.py,sha256=JUgCtcgJU6XqT2Kc7lpNXajmt4s8hR6ppL26B3rm0f8,19095
42
+ a2a_server/worker_sse.py,sha256=GkVU1Z4WaddzjSnyhxyPavcHHL6acru9jhG0y_t4020,30348
43
+ agent_worker/__init__.py,sha256=vnmb2jTYn-iirl8q1vvFdnTGjMy8iD97GO3j9yE3S3M,208
44
+ agent_worker/worker.py,sha256=dmZTZeXcGrX4-3JRTYYs4vQEUFzaHE-gq9LkZcn6n8I,189914
45
+ codetether/__init__.py,sha256=AV3ALMjwLUgIlSzuTFFuJkF5oTfuFiWoZ__-Goz_ItU,271
46
+ codetether/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
47
+ codetether/cli.py,sha256=FtQ0O9syUsGh9dZ6sybk0qBjtM5ioU9uaeGFmP8wkSY,3176
48
+ codetether/worker_cli.py,sha256=I4jSx-A15elKjAv1LWbKvvUahnUGsHDzaMo8x-etHCA,1616
49
+ codetether-1.2.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
50
+ codetether_voice_agent/__init__.py,sha256=4N_hrNMwdAmwe6LMWBINT_9pZ4biPjva9qX8kI7-9nM,120
51
+ codetether_voice_agent/agent.py,sha256=iF_tW0yyRTDlgg6K1T1jKNvK_u99JhGlwpS1JCPgdWM,15395
52
+ codetether_voice_agent/codetether_mcp.py,sha256=gS0BkspaK3dLSO5iNGbFHZ7Tx_KOceZj7T5AaqdkoYU,10378
53
+ codetether_voice_agent/config.py,sha256=qKx1dRQRiHzTuAnSf_y-NZQ0hd0vCwf3EHnVsHjYERc,401
54
+ codetether_voice_agent/functiongemma_caller.py,sha256=W9x6toAPnWJZZV0x9aRvXKlk96oJR7gskpt3xvnQxA4,12396
55
+ codetether_voice_agent/session_playback.py,sha256=ARJffBqa8jhY_DxIYSuTKKwZhh6mSEFebV-7ysX7P1U,8600
56
+ codetether_voice_agent/tools/__init__.py,sha256=00fQZR3yUM0q0Gh9E8q2RT150xNglCRIYpAsygIvN1Q,490
57
+ codetether_voice_agent/tools/definitions.py,sha256=l5haLumDVjY8tqNB4jj9d83XipdYOn1l3e9ZQYNyLb8,4386
58
+ codetether_voice_agent/tools/handlers.py,sha256=zBGJES_KT_WwiIMk_52JLnCNNHEp3j0NtdznUcgq018,12852
59
+ ui/monitor-tailwind.html,sha256=1yqv8ibMoDLce2I8ss_dmbc21p30kLsXRZRut6_X4Ic,96968
60
+ ui/monitor.html,sha256=a803IuN0I8m81UQLH83mbLW_EZ1ZLgctlLgJlb2IEQs,51077
61
+ ui/monitor.js,sha256=gQk1P8-_eFJN1-0ZywxZwPxXfm2M1kJg29B4KSz29Bs,104644
62
+ codetether-1.2.2.dist-info/METADATA,sha256=HB84MRQtwMaRHz5Fc5AhgjsRFZ3t2Byh85Odow986Yg,20951
63
+ codetether-1.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
64
+ codetether-1.2.2.dist-info/entry_points.txt,sha256=7F2rQAXxgkvMZyy70gaOYUOCEMpOhKyBA_3qGBVv1Go,131
65
+ codetether-1.2.2.dist-info/top_level.txt,sha256=rRozf71kp5FfVVlPpUs7VlBIw4-7UAq1E4bNga5os3M,69
66
+ codetether-1.2.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ a2a-server = codetether.cli:main
3
+ codetether = codetether.cli:main
4
+ codetether-worker = codetether.worker_cli:main