import { A2A_PROTOCOL_VERSION } from '../../constants/a2a/index.js';
function toolToA2ASkill(toolName) {
    return {
        id: `tool-${toolName}`,
        name: toolName,
        description: `Execute ${toolName} tool`,
        tags: ['tool'],
    };
}
function skillToA2ASkill(skill) {
    return {
        id: skill.metadata.name,
        name: skill.metadata.name,
        description: skill.metadata.description,
        tags: ['procedure'],
    };
}
export function buildAgentCard(info, config, skills) {
    const a2aSkills = [];
    for (const toolName of info.tools) {
        a2aSkills.push(toolToA2ASkill(toolName));
    }
    if (skills) {
        for (const skill of skills) {
            a2aSkills.push(skillToA2ASkill(skill));
        }
    }
    return {
        name: info.name,
        description: info.description,
        version: info.version,
        protocolVersion: A2A_PROTOCOL_VERSION,
        provider: {
            organization: config.providerOrganization ?? 'Namzu',
            url: config.providerUrl,
        },
        capabilities: {
            streaming: info.capabilities?.supportsStreaming ?? false,
            pushNotifications: false,
            extendedAgentCard: false,
        },
        defaultInputModes: ['text'],
        defaultOutputModes: ['text'],
        skills: a2aSkills,
        supportedInterfaces: [
            {
                url: `${config.baseUrl}/a2a/${info.id}`,
                transport: config.transport,
            },
        ],
        securitySchemes: {
            bearer: {
                type: 'http',
                scheme: 'bearer',
            },
        },
        securityRequirements: [{ bearer: [] }],
    };
}
//# sourceMappingURL=agent-card.js.map