"""Minimal AICC bridge with a capsule in a room. Run: python examples/bridge_minimal.py Then connect from another terminal: python examples/agent_minimal.py """ import asyncio from aicc import Bridge from aicc.transport import WebSocketServer async def main() -> None: bridge = Bridge(name="capsule-room", kind="3d", tick_rate_hz=10.0) @bridge.tool(description="Get the agent's current position and rotation.") async def proprioception() -> dict: return { "position": {"x": 1.0, "y": 0.5, "z": 2.0}, "rotation": {"yaw": 0.0, "pitch": 0.0}, "velocity": {"x": 0.0, "y": 0.0, "z": 0.0}, "health": 100, } @bridge.tool(description="Move the agent forward by the given distance in meters.") async def move(forward: float = 0.0) -> dict: return {"moved": forward} @bridge.tool(description="Turn the agent's heading by the given yaw angle in degrees.") async def turn(yaw: float = 0.0) -> dict: return {"turned": yaw} print(f"AICC bridge '{bridge.name}' listening on ws://127.0.0.1:8765") async with WebSocketServer(bridge, port=8765): await bridge.serve_forever() if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: pass