{"_id":"@craftpipe/orchestrator-a2a","name":"@craftpipe/orchestrator-a2a","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@craftpipe/orchestrator-a2a","version":"1.0.0","type":"module","description":"A2A meta-agent for multi-agent orchestration — agent discovery, task routing, workflow execution, health monitoring, and incident response across Craftpipe A2A agents","bin":{"orchestrator-a2a":"dist/index.js"},"main":"dist/index.js","scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"dependencies":{"@craftpipe/a2a-framework":"file:../a2a-framework/craftpipe-a2a-framework-1.0.0.tgz","zod":"^4.3.6"},"devDependencies":{"@types/node":"^25.6.0","@types/supertest":"^7.2.0","supertest":"^7.2.2","typescript":"^6.0.2","vitest":"^4.1.4"},"keywords":["a2a","orchestrator","multi-agent","workflow","agent-discovery","task-routing","smart-routing","incident-response","developer-tools"],"license":"MIT","author":{"name":"Craftpipe"},"gitHead":"617cd8ad97fd3ca8423091ddeb96ad5b1fa1f434","types":"./dist/index.d.ts","_id":"@craftpipe/orchestrator-a2a@1.0.0","_nodeVersion":"20.19.6","_npmVersion":"11.8.0","dist":{"integrity":"sha512-H052n4KjL8dbvjk938lsQyoAlNWcdLxI9vgNj+DurF/5gqZcIqwqiRwYC1t8m1NwukrMa05UIhQKYZYEcrNBeA==","shasum":"192effe7d313eda4a9a175bb021d2f4e98c08c88","tarball":"https://registry.npmjs.org/@craftpipe/orchestrator-a2a/-/orchestrator-a2a-1.0.0.tgz","fileCount":87,"unpackedSize":158648,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDRTLGub3gQqqX2X3JwLtwCIIgAKkloxE0q0/SEaaGXEAIhALz/KMy4+26JvQVzFbW47Fn+4KizEjDxT8oc4ZCRSzp7"}]},"_npmUser":{"name":"craftpipe","email":"info@heijnesdigital.com"},"directories":{},"maintainers":[{"name":"craftpipe","email":"info@heijnesdigital.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/orchestrator-a2a_1.0.0_1776261772110_0.5542834740564486"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-15T14:02:52.033Z","1.0.0":"2026-04-15T14:02:52.273Z","modified":"2026-04-15T14:02:52.525Z"},"maintainers":[{"name":"craftpipe","email":"info@heijnesdigital.com"}],"description":"A2A meta-agent for multi-agent orchestration — agent discovery, task routing, workflow execution, health monitoring, and incident response across Craftpipe A2A agents","keywords":["a2a","orchestrator","multi-agent","workflow","agent-discovery","task-routing","smart-routing","incident-response","developer-tools"],"author":{"name":"Craftpipe"},"license":"MIT","readme":"<p align=\"center\">\n  <img src=\".github/assets/banner.svg\" alt=\"Orchestrator A2A\" width=\"100%\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/orchestrator-a2a\"><img src=\"https://img.shields.io/npm/v/orchestrator-a2a?style=flat-square&color=6366f1\" alt=\"npm version\"></a>\n  <a href=\"https://opensource.org/licenses/MIT\"><img src=\"https://img.shields.io/badge/license-MIT-6366f1?style=flat-square\" alt=\"MIT License\"></a>\n  <img src=\"https://img.shields.io/badge/skills-13-818cf8?style=flat-square\" alt=\"13 skills\">\n  <img src=\"https://img.shields.io/badge/tests-222-22c55e?style=flat-square\" alt=\"222 tests\">\n  <img src=\"https://img.shields.io/badge/protocol-A2A-6366f1?style=flat-square\" alt=\"A2A Protocol\">\n</p>\n\n# Orchestrator A2A\n\n**The meta-agent for multi-agent orchestration.** Discovers, routes, and coordinates tasks across all Craftpipe A2A agents — agent discovery, task routing, workflow execution, escalation chains, smart TF-IDF routing, health monitoring, and incident response.\n\nUnlike other A2A products that expose domain-specific capabilities, the Orchestrator is the **central coordinator** that ties the entire agent fleet together.\n\n## Architecture\n\n```mermaid\ngraph LR\n    Client[AI Client] --> Orch[Orchestrator A2A<br/>Port 3010]\n    Orch -->|discover| TF[TestForge A2A]\n    Orch -->|route| DF[DocForge A2A]\n    Orch -->|workflow| CG[ComplianceGuard A2A]\n    Orch -->|health| SF[SchemaForge A2A]\n    Orch -->|escalate| FO[FinanceOps A2A]\n    Orch -->|smart-route| DP[DevPilot A2A]\n    Orch -->|incident| CB[CRM Bridge A2A]\n    Orch -->|route| CV[CloudVault A2A]\n    Orch -->|workflow| LL[LogLens A2A]\n    Orch -->|discover| SS[ShipStack A2A]\n    Orch -->|route| PS[ProjectSync A2A]\n\n    style Orch fill:#4338ca,stroke:#6366f1,color:#f0f0ff\n    style Client fill:#1e293b,stroke:#6366f1,color:#e2e8f0\n```\n\n## Workflow Execution\n\n```mermaid\nsequenceDiagram\n    participant C as Client\n    participant O as Orchestrator\n    participant A1 as Agent 1\n    participant A2 as Agent 2\n\n    C->>O: workflow-execute\n    O->>A1: Step 1 (skill: test-scan)\n    A1-->>O: output: {coverage: 85}\n    O->>A2: Step 2 (input: $previous)\n    A2-->>O: output: {readme: \"...\"}\n    O-->>C: workflow completed (2/2 steps)\n```\n\n## Quick Start\n\n```bash\n# Install globally\nnpm install -g orchestrator-a2a\n\n# Start the orchestrator\norchestrator-a2a\n\n# Or with initial agents\nAGENT_URLS=http://localhost:3001,http://localhost:3002 orchestrator-a2a\n```\n\n## Skills\n\n| Skill | Description | Tier |\n|:------|:-----------|:-----|\n| `agent-register` | Register an A2A agent by URL, discover its capabilities | Free |\n| `discover-agents` | List registered agents with optional tag/name filtering | Free |\n| `agent-health` | Health check agents — ping /health, measure response time | Free |\n| `route-task` | Route a task to the correct agent by exact skill ID match | Free |\n| `workflow-status` | Get status of a workflow execution by ID | Free |\n| `task-history` | Query history of tasks routed through the orchestrator | Free |\n| `capability-search` | Search for capabilities across all agents by keyword | Free |\n| `workflow-execute` | Execute multi-step workflows with `$previous` data passing | **Pro** |\n| `escalation-chain` | Try agents in sequence with automatic fallback | **Pro** |\n| `scheduled-workflow` | Schedule workflows for future or recurring execution | **Pro** |\n| `cross-agent-report` | Aggregated report: health, capabilities, task history | **Pro** |\n| `smart-routing` | TF-IDF semantic matching — route by natural language | **Pro** |\n| `incident-response` | Automated incident analysis with severity-based workflows | **Pro** |\n\n## Usage Examples\n\n### Register an Agent\n\n```bash\ncurl -X POST http://localhost:3010/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\", \"id\": 1,\n    \"method\": \"agent-register\",\n    \"params\": { \"url\": \"http://localhost:3001\" }\n  }'\n```\n\n### Route a Task\n\n```bash\ncurl -X POST http://localhost:3010/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\", \"id\": 2,\n    \"method\": \"route-task\",\n    \"params\": {\n      \"skill_id\": \"pii-scan\",\n      \"input\": { \"project_path\": \"/app\" }\n    }\n  }'\n```\n\n### Execute a Workflow (Pro)\n\n```bash\ncurl -X POST http://localhost:3010/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\", \"id\": 3,\n    \"method\": \"workflow-execute\",\n    \"params\": {\n      \"name\": \"Test & Document\",\n      \"steps\": [\n        { \"agent\": \"TestForge A2A\", \"skill\": \"test-scan\", \"input\": { \"project_path\": \"/app\" }, \"on_failure\": \"abort\" },\n        { \"agent\": \"DocForge A2A\", \"skill\": \"generate-readme\", \"input\": \"$previous\", \"on_failure\": \"abort\" }\n      ]\n    }\n  }'\n```\n\n### Smart Routing (Pro)\n\n```bash\ncurl -X POST http://localhost:3010/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\", \"id\": 4,\n    \"method\": \"smart-routing\",\n    \"params\": {\n      \"description\": \"scan my code for privacy and PII violations\",\n      \"input\": { \"project_path\": \"/app\" }\n    }\n  }'\n```\n\n## Agent Card\n\n```bash\ncurl http://localhost:3010/.well-known/agent.json\n```\n\n## Health Check\n\n```bash\ncurl http://localhost:3010/health\n```\n\n## Environment Variables\n\n| Variable | Description | Default |\n|:---------|:-----------|:--------|\n| `PORT` | Server port | `3010` |\n| `AGENT_URLS` | Comma-separated agent URLs to auto-register on startup | — |\n| `PRO_LICENSE` | License key for Pro skills | — |\n\n## How Smart Routing Works\n\nThe `smart-routing` skill uses **TF-IDF (Term Frequency-Inverse Document Frequency)** combined with **cosine similarity** to match natural language task descriptions to agent capabilities:\n\n1. **Tokenize** the task description — lowercase, remove stop words, split on punctuation\n2. **Build corpus** — one document per skill (name + description + tags) across all agents\n3. **Compute TF-IDF vectors** for query and each skill document\n4. **Cosine similarity** between query vector and each skill vector\n5. **Rank and route** to the highest-scoring skill above the confidence threshold\n\nNo external LLM calls required — runs entirely in-process with zero latency overhead.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-c155e872361c40fbd7e88555b306c0fb"}