From 95ea8c8b72d2dbb20ab860ab1505b46add280773 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 27 Nov 2026 19:55:24 +0530 Subject: 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 --- src/agentux/tools/repomap_tool.py | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/agentux/tools/repomap_tool.py (limited to 'src/agentux/tools/repomap_tool.py') 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) -- cgit v1.2.3