diff --git a/navi/tools/filesystem.py b/navi/tools/filesystem.py index 9c8470f..36f2949 100644 --- a/navi/tools/filesystem.py +++ b/navi/tools/filesystem.py @@ -231,7 +231,7 @@ "type": "string", "enum": [ "read", "write", "append", "list", "find", "find_up", - "info", "move", "delete", "exists", + "info", "move", "delete", "exists", "mkdir", "query", "smart_edit", ], "description": "Operation to perform.", @@ -321,6 +321,7 @@ case "move": return await asyncio.to_thread(self._move, path, params) case "delete": return await asyncio.to_thread(self._delete, path) case "exists": return ToolResult(success=True, output="true" if path.exists() else "false") + case "mkdir": return await asyncio.to_thread(self._mkdir, path) case "query": return await self._query(path, params) case "smart_edit": return await self._smart_edit(path, params) case _: @@ -514,6 +515,10 @@ shutil.move(str(path), str(dest)) return ToolResult(success=True, output=f"Moved: {path} → {dest}") + def _mkdir(self, path: Path) -> ToolResult: + path.mkdir(parents=True, exist_ok=True) + return ToolResult(success=True, output=f"Directory ready: {path}") + def _delete(self, path: Path) -> ToolResult: if not path.exists(): return ToolResult(success=False, output=f"Not found: {path}", error="not_found")