from typing import Annotated from fastapi import Depends, HTTPException from ..apirouters import agents from ..entities.agent import Agent from ..entities.ship import Ship async def get_ship(ship_symbol: str, agent: Annotated[Agent, Depends(agents.auth_agent)]) -> Ship: for ship in agent.ships.values(): if ship.symbol == ship_symbol: return ship raise HTTPException(status_code=400, detail="Unknown ship symbol.")