feat: expose A2A agent integration catalog
All checks were successful
CI and Production Smoke / smoke (push) Successful in 11s
All checks were successful
CI and Production Smoke / smoke (push) Successful in 11s
This commit is contained in:
24
apps/web/src/app/api/a2a/integrations/route.ts
Normal file
24
apps/web/src/app/api/a2a/integrations/route.ts
Normal file
@@ -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",
|
||||
}),
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
}
|
||||
@@ -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() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section className="mb-10 border border-cyan-500/20 bg-cyan-500/5 p-6 rounded-lg">
|
||||
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
|
||||
<div>
|
||||
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-cyan-300">A2A ecosystem control plane</p>
|
||||
<h2 className="mt-2 text-2xl font-bold text-white">外部 Agent 整合目錄已啟用</h2>
|
||||
<p className="mt-2 max-w-3xl text-sm leading-6 text-gray-300">
|
||||
VibeAIAgent TG 群組負責 lead radar、agent onboarding、task broadcast、learning loop 與 treasury watch;
|
||||
OpenClaw、Hermes、NemoTron、Aider、OpenHands、LangGraph、CrewAI、n8n 等工具透過 MCP/A2A 進入同一個導流與變現流程。
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="https://agent.wooo.work/api/a2a/integrations"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex shrink-0 items-center justify-center rounded-md border border-cyan-300/40 px-4 py-2 text-sm font-semibold text-cyan-100 hover:border-cyan-200 hover:bg-cyan-300/10"
|
||||
>
|
||||
JSON 整合目錄
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
||||
{controlPlaneRoles.map((role) => (
|
||||
<div key={role.id} className="rounded-md border border-white/10 bg-gray-950/60 p-4">
|
||||
<h3 className="text-sm font-semibold text-white">{role.name}</h3>
|
||||
<p className="mt-2 text-xs leading-5 text-gray-400">{role.job}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-6 grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
||||
{featuredIntegrations.map((integration) => (
|
||||
<div key={integration.id} className="rounded-md border border-white/10 bg-gray-950/70 p-4">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<h3 className="text-sm font-semibold text-white">{integration.name}</h3>
|
||||
<span className="rounded-sm bg-cyan-400/10 px-2 py-1 text-[10px] font-semibold uppercase text-cyan-200">
|
||||
{integration.status}
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-2 text-xs leading-5 text-gray-400">{integration.primaryRole}</p>
|
||||
<p className="mt-3 text-[11px] uppercase tracking-wide text-emerald-300">{integration.monetizationLane}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{tasks.length === 0 ? (
|
||||
<div className="col-span-full text-center py-20 text-gray-500">
|
||||
|
||||
Reference in New Issue
Block a user