/**
* A2A Agent Card Generator
* Produces a JSON Agent Card describing this gateway's capabilities
* for agent-to-agent discovery via the A2A protocol.
*/
import type { AgentCard, AgentSkill } from './types.js';
import type { GatewayConfig } from '../types.js';
const AGENT_SKILLS: AgentSkill[] = [
{
id: 'scout_inventory',
name: 'Scout Inventory',
description:
'Search the Shopify catalog for products matching query, category, and price filters.',
inputModes: ['application/json'],
outputModes: ['application/json'],
},
{
id: 'manage_cart',
name: 'Manage Cart',
description:
'Create, modify, or retrieve a Shopify cart (create, add, remove, get).',
inputModes: ['application/json'],
outputModes: ['application/json'],
},
{
id: 'negotiate_terms',
name: 'Negotiate Terms',
description:
'Negotiate capabilities, discounts, and shipping options between an agent and the merchant.',
inputModes: ['application/json'],
outputModes: ['application/json'],
},
{
id: 'execute_checkout',
name: 'Execute Checkout',
description:
'Execute a full checkout with AP2 mandate chain verification (intent, cart, payment mandates).',
inputModes: ['application/json'],
outputModes: ['application/json'],
},
{
id: 'track_order',
name: 'Track Order',
description:
'Retrieve order status and fulfillment tracking information.',
inputModes: ['application/json'],
outputModes: ['application/json'],
},
];
/**
* Generates a full A2A Agent Card for the /.well-known/agent.json endpoint.
*/
export function generateAgentCard(config: GatewayConfig): AgentCard {
return {
name: 'shopify-agentic-mcp',
description:
'UCP/AP2/MCP compliant gateway for autonomous AI commerce on Shopify',
url: `${config.gateway.baseUrl}/a2a`,
version: '0.1.0',
capabilities: {
streaming: false,
pushNotifications: false,
},
skills: AGENT_SKILLS,
defaultInputModes: ['application/json'],
defaultOutputModes: ['application/json'],
};
}