Agent Core (agent.go)
This component defines the autonomous agent's core logic and interaction with the environment. It is responsible for decision-making, tool selection, and communication with the Gemini API.
- Constants: Defines model parameters such as MODEL_BIG and MODEL_SMALL.
- Variables: Conversation history, working directory, and response temperature settings.
- Functions:
- handleChatCompletion: Manages chat interactions with the Gemini API.
- handleToolCall: Executes tool calls for environment interaction.
- YesNoQuestion: Facilitates yes/no queries with enforced responses.
Code Manipulation (code.go)
This module contains tools for reading, linting, and modifying Go code, critical for the agent's ability to maintain and extend the codebase.
- Linting: Automatic code quality checks and fixes.
- Code Reading: Extract specific function implementations.
- Function Editing: Add or modify functions programmatically.
File System Interaction (file.go)
Provides file and directory manipulation abilities including reading, writing, directory listing, and gitignore-aware filtering.
- Gitignore Handling: Understands and respects .gitignore patterns.
- File Operations: Read, write, create directories, and search file content.
Web Interaction (web.go)
Enables web page visits and searches as part of the agent's research and information gathering capabilities.
Wiki Generation (wiki.go)
Supports generating and updating project documentation to keep it accurate and comprehensive.