refactor: main.go into agent directory