ollama/readline
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
..
buffer.go chore: upgrade to gods v2 2024-12-21 00:05:16 -08:00
errors.go lint 2024-08-01 17:06:06 -07:00
history.go chore: upgrade to gods v2 2024-12-21 00:05:16 -08:00
readline.go x: add experimental agent loop with tool approval 2026-01-05 21:53:46 -08:00
readline_unix.go stdin.fd 2024-06-04 11:13:30 -07:00
readline_windows.go stdin.fd 2024-06-04 11:13:30 -07:00
term.go stdin.fd 2024-06-04 11:13:30 -07:00
term_bsd.go stdin.fd 2024-06-04 11:13:30 -07:00
term_linux.go lint 2024-08-01 17:06:06 -07:00
term_windows.go stdin.fd 2024-06-04 11:13:30 -07:00
types.go add thinking support to the api and cli (#10584) 2025-05-28 19:38:52 -07:00