diff --git a/metagpt/tools/libs/__init__.py b/metagpt/tools/libs/__init__.py index f21307724..f2ae30f03 100644 --- a/metagpt/tools/libs/__init__.py +++ b/metagpt/tools/libs/__init__.py @@ -15,6 +15,7 @@ from metagpt.tools.libs import ( file_manager, browser, deployer, + git, ) from metagpt.tools.libs.env import get_env, set_get_env_entry, default_get_env, get_env_description @@ -29,6 +30,7 @@ _ = ( file_manager, browser, deployer, + git, get_env, get_env_description, set_get_env_entry, diff --git a/metagpt/tools/libs/git.py b/metagpt/tools/libs/git.py index 4c67c306c..aa701e49b 100644 --- a/metagpt/tools/libs/git.py +++ b/metagpt/tools/libs/git.py @@ -12,8 +12,8 @@ from metagpt.tools.tool_registry import register_tool from metagpt.utils.git_repository import GitBranch, GitRepository -@register_tool(tags=["software development", "git", "Clone a git repository to local"]) -async def git_clone(url: Union[str, Path], output_dir: Union[str, Path] = None) -> Path: +# @register_tool(tags=["git"]) +async def git_clone(url: str, output_dir: str | Path = None) -> Path: """ Clones a Git repository from the given URL. diff --git a/metagpt/tools/libs/terminal.py b/metagpt/tools/libs/terminal.py index 5f5989e1a..4eb6f598b 100644 --- a/metagpt/tools/libs/terminal.py +++ b/metagpt/tools/libs/terminal.py @@ -33,6 +33,12 @@ class Terminal: self.stdout_queue = Queue() self.observer = TerminalReporter() + self._check_state() + + def _check_state(self): + """Check the state of the terminal, e.g. the current directory of the terminal process. Useful for agent to understand.""" + print("The terminal is at:", self.run_command("pwd")) + def run_command(self, cmd: str, daemon=False) -> str: """ Executes a specified command in the terminal and streams the output back in real time.