--- title: A2A-SIN-Code-plugin Agent sdk: docker app_port: 7860 pinned: false --- # A2A-SIN-Code-plugin Agent **Status:** 🚀 Production Ready **Version:** 1.0.0 **Team:** Team - Coder **Manager:** SIN-Zeus --- ## 🎯 Overview A2A-SIN-Code-plugin is an **autonomous cloud coder** that receives tasks via A2A protocol and executes them using the `opencode` CLI. It runs on Hugging Face Spaces (CPU-Basic) and works exclusively on the OpenSIN-Code repository. ## 🚀 Features - **A2A Protocol:** Full JSON-RPC 2.0 compliance - **opencode CLI:** Uses Antigravity-powered opencode for all code generation - **GitHub Integration:** Automatic commits to assigned branches - **Gradio UI:** Operator dashboard for manual task submission and monitoring - **Health Checks:** `/health` endpoint for fleet monitoring - **Type-Specific:** Specialized prompts for plugin tasks ## 🏗️ Architecture ### Request Flow ``` SIN-Zeus → A2A JSON-RPC → Gradio/FastAPI → opencode CLI → GitHub Commit ``` ### Components - **FastAPI Backend:** `/a2a/v1` endpoint, health checks, agent-card - **Gradio Frontend:** Manual task submission, status, logs - **Coder Agent:** Task queue, opencode integration, GitHub ops ### Environment Variables | Variable | Required | Description | |----------|----------|-------------| | `OPENCODE_API_KEY` | Yes | OpenCode API key | | `GITHUB_TOKEN` | Yes | GitHub PAT with repo access | | `HF_TOKEN` | No | Hugging Face token (for deployment) | | `TELEGRAM_TOKEN` | No | Telegram notifications | ## 📡 Interfaces | Interface | URL | Protocol | |-----------|-----|----------| | **Gradio UI** | Space URL | HTTP | | **A2A API** | `/a2a/v1` | JSON-RPC 2.0 | | **Health** | `/health` | HTTP JSON | | **Agent Card** | `/.well-known/agent-card.json` | JSON | | **Dashboard** | https://a2a.delqhi.com/agents/sin-code-plugin | Web | ## 🔧 Usage ### Via A2A (Standard) ```bash curl -X POST https://delqhi-a2a-sin-code-plugin.hf.space/a2a/v1 \ -H 'content-type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": { "message": { "role": "user", "parts": [ { "type": "data", "data": { "description": "Fix the plugin manifest schema validation", "type": "plugin", "issue_number": 1065 } } ] } } }' ``` ### Via Gradio UI 1. Open the Space URL 2. Fill in task description, select type, enter branch name 3. Click "🚀 Submit Task" 4. View status and logs ## 📊 Sample Task Flow 1. **Receive Task:** A2A message with description "Create a new MCP for WhatsApp" 2. **Generate Code:** Call `opencode run` with specialized prompt 3. **Create Files:** Agent writes files to repository (through opencode) 4. **Commit:** Automatic commit to target branch with issue reference 5. **Report:** Status updated in task store, can create PR via separate step ## 🛠️ Supported Task Types | Type | Description | |------|-------------| | `plugin` | OpenCode plugins (MCP servers) | | `command` | CLI commands (sin-* binaries) | | `tool` | Reusable utility functions | | `backend` | API, database, business logic | | `frontend` | UI components, Next.js, React | | `fullstack` | Both frontend + backend | ## 📝 Development ### Local Testing ```bash # Prepare environment export OPENCODE_API_KEY="your-key" export GITHUB_TOKEN="your-token" export REPO_DIR="/path/to/OpenSIN-Code" # Run locally python app.py # Access at http://localhost:7860 ``` ### Building Docker Image ```bash docker build -t delqhi/a2a-sin-code-plugin:latest . docker run -p 7860:7860 -e OPENCODE_API_KEY -e GITHUB_TOKEN delqhi/a2a-sin-code-plugin ``` ## 🔐 Security - **API Keys:** Use Hugging Face Space secrets, never hardcoded - **GitHub Token:** Scoped to specific repository (OpenSIN-Code) - **Network:** Outbound only to opencode API and GitHub - **No Persistent Storage:** Ephemeral filesystem (HF Space default) ## 📈 Monitoring - **Gradio UI:** Real-time task status and logs - **HF Space:** Logs via HF dashboard - **Dashboard:** https://a2a.delqhi.com/agents/sin-code-plugin - **Telegram:** Optional notifications ## 🚀 Deployment ### To Hugging Face Spaces ```bash # Create Space (CPU-Basic required) huggingface-cli repo create delqhi-a2a-sin-code-plugin --type space --space-sdk docker # Set secrets huggingface-cli variable set OPENCODE_API_KEY "$OPENCODE_API_KEY" --repo delqhi-a2a-sin-code-plugin --type space huggingface-cli variable set GITHUB_TOKEN "$GITHUB_TOKEN" --repo delqhi-a2a-sin-code-plugin --type space # Push code git init git remote add origin https://huggingface.co/spaces/delqhi/delqhi-a2a-sin-code-plugin git add . git commit -m "Deploy A2A-SIN-Code-plugin v1.0.0" git push --force origin main # Set hardware to CPU-Basic (via HF UI or API) ``` **IMPORTANT:** Set hardware to `cpu-basic` in Space settings. Never use GPU/ZeroGPU for coding agents. ## 📞 Support - **Dashboard:** https://a2a.delqhi.com/agents/sin-code-plugin - **Docs Tab:** [Google Docs](https://docs.google.com/document/d/1RtoHn4I0GntuEEOHHkqoh_dMuGzgMwQz7_8oxAOpQbw/edit?tab=t.t.56da546b17b8ef18) - **Team Manager:** SIN-Zeus --- **Last Updated:** 2026-04-07 **Agent:** A2A-SIN-Code-plugin v1.0.0 **Owner:** Team - Coder / SIN-Zeus