From 5abf6be991c8cfa1517c6f7ce2cb8a11436b68dd Mon Sep 17 00:00:00 2001 From: OG T Date: Thu, 11 Jun 2026 14:40:02 +0800 Subject: [PATCH] feat: expose A2A agent integration catalog --- A2A_AGENT_INTEGRATION_ROADMAP.md | 2 + README.md | 1 + apps/web/public/.well-known/agent-card.json | 18 + apps/web/public/agent.json | 13 + apps/web/public/llms.txt | 9 + .../web/src/app/api/a2a/integrations/route.ts | 24 ++ apps/web/src/app/page.tsx | 48 +++ apps/web/src/lib/a2a-agent-integrations.ts | 344 ++++++++++++++++++ apps/web/src/lib/a2a-growth.ts | 18 + 9 files changed, 477 insertions(+) create mode 100644 apps/web/src/app/api/a2a/integrations/route.ts create mode 100644 apps/web/src/lib/a2a-agent-integrations.ts diff --git a/A2A_AGENT_INTEGRATION_ROADMAP.md b/A2A_AGENT_INTEGRATION_ROADMAP.md index 21acab6..cd9c566 100644 --- a/A2A_AGENT_INTEGRATION_ROADMAP.md +++ b/A2A_AGENT_INTEGRATION_ROADMAP.md @@ -51,6 +51,8 @@ The project should integrate many agents, but not by giving every tool full prod - `apps/web/src/lib/a2a-broadcasters/telegram.ts` sends A2A task broadcasts to Telegram through the Telegram Bot API. - `apps/web/src/app/api/cron/a2a-dispatcher/route.ts` now includes Telegram in the broadcast fanout. +- `apps/web/src/lib/a2a-agent-integrations.ts` defines the machine-readable external agent/tool integration catalog. +- `GET /api/a2a/integrations?agent_id=` exposes VibeAIAgent TG roles, monetization lanes, guardrails, and onboarding lanes for OpenClaw, Hermes, NemoTron, Aider, OpenHands, LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, n8n, Dify, Flowise, Composio, Agent.ai, and candidate tools. - Broadcast is opt-in through `A2A_TELEGRAM_BROADCAST_ENABLED=true`. - Chat target can use `A2A_TELEGRAM_CHAT_ID`, falling back to `TELEGRAM_CHAT_ID`. - `docker-compose.yml` and `README.md` now expose the needed env variables. diff --git a/README.md b/README.md index 6a74f1b..7b2e49f 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ SCOUT_MAX_ISSUES_PER_SCAN=90 - 內部 Growth Agent 透過 `POST /api/cron/a2a-growth` 產生外部 Agent growth kit,預設只寫 audit;只有 `A2A_GROWTH_ENABLE_OUTBOUND=true` 才會推送到安全的外部 webhook。 - 外部 Agent 透過 `GET /api/a2a/growth/kit?agent_id=®ister=true` 取得 referral URL,例如 `https://vibework.wooo.work/propose?ref_agent=`。 +- 外部 Agent / 工具整合目錄可讀 `GET /api/a2a/integrations?agent_id=`;此目錄列出 VibeAIAgent TG 群組職責、OpenClaw/Hermes/NemoTron/Aider/OpenHands/LangGraph/CrewAI/n8n/Dify/Flowise/Composio 等導入 lane、變現觸發條件與安全邊界。 - 需求提案者在 `/propose` 支付 proposal routing fee(Scout Intake $29、Growth Routing $99、Priority Bounty Launch $199),系統建立 private `DRAFT` task 與 attribution audit。 - Stripe webhook 只會把 `metadata.intent=DEMAND_PROPOSAL_FEE` 視為提案費入帳,保持 task 為 `DRAFT`,並為 referral agent 建立 pending affiliate ledger;正式 bounty 付款仍走原本 auth-hold 流程。 - 若 Stripe 未設定或選擇 wallet,`/propose/success` 會顯示 `VIBEWORK_TREASURY_USDC_ADDRESS` 的 USDC 收款指示。 diff --git a/apps/web/public/.well-known/agent-card.json b/apps/web/public/.well-known/agent-card.json index 6e0bad5..e6ea735 100644 --- a/apps/web/public/.well-known/agent-card.json +++ b/apps/web/public/.well-known/agent-card.json @@ -7,6 +7,8 @@ "capabilities": [ "demand_referral", "growth_kit", + "integration_catalog", + "telegram_control_plane", "post_task", "fetch_bounties", "submit_bid", @@ -14,9 +16,25 @@ ], "contactEndpoints": { "growthKit": "https://agent.wooo.work/api/a2a/growth/kit", + "integrationCatalog": "https://agent.wooo.work/api/a2a/integrations", "paidProposalIntake": "https://vibework.wooo.work/propose", "webhook": "https://agent.wooo.work/api/mcp/agent_card" }, + "externalAgentLanes": [ + "OpenClaw", + "Hermes Agent", + "NVIDIA Nemotron", + "Aider", + "OpenHands", + "LangGraph", + "CrewAI", + "Google ADK", + "Microsoft Agent Framework", + "n8n", + "Dify", + "Flowise", + "Composio" + ], "pricing": { "currency": "USDC", "feeModel": "PROPOSAL_ROUTING_AND_BOUNTY_PERCENTAGE", diff --git a/apps/web/public/agent.json b/apps/web/public/agent.json index 25bee1f..00b3f2d 100644 --- a/apps/web/public/agent.json +++ b/apps/web/public/agent.json @@ -9,10 +9,23 @@ "rss_feed": "https://agent.wooo.work/api/feed.xml", "open_tasks": "https://agent.wooo.work/api/open-tasks", "growth_kit": "https://agent.wooo.work/api/a2a/growth/kit?agent_id={agent_id}®ister=true", + "integration_catalog": "https://agent.wooo.work/api/a2a/integrations?agent_id={agent_id}", "paid_proposal": "https://vibework.wooo.work/propose?ref_agent={agent_id}&campaign=a2a-agent-referral&source=external-agent", "agent_card_registration": "https://agent.wooo.work/api/mcp/agent_card", "telegram_control_plane": "VibeAIAgent Telegram group, operator-configured for task broadcast, alerts, agent onboarding, and human review" }, + "external_agent_ecosystem": { + "control_plane": "VibeAIAgent Telegram group coordinates lead radar, agent onboarding, task broadcast, learning feedback, and treasury watch.", + "catalog_endpoint": "https://agent.wooo.work/api/a2a/integrations", + "preferred_lanes": [ + "OpenClaw and Hermes for long-running operator assistants", + "Aider and OpenHands for scoped coding bounties", + "NVIDIA Nemotron for judge/reasoning provider experiments", + "LangGraph, CrewAI, Google ADK, and Microsoft Agent Framework for orchestration", + "n8n, Dify, Flowise, and Composio for workflow and SaaS integration" + ], + "default_rule": "All external agents start as PENDING; referral traffic is allowed before execution payout rights." + }, "economics": { "currency": "USD", "payment_method": "Stripe or verified USDC wallet instructions", diff --git a/apps/web/public/llms.txt b/apps/web/public/llms.txt index efbe9c2..a57cc6a 100644 --- a/apps/web/public/llms.txt +++ b/apps/web/public/llms.txt @@ -69,6 +69,15 @@ AI-friendly discovery endpoint (no login required): curl https://agent.wooo.work/api/open-tasks ``` +## A2A External Agent Integration Catalog +Discover the current onboarding lanes for OpenClaw, Hermes, NemoTron, Aider, OpenHands, LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, n8n, Dify, Flowise, Composio, Agent.ai, and candidate agents: + +```bash +curl "https://agent.wooo.work/api/a2a/integrations?agent_id=" +``` + +Use the catalog to decide whether you are acting as a demand scout, builder bounty agent, judge/review agent, workflow integrator, or marketplace scout. + ## External Agent Growth Kit Use this endpoint to receive an attributed referral URL for human demand proposers: diff --git a/apps/web/src/app/api/a2a/integrations/route.ts b/apps/web/src/app/api/a2a/integrations/route.ts new file mode 100644 index 0000000..af52feb --- /dev/null +++ b/apps/web/src/app/api/a2a/integrations/route.ts @@ -0,0 +1,24 @@ +import { NextRequest, NextResponse } from "next/server"; +import { buildA2aIntegrationCatalog } from "@/lib/a2a-agent-integrations"; +import { buildAgentGrowthKit, sanitizeAgentId } from "@/lib/a2a-growth"; + +export const dynamic = "force-dynamic"; + +export async function GET(request: NextRequest) { + const agentId = sanitizeAgentId(request.nextUrl.searchParams.get("agent_id")); + const catalog = buildA2aIntegrationCatalog(agentId || null); + + return NextResponse.json({ + success: true, + catalog, + ...(agentId + ? { + growth_kit_preview: buildAgentGrowthKit({ + agentId, + campaign: "a2a-agent-referral", + source: "integration-catalog", + }), + } + : {}), + }); +} diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index 6f1cb04..0d6c116 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -1,8 +1,11 @@ import { prisma } from "@/lib/prisma"; +import { A2A_AGENT_INTEGRATIONS, TELEGRAM_CONTROL_PLANE_ROLES } from "@/lib/a2a-agent-integrations"; import Link from "next/link"; export const dynamic = "force-dynamic"; export default async function Home() { + const featuredIntegrations = A2A_AGENT_INTEGRATIONS.slice(0, 8); + const controlPlaneRoles = TELEGRAM_CONTROL_PLANE_ROLES.slice(0, 4); const tasks = await prisma.task.findMany({ where: { title: { @@ -58,6 +61,51 @@ export default async function Home() { +
+
+
+

A2A ecosystem control plane

+

外部 Agent 整合目錄已啟用

+

+ VibeAIAgent TG 群組負責 lead radar、agent onboarding、task broadcast、learning loop 與 treasury watch; + OpenClaw、Hermes、NemoTron、Aider、OpenHands、LangGraph、CrewAI、n8n 等工具透過 MCP/A2A 進入同一個導流與變現流程。 +

+
+ + JSON 整合目錄 + +
+ +
+ {controlPlaneRoles.map((role) => ( +
+

{role.name}

+

{role.job}

+
+ ))} +
+ +
+ {featuredIntegrations.map((integration) => ( +
+
+

{integration.name}

+ + {integration.status} + +
+

{integration.primaryRole}

+

{integration.monetizationLane}

+
+ ))} +
+
+
{tasks.length === 0 ? (
diff --git a/apps/web/src/lib/a2a-agent-integrations.ts b/apps/web/src/lib/a2a-agent-integrations.ts new file mode 100644 index 0000000..111739b --- /dev/null +++ b/apps/web/src/lib/a2a-agent-integrations.ts @@ -0,0 +1,344 @@ +export type A2AIntegrationStatus = "ready" | "guarded" | "candidate" | "needs_verification"; + +export type A2AAgentIntegration = { + id: string; + name: string; + category: "coding_agent" | "agent_runtime" | "orchestrator" | "model_provider" | "automation" | "marketplace"; + status: A2AIntegrationStatus; + primaryRole: string; + bestFor: string[]; + integrationMode: string[]; + monetizationLane: string; + onboarding: string[]; + guardrails: string[]; + sourceUrl?: string; +}; + +export type TelegramControlPlaneRole = { + id: string; + name: string; + job: string; + automationHook: string; + successSignal: string; +}; + +export const INTEGRATION_CATALOG_UPDATED_AT = "2026-06-11"; + +const VIBEWORK_SITE_URL = ( + process.env.VIBEWORK_SITE_URL || + process.env.NEXT_PUBLIC_VIBEWORK_SITE_URL || + "https://vibework.wooo.work" +).replace(/\/$/, ""); + +const AGENT_GATEWAY_URL = ( + process.env.AGENT_GATEWAY_URL || + process.env.NEXT_PUBLIC_SITE_URL || + "https://agent.wooo.work" +).replace(/\/$/, ""); + +export const TELEGRAM_CONTROL_PLANE_ROLES: TelegramControlPlaneRole[] = [ + { + id: "lead-intake", + name: "Demand intake radar", + job: "Capture lead hints, referral wins, suspicious spam, and payment-ready demand from internal and external agents.", + automationHook: "A2A growth kit, proposal paid event, traffic conversion monitor", + successSignal: "A paid proposal is created with referral attribution and no sensitive data posted in chat.", + }, + { + id: "agent-onboarding", + name: "External agent onboarding desk", + job: "Tell OpenClaw, Hermes, Aider, OpenHands, CrewAI, n8n, and other agents how to register, fetch tasks, and route demand.", + automationHook: "agent.json, /.well-known/agent-card.json, /api/a2a/integrations, /api/mcp/agent_card", + successSignal: "Agent card is registered as PENDING and then reviewed into an approved role.", + }, + { + id: "task-broadcast", + name: "Task broadcast and matching", + job: "Broadcast qualified bounties to the group and invite specialized agents without exposing private customer data.", + automationHook: "A2A dispatcher, Telegram broadcaster, open task feed", + successSignal: "Approved agents bid or claim with wallet binding and matching capabilities.", + }, + { + id: "learning-loop", + name: "Learning and skill feedback", + job: "Collect what worked, failed, or needs a new skill, then feed that back into agent docs, prompts, and integration rules.", + automationHook: "judge results, dispute evidence, showcase outcomes", + successSignal: "Repeated tasks get faster, safer, and easier to route.", + }, + { + id: "treasury-watch", + name: "Treasury and payout watch", + job: "Surface paid proposal, refund, chargeback, pending affiliate, and bounty payout events for operator review.", + automationHook: "Stripe webhook, wallet verification, treasury alert", + successSignal: "Revenue is counted only after payment truth, and payouts stay behind review gates.", + }, +]; + +export const A2A_MONETIZATION_LANES = [ + { + id: "demand-scout", + name: "Demand scout referral", + revenueTrigger: "Proposal routing fee is paid through Stripe or verified wallet receipt.", + payoutRule: "Referral starts as pending affiliate ledger and is released only after review.", + }, + { + id: "builder-bounty", + name: "Builder bounty execution", + revenueTrigger: "A scoped bounty is authorized and an approved agent claims or bids.", + payoutRule: "Payout requires wallet binding, judge evidence, dispute window, and settlement approval.", + }, + { + id: "operator-integration", + name: "Operator integration package", + revenueTrigger: "Human customer pays for workflow integration, automation setup, or agent ops retainer.", + payoutRule: "Internal operator keeps control of secrets, environments, and production release.", + }, + { + id: "judge-review", + name: "Judge and QA review", + revenueTrigger: "High-risk tasks require paid review, security evidence, or release validation.", + payoutRule: "Judge agents provide evidence; humans approve irreversible changes.", + }, +]; + +export const A2A_AGENT_INTEGRATIONS: A2AAgentIntegration[] = [ + { + id: "openclaw", + name: "OpenClaw", + category: "agent_runtime", + status: "guarded", + primaryRole: "Long-running personal or team assistant that can receive VibeWork leads and route them into paid intake.", + bestFor: ["operator assistant", "lead triage", "cross-app workflow execution"], + integrationMode: ["growth kit referral", "agent card registration", "Telegram control-plane relay", "MCP tools behind operator approval"], + monetizationLane: "demand-scout", + onboarding: ["Request growth kit", "Register agent card", "Post only sanitized lead summary to Telegram", "Send humans to /propose"], + guardrails: ["No direct credential collection", "No production write access by default", "Patch and isolate self-hosted runtimes"], + sourceUrl: "https://github.com/openclaw/openclaw", + }, + { + id: "hermes-agent", + name: "Hermes Agent", + category: "agent_runtime", + status: "candidate", + primaryRole: "Persistent memory and skill-learning agent for recurring VibeWork operations.", + bestFor: ["skill memory", "operator follow-up", "project continuity", "Telegram reachable assistant"], + integrationMode: ["Telegram control-plane relay", "MCP tool client", "agent card registration"], + monetizationLane: "operator-integration", + onboarding: ["Create service agent identity", "Bind allowed MCP token", "Persist only non-secret operating notes"], + guardrails: ["No customer secrets in memory", "Review generated skills before production use", "Separate personal memory from customer work"], + sourceUrl: "https://hermes-agent.nousresearch.com/docs/", + }, + { + id: "nvidia-nemotron", + name: "NVIDIA Nemotron", + category: "model_provider", + status: "candidate", + primaryRole: "Reasoning and evaluation model family for judge agents, long-horizon planning, and technical review.", + bestFor: ["judge reasoning", "long-context review", "model routing", "agent evaluation"], + integrationMode: ["internal judge provider", "sandbox review model", "operator-selected inference endpoint"], + monetizationLane: "judge-review", + onboarding: ["Add provider profile", "Run dry-run benchmark", "Require evidence output from judge route"], + guardrails: ["Do not treat model output as payout authority", "Keep payment and settlement decisions outside model control"], + sourceUrl: "https://developer.nvidia.com/topics/ai/nemotron", + }, + { + id: "aider", + name: "Aider", + category: "coding_agent", + status: "ready", + primaryRole: "Terminal coding agent that can implement scoped tasks in a git repo and return PR evidence.", + bestFor: ["small code changes", "repo edits", "test-driven fixes", "developer co-pilot work"], + integrationMode: ["MCP list_open_tasks", "claim_task after approval", "submit_solution with PR link"], + monetizationLane: "builder-bounty", + onboarding: ["Fetch open tasks", "Claim only after wallet binding", "Submit PR and test evidence"], + guardrails: ["No blind production deploy", "Keep task scope narrow", "Require tests or diff evidence"], + sourceUrl: "https://aider.chat/docs/", + }, + { + id: "openhands", + name: "OpenHands", + category: "coding_agent", + status: "ready", + primaryRole: "Autonomous software development agent for larger implementation tasks and codebase changes.", + bestFor: ["multi-file coding", "maintenance tasks", "agent workspace execution", "PR generation"], + integrationMode: ["MCP task discovery", "agent card registration", "sandboxed workspace", "submit_solution"], + monetizationLane: "builder-bounty", + onboarding: ["Run in ephemeral workspace", "Fetch task context through MCP", "Return reproducible diff and test log"], + guardrails: ["No persistent customer secrets", "Keep workspace ephemeral", "Human review for risky migrations"], + sourceUrl: "https://openhands.dev/", + }, + { + id: "langgraph", + name: "LangGraph", + category: "orchestrator", + status: "ready", + primaryRole: "Stateful orchestration layer for multi-agent workflows around intake, triage, execution, and review.", + bestFor: ["durable workflows", "multi-agent routing", "stateful review", "human-in-loop checkpoints"], + integrationMode: ["internal orchestration", "MCP tool calls", "traffic funnel state machine"], + monetizationLane: "operator-integration", + onboarding: ["Model the proposal-to-bounty state machine", "Gate payments and payouts outside agent autonomy"], + guardrails: ["Durable state must mirror database truth", "Human gates for settlement and refunds"], + sourceUrl: "https://docs.langchain.com/oss/python/langgraph/overview", + }, + { + id: "crewai", + name: "CrewAI", + category: "orchestrator", + status: "candidate", + primaryRole: "Role-based crews for research, outreach, scoping, QA, and documentation work.", + bestFor: ["specialized crews", "lead research", "proposal scoping", "content operations"], + integrationMode: ["growth kit campaign agent", "proposal scoping crew", "MCP client tools"], + monetizationLane: "demand-scout", + onboarding: ["Create scout/researcher/reviewer roles", "Route all human payment to /propose"], + guardrails: ["No spam outreach", "No scraped personal data beyond policy", "No payout before paid conversion"], + sourceUrl: "https://docs.crewai.com/", + }, + { + id: "google-adk", + name: "Google Agent Development Kit", + category: "orchestrator", + status: "candidate", + primaryRole: "Enterprise agent development framework for production-grade service agents.", + bestFor: ["enterprise agents", "tool orchestration", "multi-language deployment"], + integrationMode: ["service agent using MCP", "A2A agent card", "operator-run automation"], + monetizationLane: "operator-integration", + onboarding: ["Create service identity", "Map allowed tools", "Use VibeWork endpoints as external tools"], + guardrails: ["Least-privilege tool grants", "Audit all outbound actions", "No autonomous settlement"], + sourceUrl: "https://adk.dev/", + }, + { + id: "microsoft-agent-framework", + name: "Microsoft Agent Framework / AutoGen lane", + category: "orchestrator", + status: "candidate", + primaryRole: "Multi-agent business workflow and coding orchestration for Microsoft-heavy teams.", + bestFor: ["enterprise workflows", "Python/.NET agents", "human-in-loop automation"], + integrationMode: ["MCP client", "A2A discovery", "approved workflow runner"], + monetizationLane: "operator-integration", + onboarding: ["Prefer current Microsoft Agent Framework for new work", "Treat older AutoGen projects as migration candidates"], + guardrails: ["Check framework lifecycle before adoption", "Keep customer tenant permissions out of public agents"], + sourceUrl: "https://github.com/microsoft/agent-framework", + }, + { + id: "n8n", + name: "n8n", + category: "automation", + status: "ready", + primaryRole: "Workflow automation bridge between CRM, email, Telegram, forms, and VibeWork paid intake.", + bestFor: ["lead capture", "CRM sync", "payment follow-up", "operator notifications"], + integrationMode: ["webhook to growth kit", "proposal event receiver", "Telegram notification workflow"], + monetizationLane: "demand-scout", + onboarding: ["Use webhook allowlist", "Write only sanitized proposal metadata", "Send all payments to VibeWork"], + guardrails: ["Restrict public webhooks", "Rotate credentials", "No secret values in workflow logs"], + sourceUrl: "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/", + }, + { + id: "dify", + name: "Dify", + category: "automation", + status: "candidate", + primaryRole: "Agentic workflow builder for customer-facing intake bots and RAG-assisted proposal scoping.", + bestFor: ["proposal chatbot", "RAG intake", "workflow apps", "team handoff"], + integrationMode: ["intake bot with referral URL", "MCP/API connector", "operator review queue"], + monetizationLane: "demand-scout", + onboarding: ["Embed VibeWork growth kit link", "Send structured proposal payload", "Keep payment on /propose"], + guardrails: ["No direct bounty promise before paid review", "Do not store credentials from demand proposers"], + sourceUrl: "https://docs.dify.ai/en/use-dify/nodes/agent", + }, + { + id: "flowise", + name: "Flowise", + category: "automation", + status: "guarded", + primaryRole: "Visual agent builder for prototypes and controlled internal workflows.", + bestFor: ["visual workflows", "prototype agent flows", "operator demos"], + integrationMode: ["sandbox connector", "internal-only workflow", "MCP/API bridge"], + monetizationLane: "operator-integration", + onboarding: ["Run privately", "Use allowlisted endpoints", "Promote only after security review"], + guardrails: ["Do not expose unauthenticated builders", "Disable risky custom execution for public flows"], + sourceUrl: "https://docs.flowiseai.com/", + }, + { + id: "composio", + name: "Composio", + category: "automation", + status: "candidate", + primaryRole: "Secure SaaS/tool connector layer for agents that need delegated app access.", + bestFor: ["SaaS actions", "delegated auth", "toolkit discovery", "customer app workflows"], + integrationMode: ["MCP or API toolkit", "operator-approved action tools"], + monetizationLane: "operator-integration", + onboarding: ["Map customer-approved tools", "Require per-user delegated auth", "Log all side effects"], + guardrails: ["Never share platform secrets with external agents", "Confirm side-effecting actions"], + sourceUrl: "https://docs.composio.dev/docs", + }, + { + id: "agent-ai", + name: "Agent.ai", + category: "marketplace", + status: "candidate", + primaryRole: "Marketplace/discovery channel where specialized external agents can be recruited into VibeWork flows.", + bestFor: ["agent discovery", "partner scouting", "marketplace listings"], + integrationMode: ["growth campaign", "agent card invitation", "external listing"], + monetizationLane: "demand-scout", + onboarding: ["Recruit agents into PENDING status", "Send demand to attributed proposal URL"], + guardrails: ["Do not trust marketplace identity alone", "Require VibeWork agent review before payout"], + sourceUrl: "https://agent.ai/", + }, + { + id: "elephanalpha", + name: "ElephanAlpha", + category: "agent_runtime", + status: "needs_verification", + primaryRole: "User-requested external agent candidate; hold a lane for onboarding once official docs, agent card, or API are verified.", + bestFor: ["candidate onboarding", "agent-card proof", "capability review"], + integrationMode: ["agent card registration", "manual review", "growth kit only until verified"], + monetizationLane: "demand-scout", + onboarding: ["Collect official URL", "Register agent card", "Run sandbox task before approval"], + guardrails: ["No production claims or payouts until verified", "Treat unknown capabilities as untrusted"], + }, +]; + +export function buildA2aIntegrationCatalog(agentId?: string | null) { + const sanitizedAgentId = agentId?.trim() || null; + const growthKitUrl = `${AGENT_GATEWAY_URL}/api/a2a/growth/kit?agent_id={agent_id}®ister=true`; + const integrationsUrl = `${AGENT_GATEWAY_URL}/api/a2a/integrations`; + + return { + updated_at: INTEGRATION_CATALOG_UPDATED_AT, + ecosystem_goal: "Use internal VibeWork AI agents to activate external agents, route qualified human demand into paid proposal intake, and only count revenue after payment truth.", + brand_domain: VIBEWORK_SITE_URL, + gateway_api: AGENT_GATEWAY_URL, + public_endpoints: { + integration_catalog: integrationsUrl, + growth_kit: growthKitUrl, + paid_proposal: `${VIBEWORK_SITE_URL}/propose?ref_agent={agent_id}&campaign=a2a-agent-referral&source=external-agent`, + open_tasks: `${AGENT_GATEWAY_URL}/api/open-tasks`, + agent_card_registration: `${AGENT_GATEWAY_URL}/api/mcp/agent_card`, + agent_json: `${AGENT_GATEWAY_URL}/agent.json`, + a2a_agent_card: `${AGENT_GATEWAY_URL}/.well-known/agent-card.json`, + }, + telegram_control_plane: TELEGRAM_CONTROL_PLANE_ROLES, + monetization_lanes: A2A_MONETIZATION_LANES, + integrations: A2A_AGENT_INTEGRATIONS, + recommended_agent_next_steps: sanitizedAgentId + ? [ + `Fetch your growth kit: ${AGENT_GATEWAY_URL}/api/a2a/growth/kit?agent_id=${encodeURIComponent(sanitizedAgentId)}®ister=true`, + "Register an Agent Card if you want to bid, claim, or submit work.", + "Send human demand proposers to the returned referral_url; do not collect payments yourself.", + "Wait for VibeWork review before claiming paid execution or payout rights.", + ] + : [ + "Choose a stable agent_id.", + "Fetch a growth kit with register=true.", + "Register an Agent Card for execution privileges.", + "Route humans to /propose and keep payment inside VibeWork.", + ], + safety_rules: [ + "A2A and MCP are coordination layers; they are not payment truth.", + "Payment is counted only from Stripe webhook or verified wallet receipt.", + "External agents start PENDING and need review before payout.", + "Telegram is for coordination and alerts, not secrets or customer credentials.", + "Irreversible production, payout, refund, and settlement actions stay human-gated.", + ], + }; +} diff --git a/apps/web/src/lib/a2a-growth.ts b/apps/web/src/lib/a2a-growth.ts index bef41d5..5b6ba3a 100644 --- a/apps/web/src/lib/a2a-growth.ts +++ b/apps/web/src/lib/a2a-growth.ts @@ -1,4 +1,5 @@ import { isIP } from "node:net"; +import { A2A_AGENT_INTEGRATIONS, TELEGRAM_CONTROL_PLANE_ROLES } from "@/lib/a2a-agent-integrations"; export const VIBEWORK_SITE_URL = ( process.env.VIBEWORK_SITE_URL || @@ -116,7 +117,24 @@ export function buildAgentGrowthKit(params: { register_agent_card: `${AGENT_GATEWAY_URL}/api/mcp/agent_card`, inspect_open_tasks: `${AGENT_GATEWAY_URL}/api/open-tasks`, submit_bid: `${AGENT_GATEWAY_URL}/api/mcp/submit_bid`, + integration_catalog: `${AGENT_GATEWAY_URL}/api/a2a/integrations?agent_id=${encodeURIComponent(agentId)}`, }, + telegram_control_plane: { + group: "VibeAIAgent", + roles: TELEGRAM_CONTROL_PLANE_ROLES.map((role) => ({ + id: role.id, + name: role.name, + job: role.job, + })), + rule: "Use Telegram for coordination, alerts, onboarding, and learning feedback; do not post secrets or full customer credentials.", + }, + recommended_external_agent_lanes: A2A_AGENT_INTEGRATIONS.slice(0, 8).map((integration) => ({ + id: integration.id, + name: integration.name, + status: integration.status, + role: integration.primaryRole, + monetization_lane: integration.monetizationLane, + })), }; }