fix: add type hints in cleanup_unused_files.py

Updates type annotations to use built-in types like `list` and `dict`, and uses `| None` for optional types, along with adding `from __future__ import annotations`

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 832522395
This commit is contained in:
George Weale
2025-11-14 17:58:37 -08:00
committed by Copybara-Service
parent 871da731f1
commit 2dea5733b7
@@ -14,10 +14,9 @@
"""Cleanup unused files tool for Agent Builder Assistant."""
from __future__ import annotations
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from google.adk.tools.tool_context import ToolContext
@@ -26,11 +25,11 @@ from ..utils.resolve_root_directory import resolve_file_paths
async def cleanup_unused_files(
used_files: List[str],
used_files: list[str],
tool_context: ToolContext,
file_patterns: Optional[List[str]] = None,
exclude_patterns: Optional[List[str]] = None,
) -> Dict[str, Any]:
file_patterns: list[str] | None = None,
exclude_patterns: list[str] | None = None,
) -> dict[str, Any]:
"""Identify and optionally delete unused files in project directories.
This tool helps clean up unused tool files when agent configurations change.