feat: add Explore agent with PydanticAI tool calling

Implements the first Claude-like agent for codebase exploration:

Core Features:
- Explore agent with glob, grep, read, and bash tools
- Native PydanticAI tool calling with Ollama/Mistral Nemo
- Sanitized Ollama provider (fixes content:null issue)
- REST API endpoints for agent execution

Tool Infrastructure:
- BaseTool abstract class with ToolResult dataclass
- ReadFileTool, GlobFilesTool, GrepContentTool, BashReadOnlyTool
- Path validation and sandboxing support

CLI Client (separate package for future extraction):
- webber-cli command with chat, explore, status commands
- Communicates with Webber API backend
- Rich console output with theming

Configuration:
- Dev server on port 8095 (production uses 8086)
- Mistral Nemo optimizations (temp 0.3, tool_choice required)

Tests: 24 tests covering tools and API endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-10 01:26:30 +01:00
co-authored by Claude Opus 4.5
parent 667e2ca8e4
commit f4e8552298
45 changed files with 3299 additions and 12 deletions
+11 -7
View File
@@ -11,11 +11,14 @@ NC='\033[0m' # No Color
echo -e "${GREEN}Starting Webber...${NC}"
# Check if port 8086 is already in use
if lsof -Pi :8086 -sTCP:LISTEN -t >/dev/null 2>&1 ; then
echo -e "${RED}Error: Port 8086 is already in use${NC}"
echo "Run: lsof -i :8086 to see what's using it"
echo "Or run: kill \$(lsof -t -i:8086) to stop it"
# Development port (8095) - Production uses 8086 in Docker
DEV_PORT=8095
# Check if dev port is already in use
if lsof -Pi :$DEV_PORT -sTCP:LISTEN -t >/dev/null 2>&1 ; then
echo -e "${RED}Error: Port $DEV_PORT is already in use${NC}"
echo "Run: lsof -i :$DEV_PORT to see what's using it"
echo "Or run: kill \$(lsof -t -i:$DEV_PORT) to stop it"
exit 1
fi
@@ -41,8 +44,9 @@ LOG_FILE="$LOGS_DIR/server.log"
echo -e "${YELLOW}Logs will be written to: ${LOG_FILE}${NC}"
# Start the server
echo -e "${GREEN}Starting uvicorn server on http://localhost:8086${NC}"
echo -e "${GREEN}Starting uvicorn server on http://localhost:$DEV_PORT${NC}"
echo -e "${YELLOW}Production is on :8086, dev is on :$DEV_PORT${NC}"
echo -e "${YELLOW}Press Ctrl+C to stop the server${NC}"
echo ""
uvicorn src.main:app --reload --host 0.0.0.0 --port 8086 2>&1 | tee "$LOG_FILE"
uvicorn src.main:app --reload --host 0.0.0.0 --port $DEV_PORT 2>&1 | tee "$LOG_FILE"