ollama/x/agent
ParthSareen dd74829c27 x: add experimental agent loop with tool approval
Add `--experimental` / `--beta` flag to enable an agent loop that allows
LLMs to use tools (bash, web_search) with interactive user approval.

Features:
- Built-in tools: bash command execution, web search via Ollama API
- Interactive approval UI with arrow key navigation
- Auto-allowlist for safe commands (pwd, git status, npm run, etc.)
- Denylist for dangerous patterns (rm -rf, sudo, credential access)
- Prefix-based allowlist for approved directories (cat src/ approves cat src/*)
- Warning box for commands targeting paths outside project directory

Architecture:
- x/tools/: Tool registry, bash executor, web search client
- x/agent/: Approval manager with TUI selector
- x/cmd/: Agent loop orchestration

The readline change fixes a stdin race condition where background goroutine
consumption caused double-keypress issues in the approval UI.
2026-01-05 21:53:46 -08:00
..
approval.go x: add experimental agent loop with tool approval 2026-01-05 21:53:46 -08:00
approval_test.go x: add experimental agent loop with tool approval 2026-01-05 21:53:46 -08:00