Usability pass: tool registry, TUI polish, saved keys and settings
Tools - Table-driven tool registry with permission classes and default/minimal profiles; new tools: edit_file, list_dir, glob, grep, delete_file, move_file, todo_write, web_fetch, ask_user (plus read_file paging). - Built-in Myers diff; write tools return unified diffs. - Persistent permission rules (.agent/permissions.json), per-turn undo snapshots (.agent/undo), AGENTS.md project notes, auto-compact at 80% of the model context, cancellable run_shell with process-group kill. TUI - Table-driven slash commands: /provider /key /effort /status /tools /permissions /yolo /undo /retry /diff /export /copy /rename /delete /init /max-steps /todo, with / and @ completion. - Permission modal with diff and prefix rules, ask_user modal, todo panel, header with model/effort/context, bracketed paste, line editing, wide-char cursor, NO_COLOR and ASCII fallback; Esc never quits. Startup and configuration - API keys are entered in the TUI (hidden) and saved per provider in <config>/credentials (0600); env variables are only a fallback. - Last provider, per-provider model and reasoning effort are remembered in <config>/settings.json; --effort/-e and /effort send reasoning_effort (low|medium|high|max) to models that accept it. - DeepSeek preset uses deepseek-flash / deepseek-v4-pro. - Session flags --new/--continue/--resume/--list-sessions, --yolo, --confirm. Compatibility and tests - ncurses detection, macOS/Homebrew support, make install, XDG config dir, POSIX cleanups; Gitea CI (gcc/clang/asan/musl/macOS). - Unit tests for diff, fs tools, registry, undo/perms and config; e2e fixtures multi_file_refactor and ask_or_todo; vendored cJSON.
This commit is contained in:
+17
-11
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# One-shot: clone (optional) + build CST-Agent on Linux.
|
||||
# One-shot: clone (optional) + build CST-Agent on Linux, WSL or macOS.
|
||||
set -euo pipefail
|
||||
|
||||
REPO_URL="${CST_AGENT_REPO:-https://git.whcself.xyz/WHC/CST-agent.git}"
|
||||
@@ -19,22 +19,28 @@ if [[ ! -f "$DIR/Makefile" ]]; then
|
||||
fi
|
||||
cd "$DIR"
|
||||
|
||||
echo "==> deps hint: gcc/clang make cmake libcurl ncursesw (zenity optional)"
|
||||
if command -v pacman >/dev/null 2>&1; then
|
||||
echo "==> deps hint: gcc/clang make cmake libcurl ncursesw"
|
||||
if [[ "$(uname -s)" == Darwin ]]; then
|
||||
echo " macOS: xcode-select --install && brew install ncurses curl pkg-config"
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
echo " Arch: sudo pacman -S --needed base-devel cmake curl ncurses"
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
echo " Debian: sudo apt install build-essential cmake libcurl4-openssl-dev libncurses-dev"
|
||||
echo " Debian/Ubuntu/WSL: sudo apt install build-essential cmake pkg-config libcurl4-openssl-dev libncurses-dev"
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
echo " Fedora: sudo dnf install gcc make cmake pkgconf libcurl-devel ncurses-devel"
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
echo " Alpine: sudo apk add build-base pkgconf curl-dev ncurses-dev"
|
||||
elif command -v nix-shell >/dev/null 2>&1; then
|
||||
echo " Nix: nix-shell (uses shell.nix), then rerun this script"
|
||||
fi
|
||||
|
||||
JOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)"
|
||||
echo "==> make"
|
||||
make -j"$(nproc 2>/dev/null || echo 4)"
|
||||
make -j"$JOBS"
|
||||
make check || true
|
||||
|
||||
echo
|
||||
echo "OK: ./cst-agent"
|
||||
echo "OpenAI-compatible env (see docs/env_openai.md):"
|
||||
echo " export OPENAI_API_KEY=sk-..."
|
||||
echo " export OPENAI_BASE_URL=https://api.openai.com/v1"
|
||||
echo " export OPENAI_MODEL=gpt-4.1-mini"
|
||||
echo " ./cst-agent --workspace ."
|
||||
echo "Or MiniMax default: export CST_API_KEY=... && ./cst-agent --workspace ."
|
||||
echo "Install: make install PREFIX=\$HOME/.local"
|
||||
echo "Run it inside a project directory: cst-agent"
|
||||
echo " (the first start asks for the provider and its API key and saves them)"
|
||||
|
||||
Reference in New Issue
Block a user