merge(F6): integrate W3 frente F6 into base

This commit is contained in:
diegosouzapw
2026-05-27 22:17:24 -03:00
5 changed files with 252 additions and 0 deletions

View File

@@ -102,6 +102,15 @@ export async function GET() {
"Summarize active rate limits and lockouts",
],
},
{
id: "list-capabilities",
name: "List Capabilities",
description:
"Returns the full catalog of 42 OmniRoute agent skills (22 API + 20 CLI) " +
"with raw URLs for the SKILL.md docs.",
tags: ["discovery", "capabilities"],
examples: ["What can you do?", "List your skills", "Show capabilities"],
},
],
authentication: {
schemes: ["api-key"],

View File

@@ -0,0 +1,72 @@
/**
* A2A Skill: List Capabilities
*
* Returns the full catalog of 42 OmniRoute agent skills (22 API + 20 CLI)
* as a markdown table with raw SKILL.md URLs for orchestrating agents.
*/
import type { A2ATask, TaskArtifact } from "../taskManager";
import { getCatalog, computeCoverage } from "@/lib/agentSkills/catalog";
import type { AgentSkill } from "@/lib/agentSkills/types";
export interface ListCapabilitiesResult {
artifacts: TaskArtifact[];
metadata: {
coverage: {
api: { have: number; total: 22 };
cli: { have: number; total: 20 };
};
totalSkills: 42;
generatedAt: string;
source: "agent-skills-catalog";
};
}
function buildMarkdownTable(skills: AgentSkill[]): string {
const header = "| ID | Name | Category | Area | Endpoints/Commands | Raw URL |";
const separator = "| --- | --- | --- | --- | --- | --- |";
const rows = skills.map((skill) => {
const endpointsOrCommands =
skill.category === "api"
? (skill.endpoints ?? []).join(", ") || "—"
: (skill.cliCommands ?? []).join(", ") || "—";
return `| ${skill.id} | ${skill.name} | ${skill.category} | ${skill.area} | ${endpointsOrCommands} | ${skill.rawUrl} |`;
});
return [header, separator, ...rows].join("\n");
}
export async function executeListCapabilities(_task: A2ATask): Promise<ListCapabilitiesResult> {
const catalog = getCatalog();
const coverage = computeCoverage();
const table = buildMarkdownTable(catalog);
const content = [
`# OmniRoute Agent Skills Catalog`,
``,
`Total: ${catalog.length} skills (${coverage.api.total} API + ${coverage.cli.total} CLI)`,
``,
table,
].join("\n");
return {
artifacts: [
{
type: "text",
content,
},
],
metadata: {
coverage: {
api: { have: coverage.api.have, total: 22 },
cli: { have: coverage.cli.have, total: 20 },
},
totalSkills: 42,
generatedAt: coverage.generatedAt,
source: "agent-skills-catalog",
},
};
}

View File

@@ -37,6 +37,10 @@ export const A2A_SKILL_HANDLERS: Record<string, A2ASkillHandler> = {
const skillModule = await import("./skills/healthReport");
return skillModule.executeHealthReport(task);
},
"list-capabilities": async (task) => {
const skillModule = await import("./skills/listCapabilities");
return skillModule.executeListCapabilities(task);
},
};
export async function executeA2ATaskWithState(