diff options
| author | Claude Code <noreply@anthropic.com> | 2026-11-27 19:55:24 +0530 |
|---|---|---|
| committer | Claude Code <noreply@anthropic.com> | 2026-11-27 19:55:24 +0530 |
| commit | 95ea8c8b72d2dbb20ab860ab1505b46add280773 (patch) | |
| tree | 210c05e766819f336fcaf6892690a3d551fe7789 /src/agentux/tools/repomap_tool.py | |
| parent | f466d2bb6d8cf04627462e36b98f2d18a6e37aa5 (diff) | |
Commit modules required for a working Agentux install
agent.py imports context, memory, theme, and several tools that were
present on disk but uncommitted, so a clean clone produced a broken
installation (import agentux failed). Commit them so the repository's
committed state is complete and cloneable.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Diffstat (limited to 'src/agentux/tools/repomap_tool.py')
| -rw-r--r-- | src/agentux/tools/repomap_tool.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/agentux/tools/repomap_tool.py b/src/agentux/tools/repomap_tool.py new file mode 100644 index 0000000..c265c51 --- /dev/null +++ b/src/agentux/tools/repomap_tool.py @@ -0,0 +1,49 @@ +"""Repomap tool for Agentux.""" + +from __future__ import annotations + +from typing import Any, Dict +from ..models import ToolDefinition +from ..repomap import RepoMap +from .base import BaseTool + + +class RepomapTool(BaseTool): + """Tool allowing the agent to inspect the codebase symbol outline.""" + + def __init__(self, root: str) -> None: + self.repomap = RepoMap(root) + + @property + def name(self) -> str: + return "repomap" + + @property + def description(self) -> str: + return ( + "Generate a compact, token-efficient repository symbol map. " + "Shows all classes, structs, functions, methods, and line numbers " + "across the codebase without reading entire files. " + "Optionally filter by symbol query or path keyword." + ) + + @property + def parameters(self) -> Dict[str, Any]: + return { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Optional symbol name, keyword, or path to filter the map.", + }, + "max_tokens": { + "type": "integer", + "description": "Maximum token budget for the map (default 600).", + }, + }, + } + + async def execute(self, **kwargs: Any) -> str: + query = kwargs.get("query") + max_tokens = int(kwargs.get("max_tokens", 600)) + return self.repomap.generate_map(max_tokens=max_tokens, query=query) |
