| 212 | |
| 213 | describe('agentCardOutput', () => { |
| 214 | function makeCard(fields: { |
| 215 | supportedInterfaces?: Array<{ url: string; protocolVersion: string }> |
| 216 | skills?: Array<{ id: string; name: string; description: string }> |
| 217 | }): AgentCard { |
| 218 | return { |
| 219 | name: 'Agent', |
| 220 | description: 'desc', |
| 221 | version: '1.2.3', |
| 222 | supportedInterfaces: fields.supportedInterfaces ?? [], |
| 223 | capabilities: undefined, |
| 224 | skills: fields.skills ?? [], |
| 225 | defaultInputModes: [], |
| 226 | defaultOutputModes: [], |
| 227 | } as unknown as AgentCard |
| 228 | } |
| 229 | |
| 230 | it('falls back to the agent url when there are no interfaces', () => { |
| 231 | const out = agentCardOutput(makeCard({}), 'https://fallback.example/a2a') |